Skip to content

Commit

Permalink
re-added examples
Browse files Browse the repository at this point in the history
  • Loading branch information
MrSurly committed Mar 20, 2023
1 parent 7e259fe commit ac2347c
Show file tree
Hide file tree
Showing 5 changed files with 134 additions and 0 deletions.
11 changes: 11 additions & 0 deletions components/lv_examples/CMakeLists.txt
@@ -0,0 +1,11 @@
if(ESP_PLATFORM)

file(GLOB_RECURSE SOURCES lv_examples/*.c)

idf_component_register(SRCS ${SOURCES}
INCLUDE_DIRS .
REQUIRES lvgl)

else()
message(FATAL_ERROR "LVGL LV examples: ESP_PLATFORM is not defined. Try reinstalling ESP-IDF.")
endif()
29 changes: 29 additions & 0 deletions components/lv_examples/Kconfig
@@ -0,0 +1,29 @@
# Kconfig for lv_examples v7.4.0

menu "lv_examples configuration"

config LV_EX_PRINTF
bool "Enable printf-ing data in demos and examples."

choice LV_EX_CHOICE
prompt "Select the demo you want to run."
default LV_USE_DEMO_WIDGETS

config LV_USE_DEMO_WIDGETS
bool "Show demo widgets."

config LV_USE_DEMO_KEYPAD_AND_ENCODER
bool "Demonstrate the usage of encoder and keyboard."

config LV_USE_DEMO_BENCHMARK
bool "Benchmark your system."

config LV_USE_DEMO_STRESS
bool "Stress test for LVGL."
endchoice

config LV_DEMO_WIDGETS_SLIDESHOW
bool "Slide demo widgets automatically."
depends on LV_USE_DEMO_WIDGETS
default y
endmenu
16 changes: 16 additions & 0 deletions components/lv_examples/component.mk
@@ -0,0 +1,16 @@
#
# Component Makefile
#

CFLAGS += -DLV_LVGL_H_INCLUDE_SIMPLE

COMPONENT_SRCDIRS := lv_examples \
lv_examples/src/lv_demo_benchmark \
lv_examples/src/lv_demo_keypad_encoder \
lv_examples/src/demo_stress \
lv_examples/src/lv_demo_widgets \
lv_examples/src/lv_ex_style \
lv_examples/src/lv_ex_widgets \
lv_examples/assets

COMPONENT_ADD_INCLUDEDIRS := $(COMPONENT_SRCDIRS) .
77 changes: 77 additions & 0 deletions components/lv_examples/lv_ex_conf.h
@@ -0,0 +1,77 @@
/**
* @file lv_ex_conf.h
* Configuration file for v7.4.0
*
*/
/*
* COPY THIS FILE AS lv_ex_conf.h
*/

#if 1 /*Set it to "1" to enable the content*/

#ifndef LV_EX_CONF_H
#define LV_EX_CONF_H


/*******************
* GENERAL SETTING
*******************/

/* Enable printf-ing data in demoes and examples */
#ifdef CONFIG_LV_EX_PRINTF
#define LV_EX_PRINTF 1
#else
#define LV_EX_PRINTF 0
#endif

#define LV_EX_KEYBOARD 0 /*Add PC keyboard support to some examples (`lv_drivers` repository is required)*/
#define LV_EX_MOUSEWHEEL 0 /*Add 'encoder' (mouse wheel) support to some examples (`lv_drivers` repository is required)*/

/*********************
* DEMO USAGE
*********************/

/*Show some widget*/
#ifdef CONFIG_LV_USE_DEMO_WIDGETS
#define LV_USE_DEMO_WIDGETS 1
#else
#define LV_USE_DEMO_WIDGETS 0
#endif

#if LV_USE_DEMO_WIDGETS
#ifdef CONFIG_LV_DEMO_WIDGETS_SLIDESHOW
#define LV_DEMO_WIDGETS_SLIDESHOW 1
#else
#define LV_DEMO_WIDGETS_SLIDESHOW 0
#endif
#endif

/*Printer demo, optimized for 800x480*/
#define LV_USE_DEMO_PRINTER 0

/*Demonstrate the usage of encoder and keyboard*/
#ifdef CONFIG_LV_USE_DEMO_KEYPAD_AND_ENCODER
#define LV_USE_DEMO_KEYPAD_AND_ENCODER 1
#else
#define LV_USE_DEMO_KEYPAD_AND_ENCODER 0
#endif

/*Benchmark your system*/
#ifdef CONFIG_LV_USE_DEMO_BENCHMARK
#define LV_USE_DEMO_BENCHMARK 1
#else
#define LV_USE_DEMO_BENCHMARK 0
#endif

/*Stress test for LVGL*/
#ifdef CONFIG_LV_USE_DEMO_STRESS
#define LV_USE_DEMO_STRESS 1
#else
#define LV_USE_DEMO_STRESS 0

#endif

#endif /*LV_EX_CONF_H*/

#endif /*End of "Content enable"*/

1 change: 1 addition & 0 deletions components/lv_examples/lv_examples
Submodule lv_examples added at 3f41b7

0 comments on commit ac2347c

Please sign in to comment.