From c53abc5fdb11bbc440f223db49411ffb925685c6 Mon Sep 17 00:00:00 2001 From: Neo Xu Date: Fri, 9 Feb 2024 13:18:23 +0800 Subject: [PATCH] apps/lvgl: upgrade to lvgl version v9 Signed-off-by: Neo Xu --- examples/lvgldemo/CMakeLists.txt | 2 +- examples/lvgldemo/lvgldemo.c | 183 +-- graphics/lvgl/CMakeLists.txt | 66 +- graphics/lvgl/Kconfig | 1735 ++++++++++++++++++++++--- graphics/lvgl/Makefile | 63 +- graphics/lvgl/lv_conf/Kconfig | 1115 ---------------- graphics/lvgl/port/lv_port.c | 91 -- graphics/lvgl/port/lv_port.h | 67 - graphics/lvgl/port/lv_port_button.c | 238 ---- graphics/lvgl/port/lv_port_button.h | 80 -- graphics/lvgl/port/lv_port_encoder.c | 162 --- graphics/lvgl/port/lv_port_encoder.h | 80 -- graphics/lvgl/port/lv_port_fbdev.c | 675 ---------- graphics/lvgl/port/lv_port_fbdev.h | 80 -- graphics/lvgl/port/lv_port_keypad.c | 252 ---- graphics/lvgl/port/lv_port_keypad.h | 76 -- graphics/lvgl/port/lv_port_lcddev.c | 304 ----- graphics/lvgl/port/lv_port_lcddev.h | 82 -- graphics/lvgl/port/lv_port_libuv.c | 186 --- graphics/lvgl/port/lv_port_libuv.h | 92 -- graphics/lvgl/port/lv_port_mem.c | 173 --- graphics/lvgl/port/lv_port_mem.h | 92 -- graphics/lvgl/port/lv_port_syslog.c | 57 - graphics/lvgl/port/lv_port_syslog.h | 73 -- graphics/lvgl/port/lv_port_tick.c | 61 - graphics/lvgl/port/lv_port_tick.h | 61 - graphics/lvgl/port/lv_port_touchpad.c | 207 --- graphics/lvgl/port/lv_port_touchpad.h | 80 -- 28 files changed, 1620 insertions(+), 4813 deletions(-) delete mode 100644 graphics/lvgl/lv_conf/Kconfig delete mode 100644 graphics/lvgl/port/lv_port.c delete mode 100644 graphics/lvgl/port/lv_port.h delete mode 100644 graphics/lvgl/port/lv_port_button.c delete mode 100644 graphics/lvgl/port/lv_port_button.h delete mode 100644 graphics/lvgl/port/lv_port_encoder.c delete mode 100644 graphics/lvgl/port/lv_port_encoder.h delete mode 100644 graphics/lvgl/port/lv_port_fbdev.c delete mode 100644 graphics/lvgl/port/lv_port_fbdev.h delete mode 100644 graphics/lvgl/port/lv_port_keypad.c delete mode 100644 graphics/lvgl/port/lv_port_keypad.h delete mode 100644 graphics/lvgl/port/lv_port_lcddev.c delete mode 100644 graphics/lvgl/port/lv_port_lcddev.h delete mode 100644 graphics/lvgl/port/lv_port_libuv.c delete mode 100644 graphics/lvgl/port/lv_port_libuv.h delete mode 100644 graphics/lvgl/port/lv_port_mem.c delete mode 100644 graphics/lvgl/port/lv_port_mem.h delete mode 100644 graphics/lvgl/port/lv_port_syslog.c delete mode 100644 graphics/lvgl/port/lv_port_syslog.h delete mode 100644 graphics/lvgl/port/lv_port_tick.c delete mode 100644 graphics/lvgl/port/lv_port_tick.h delete mode 100644 graphics/lvgl/port/lv_port_touchpad.c delete mode 100644 graphics/lvgl/port/lv_port_touchpad.h diff --git a/examples/lvgldemo/CMakeLists.txt b/examples/lvgldemo/CMakeLists.txt index 7ff9aea56..1b8734b95 100644 --- a/examples/lvgldemo/CMakeLists.txt +++ b/examples/lvgldemo/CMakeLists.txt @@ -29,7 +29,7 @@ if(CONFIG_EXAMPLES_LVGLDEMO) MODULE ${CONFIG_EXAMPLES_LVGLDEMO} DEPENDS - lvgl_nuttx + lvgl SRCS lvgldemo.c) endif() diff --git a/examples/lvgldemo/lvgldemo.c b/examples/lvgldemo/lvgldemo.c index 3b32c0e9e..b68bc0e93 100644 --- a/examples/lvgldemo/lvgldemo.c +++ b/examples/lvgldemo/lvgldemo.c @@ -23,30 +23,20 @@ ****************************************************************************/ #include - -#include -#include #include -#include -#include -#include -#include -#include +#include #include -#include #include - -#ifdef CONFIG_LIBUV -# include -# include +#ifdef CONFIG_LV_USE_NUTTX_LIBUV +#include #endif /**************************************************************************** * Pre-processor Definitions ****************************************************************************/ -/* Should we perform board-specific driver initialization? There are two +/* Should we perform board-specific driver initialization? There are two * ways that board initialization can occur: 1) automatically via * board_late_initialize() during bootupif CONFIG_BOARD_LATE_INITIALIZE * or 2). @@ -67,100 +57,42 @@ * Private Type Declarations ****************************************************************************/ -typedef CODE void (*demo_create_func_t)(void); - -struct func_key_pair_s -{ - FAR const char *name; - demo_create_func_t func; -}; - /**************************************************************************** * Private Data ****************************************************************************/ -static const struct func_key_pair_s func_key_pair[] = -{ -#ifdef CONFIG_LV_USE_DEMO_WIDGETS - { "widgets", lv_demo_widgets }, -#endif - -#ifdef CONFIG_LV_USE_DEMO_KEYPAD_AND_ENCODER - { "keypad_encoder", lv_demo_keypad_encoder }, -#endif - -#ifdef CONFIG_LV_USE_DEMO_BENCHMARK - { "benchmark", lv_demo_benchmark }, -#endif - -#ifdef CONFIG_LV_USE_DEMO_STRESS - { "stress", lv_demo_stress }, -#endif - -#ifdef CONFIG_LV_USE_DEMO_MUSIC - { "music", lv_demo_music }, -#endif - { "", NULL } -}; - /**************************************************************************** * Private Functions ****************************************************************************/ -/**************************************************************************** - * Name: show_usage - ****************************************************************************/ - -static void show_usage(void) +#ifdef CONFIG_LV_USE_NUTTX_LIBUV +static void lv_nuttx_uv_loop(uv_loop_t *loop, lv_nuttx_result_t *result) { - int i; - const int len = nitems(func_key_pair) - 1; + lv_nuttx_uv_t uv_info; + void *data; - if (len == 0) - { - printf("lvgldemo: no demo available!\n"); - exit(EXIT_FAILURE); - return; - } + uv_loop_init(loop); - printf("\nUsage: lvgldemo demo_name\n"); - printf("\ndemo_name:\n"); + lv_memset(&uv_info, 0, sizeof(uv_info)); + uv_info.loop = loop; + uv_info.disp = result->disp; + uv_info.indev = result->indev; +#ifdef CONFIG_UINPUT_TOUCH + uv_info.uindev = result->utouch_indev; +#endif - for (i = 0; i < len; i++) - { - printf(" %s\n", func_key_pair[i].name); - } - - exit(EXIT_FAILURE); -} - -/**************************************************************************** - * Name: find_demo_create_func - ****************************************************************************/ - -static demo_create_func_t find_demo_create_func(FAR const char *name) -{ - int i; - const int len = nitems(func_key_pair) - 1; - - for (i = 0; i < len; i++) - { - if (strcmp(name, func_key_pair[i].name) == 0) - { - return func_key_pair[i].func; - } - } - - printf("lvgldemo: '%s' not found.\n", name); - return NULL; + data = lv_nuttx_uv_init(&uv_info); + uv_run(loop, UV_RUN_DEFAULT); + lv_nuttx_uv_deinit(&data); } +#endif /**************************************************************************** * Public Functions ****************************************************************************/ /**************************************************************************** - * Name: main or lvgldemo_main + * Name: main or lv_demos_main * * Description: * @@ -174,68 +106,47 @@ static demo_create_func_t find_demo_create_func(FAR const char *name) int main(int argc, FAR char *argv[]) { - demo_create_func_t demo_create_func; - FAR const char *demo = NULL; - const int func_key_pair_len = nitems(func_key_pair); + lv_nuttx_dsc_t info; + lv_nuttx_result_t result; -#ifdef CONFIG_LIBUV +#ifdef CONFIG_LV_USE_NUTTX_LIBUV uv_loop_t ui_loop; #endif - /* If no arguments are specified and only 1 demo exists, select the demo */ - - if (argc == 1 && func_key_pair_len == 2) /* 2 because of NULL sentinel */ - { - demo = func_key_pair[0].name; - } - else if (argc != 2) - { - show_usage(); - return EXIT_FAILURE; - } - else - { - demo = argv[1]; - } - - demo_create_func = find_demo_create_func(demo); - - if (demo_create_func == NULL) - { - show_usage(); - return EXIT_FAILURE; - } - #ifdef NEED_BOARDINIT /* Perform board-specific driver initialization */ boardctl(BOARDIOC_INIT, 0); -#ifdef CONFIG_BOARDCTL_FINALINIT - /* Perform architecture-specific final-initialization (if configured) */ - - boardctl(BOARDIOC_FINALINIT, 0); #endif -#endif - - /* LVGL initialization */ lv_init(); - /* LVGL port initialization */ + lv_nuttx_dsc_init(&info); - lv_port_init(); +#ifdef CONFIG_LV_USE_NUTTX_LCD + info.fb_path = "/dev/lcd0"; +#endif - /* LVGL demo creation */ + lv_nuttx_init(&info, &result); - demo_create_func(); + if (result.disp == NULL) + { + LV_LOG_ERROR("lv_demos initialization failure!"); + return 1; + } - /* Handle LVGL tasks */ + if (!lv_demos_create(&argv[1], argc - 1)) + { + lv_demos_show_help(); -#ifdef CONFIG_LIBUV - uv_loop_init(&ui_loop); - lv_port_libuv_init(&ui_loop); - uv_run(&ui_loop, UV_RUN_DEFAULT); + /* we can add custom demos here */ + + goto demo_end; + } + +#ifdef CONFIG_LV_USE_NUTTX_LIBUV + lv_nuttx_uv_loop(&ui_loop, &result); #else while (1) { @@ -249,5 +160,9 @@ int main(int argc, FAR char *argv[]) } #endif - return EXIT_SUCCESS; +demo_end: + lv_disp_remove(result.disp); + lv_deinit(); + + return 0; } diff --git a/graphics/lvgl/CMakeLists.txt b/graphics/lvgl/CMakeLists.txt index 8b09f9a48..afa92a8ef 100644 --- a/graphics/lvgl/CMakeLists.txt +++ b/graphics/lvgl/CMakeLists.txt @@ -29,7 +29,7 @@ if(CONFIG_GRAPHICS_LVGL) FetchContent_Declare( lvgl_fetch DOWNLOAD_DIR ${CMAKE_CURRENT_LIST_DIR} - URL "https://github.com/lvgl/lvgl/archive/refs/tags/v${CONFIG_LVGL_VERSION}.zip" + URL "https://github.com/lvgl/lvgl/archive/refs/tags/v9.1.0.zip" SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/lvgl BINARY_DIR @@ -56,81 +56,21 @@ if(CONFIG_GRAPHICS_LVGL) # Flags and Sources # ############################################################################ - # Relax LVGL's format checking and unused variable checking to avoid errors - - set(CFLAGS -Wno-format -Wno-format-security -Wno-unused-variable) - - # Since this change is only merged into the lvgl.v9, let us workaround for v8 - # ./lvgl/src/core/lv_obj.c:363:25: warning: variable 'x' set but not used - # [-Wunused-but-set-variable] 363 | static uint32_t x = 0; | ^ 1 - # warning generated. - - list(APPEND CFLAGS -Wno-unused-but-set-variable) - - set(CSRCS port/lv_port.c port/lv_port_tick.c) - - if(CONFIG_LIBUV) - list(APPEND CSRCS port/lv_port_libuv.c) - endif() - - if(CONFIG_LV_PORT_USE_LCDDEV) - list(APPEND CSRCS port/lv_port_lcddev.c) - endif() - - if(CONFIG_LV_PORT_USE_FBDEV) - list(APPEND CSRCS port/lv_port_fbdev.c) - endif() - - if(CONFIG_LV_PORT_USE_TOUCHPAD) - list(APPEND CSRCS port/lv_port_touchpad.c) - endif() - - if(CONFIG_LV_PORT_USE_BUTTON) - list(APPEND CSRCS port/lv_port_button.c) - endif() - - if(CONFIG_LV_PORT_USE_KEYPAD) - list(APPEND CSRCS port/lv_port_keypad.c) - endif() - - if(CONFIG_LV_PORT_USE_ENCODER) - list(APPEND CSRCS port/lv_port_encoder.c) - endif() - - if(CONFIG_LV_USE_LOG) - list(APPEND CSRCS port/lv_port_syslog.c) - endif() - - if(CONFIG_LV_MEM_CUSTOM) - if(NOT CONFIG_LV_PORT_MEM_CUSTOM_SIZE EQUAL 0) - list(APPEND CFLAGS -DLV_MEM_CUSTOM_ALLOC=lv_port_mem_alloc) - list(APPEND CFLAGS -DLV_MEM_CUSTOM_FREE=lv_port_mem_free) - list(APPEND CFLAGS -DLV_MEM_CUSTOM_REALLOC=lv_port_mem_realloc) - list(APPEND CSRCS port/lv_port_mem.c) - endif() - endif() - # ############################################################################ # Library Configuration # ############################################################################ - set(INCDIR ${CMAKE_CURRENT_LIST_DIR} ${NUTTX_DIR}/include) - add_subdirectory(${LVGL_DIR}) nuttx_add_external_library(lvgl) nuttx_add_external_library(lvgl_demos) nuttx_add_external_library(lvgl_examples) - target_include_directories(lvgl PRIVATE ${INCDIR}) + target_include_directories(lvgl PUBLIC ${CMAKE_BINARY_DIR}/include) target_compile_options(lvgl PRIVATE ${CFLAGS}) if(NOT CONFIG_LV_ASSERT_HANDLER_INCLUDE STREQUAL "") target_compile_definitions(lvgl PRIVATE "LV_ASSERT_HANDLER=ASSERT(0)\;") endif() - nuttx_add_library(lvgl_nuttx) - target_sources(lvgl_nuttx PRIVATE ${CSRCS}) - target_link_libraries(lvgl_nuttx lvgl) - # allow to include via lvgl/lvgl.h - target_include_directories(lvgl_nuttx PUBLIC ${CMAKE_CURRENT_LIST_DIR}) + target_include_directories(lvgl PUBLIC ${CMAKE_CURRENT_LIST_DIR}) endif() diff --git a/graphics/lvgl/Kconfig b/graphics/lvgl/Kconfig index 338651050..5c11cb6af 100644 --- a/graphics/lvgl/Kconfig +++ b/graphics/lvgl/Kconfig @@ -11,237 +11,1634 @@ menuconfig GRAPHICS_LVGL if GRAPHICS_LVGL -config LVGL_VERSION - string "LVGL Version" - default "8.3.3" +# Below options are copied directly from lvgl/Kconfig, do not edit +# Kconfig file for LVGL v9.1.0 -source "$APPSDIR/graphics/lvgl/lv_conf/Kconfig" +menu "LVGL configuration" -config LV_PORT_USE_LCDDEV - bool "Enable LCD device port" - default n + # Define CONFIG_LV_CONF_SKIP so we can use LVGL + # without lv_conf.h file, the lv_conf_internal.h and + # lv_conf_kconfig.h files are used instead. + config LV_CONF_SKIP + bool "Check this to not use custom lv_conf.h" + default y -if LV_PORT_USE_LCDDEV + config LV_CONF_MINIMAL + bool "LVGL minimal configuration" -config LV_PORT_LCDDEV_DEFAULT_DEVICEPATH - string "LCD default device path" - default "/dev/lcd0" + menu "Color Settings" + choice LV_COLOR_DEPTH + prompt "Color depth" + default LV_COLOR_DEPTH_16 + help + Color depth to be used. -config LV_PORT_LCDDEV_FULL_SCREEN_BUFFER - bool "Use full screen buffer" - default n + config LV_COLOR_DEPTH_32 + bool "32: XRGB8888" + config LV_COLOR_DEPTH_24 + bool "24: RGB888" + config LV_COLOR_DEPTH_16 + bool "16: RGB565" + config LV_COLOR_DEPTH_8 + bool "8: RGB232" + config LV_COLOR_DEPTH_1 + bool "1: 1 byte per pixel" + endchoice -if !LV_PORT_LCDDEV_FULL_SCREEN_BUFFER + config LV_COLOR_DEPTH + int + default 1 if LV_COLOR_DEPTH_1 + default 8 if LV_COLOR_DEPTH_8 + default 16 if LV_COLOR_DEPTH_16 + default 24 if LV_COLOR_DEPTH_24 + default 32 if LV_COLOR_DEPTH_32 + endmenu -config LV_PORT_LCDDEV_LINE_BUFFER_DEFAULT - int "Default buffer size (in line)" - default 10 + menu "Memory Settings" + choice + prompt "Malloc functions source" + default LV_USE_BUILTIN_MALLOC -endif # LV_PORT_LCDDEV_FULL_SCREEN_BUFFER + config LV_USE_BUILTIN_MALLOC + bool "LVGL's built in implementation" -config LV_PORT_LCDDEV_DOUBLE_BUFFER - bool "Use double buffer" - default n + config LV_USE_CLIB_MALLOC + bool "Standard C functions malloc/realloc/free" -endif # LV_PORT_USE_LCDDEV + config LV_USE_MICROPYTHON_MALLOC + bool "MicroPython functions malloc/realloc/free" -config LV_PORT_USE_FBDEV - bool "Enable framebuffer port" - default n + config LV_USE_RTTHREAD_MALLOC + bool "RTThread functions malloc/realloc/free" -config LV_PORT_FBDEV_DEFAULT_DEVICEPATH - string "Framebuffer default device path" - default "/dev/fb0" - depends on LV_PORT_USE_FBDEV + config LV_USE_CUSTOM_MALLOC + bool "Implement the functions externally" -config LV_PORT_UV_POLL_DEVICEPATH - string "Display poll device path" - depends on LIBUV - default "/dev/fb0" + endchoice # "Malloc functions" -config LV_PORT_USE_TOUCHPAD - bool "Enable touchpad port" - default n + choice + prompt "String functions source" + default LV_USE_BUILTIN_STRING -config LV_PORT_TOUCHPAD_DEFAULT_DEVICEPATH - depends on LV_PORT_USE_TOUCHPAD - string "Touchpad default device path" - default "/dev/input0" + config LV_USE_BUILTIN_STRING + bool "LVGL's built in implementation" -config LV_PORT_TOUCHPAD_CURSOR_SIZE - depends on LV_PORT_USE_TOUCHPAD - int "Touchpad cursor size" - default 0 + config LV_USE_CLIB_STRING + bool "Standard C functions memcpy/memset/strlen/strcpy" -config LV_USE_ENCODER - depends on INPUT_MOUSE_WHEEL - bool "Encoder interface" - default n + config LV_USE_CUSTOM_STRING + bool "Implement the functions externally" -menuconfig LV_PORT_USE_BUTTON - bool "Enable button port" - default n + endchoice # "String functions" -if LV_PORT_USE_BUTTON + choice + prompt "Sprintf functions source" + default LV_USE_BUILTIN_SPRINTF -config LV_PORT_BUTTON_DEFAULT_DEVICEPATH - string "Button default device path" - default "/dev/buttons" + config LV_USE_BUILTIN_SPRINTF + bool "LVGL's built in implementation" -config LV_PORT_BUTTON_BUTTON_0_MAP_X - int "Button 0 mapping coordinate x" - default 0 + config LV_USE_CLIB_SPRINTF + bool "Standard C functions vsnprintf" -config LV_PORT_BUTTON_BUTTON_0_MAP_Y - int "Button 0 mapping coordinate y" - default 0 + config LV_USE_CUSTOM_SPRINTF + bool "Implement the functions externally" -config LV_PORT_BUTTON_BUTTON_1_MAP_X - int "Button 1 mapping coordinate x" - default 0 + endchoice # "Sprintf functions" -config LV_PORT_BUTTON_BUTTON_1_MAP_Y - int "Button 1 mapping coordinate y" - default 0 + config LV_MEM_SIZE_KILOBYTES + int "Size of the memory used by `lv_malloc()` in kilobytes (>= 2kB)" + default 64 + depends on LV_USE_BUILTIN_MALLOC -config LV_PORT_BUTTON_BUTTON_2_MAP_X - int "Button 2 mapping coordinate x" - default 0 + config LV_MEM_POOL_EXPAND_SIZE_KILOBYTES + int "Size of the memory expand for `lv_malloc()` in kilobytes" + default 0 + depends on LV_USE_BUILTIN_MALLOC -config LV_PORT_BUTTON_BUTTON_2_MAP_Y - int "Button 2 mapping coordinate y" - default 0 + config LV_MEM_ADR + hex "Address for the memory pool instead of allocating it as a normal array" + default 0x0 + depends on LV_USE_BUILTIN_MALLOC -config LV_PORT_BUTTON_BUTTON_3_MAP_X - int "Button 3 mapping coordinate x" - default 0 + endmenu -config LV_PORT_BUTTON_BUTTON_3_MAP_Y - int "Button 3 mapping coordinate y" - default 0 + menu "HAL Settings" + config LV_DEF_REFR_PERIOD + int "Default refresh period (ms)" + default 33 + help + Default display refresh, input device read and animation step period. -config LV_PORT_BUTTON_BUTTON_4_MAP_X - int "Button 4 mapping coordinate x" - default 0 + config LV_DPI_DEF + int "Default Dots Per Inch (in px/inch)" + default 130 + help + Used to initialize default sizes such as widgets sized, style paddings. + (Not so important, you can adjust it to modify default sizes and spaces) + endmenu -config LV_PORT_BUTTON_BUTTON_4_MAP_Y - int "Button 4 mapping coordinate y" - default 0 + menu "Operating System (OS)" + choice LV_USE_OS + prompt "Default operating system to use" + default LV_OS_NONE -config LV_PORT_BUTTON_BUTTON_5_MAP_X - int "Button 5 mapping coordinate x" - default 0 + config LV_OS_NONE + bool "0: NONE" + config LV_OS_PTHREAD + bool "1: PTHREAD" + config LV_OS_FREERTOS + bool "2: FREERTOS" + config LV_OS_CMSIS_RTOS2 + bool "3: CMSIS_RTOS2" + config LV_OS_RTTHREAD + bool "4: RTTHREAD" + config LV_OS_WINDOWS + bool "5: WINDOWS" + config LV_OS_CUSTOM + bool "255: CUSTOM" + endchoice -config LV_PORT_BUTTON_BUTTON_5_MAP_Y - int "Button 5 mapping coordinate y" - default 0 + config LV_USE_OS + int + default 0 if LV_OS_NONE + default 1 if LV_OS_PTHREAD + default 2 if LV_OS_FREERTOS + default 3 if LV_OS_CMSIS_RTOS2 + default 4 if LV_OS_RTTHREAD + default 5 if LV_OS_WINDOWS + default 255 if LV_OS_CUSTOM -endif # LV_PORT_USE_BUTTON + config LV_OS_CUSTOM_INCLUDE + string "Custom OS include header" + default "stdint.h" + depends on LV_OS_CUSTOM + endmenu -menuconfig LV_PORT_USE_KEYPAD - bool "Enable keypad port" - default n - ---help--- - button bit map < 0 is no binding, must >= 0 and < 31 to binding button device. + menu "Rendering Configuration" + config LV_DRAW_BUF_STRIDE_ALIGN + int "Buffer stride alignment" + default 1 + help + Align the stride of all layers and images to this bytes. -if LV_PORT_USE_KEYPAD + config LV_DRAW_BUF_ALIGN + int "Buffer address alignment" + default 4 + help + Align the start address of draw_buf addresses to this bytes. -config LV_PORT_KEYPAD_DEFAULT_DEVICEPATH - string "Button default device path" - default "/dev/buttons" + config LV_DRAW_LAYER_SIMPLE_BUF_SIZE + int "Optimal size to buffer the widget with opacity" + default 24576 + depends on LV_USE_DRAW_SW + help + If a widget has `style_opa < 255` (not `bg_opa`, `text_opa` etc) or not NORMAL blend mode + it is buffered into a "simple" layer before rendering. The widget can be buffered in smaller chunks. + "Transformed layers" (if `transform_angle/zoom` are set) use larger buffers and can't be drawn in chunks. -config LV_PORT_KEYPAD_KEY_UP_MAP_BIT - int "LV_KEY_UP button bit map" - default -1 + config LV_USE_DRAW_SW + bool "Enable software rendering" + default y + help + Required to draw anything on the screen. -config LV_PORT_KEYPAD_KEY_DOWN_MAP_BIT - int "LV_KEY_DOWN button bit map" - default -1 + config LV_DRAW_SW_DRAW_UNIT_CNT + int "Number of draw units" + default 1 + depends on LV_USE_DRAW_SW + help + > 1 requires an operating system enabled in `LV_USE_OS` + > 1 means multiply threads will render the screen in parallel -config LV_PORT_KEYPAD_KEY_RIGHT_MAP_BIT - int "LV_KEY_RIGHT button bit map" - default -1 + config LV_USE_DRAW_ARM2D_SYNC + bool "Enable Arm's 2D image processing library (Arm-2D) for all Cortex-M processors" + default n + depends on LV_USE_DRAW_SW + help + Must deploy arm-2d library to your project and add include PATH for "arm_2d.h". -config LV_PORT_KEYPAD_KEY_LEFT_MAP_BIT - int "LV_KEY_LEFT button bit map" - default -1 + config LV_USE_NATIVE_HELIUM_ASM + bool "Enable native helium assembly" + default y + depends on LV_USE_DRAW_SW + help + Disabling this allows arm2d to work on its own (for testing only) -config LV_PORT_KEYPAD_KEY_ESC_MAP_BIT - int "LV_KEY_ESC button bit map" - default -1 + config LV_DRAW_SW_COMPLEX + bool "Enable complex draw engine" + default y + depends on LV_USE_DRAW_SW + help + 0: use a simple renderer capable of drawing only simple rectangles with gradient, images, texts, and straight lines only, + 1: use a complex renderer capable of drawing rounded corners, shadow, skew lines, and arcs too. -config LV_PORT_KEYPAD_KEY_DEL_MAP_BIT - int "LV_KEY_DEL button bit map" - default -1 + config LV_DRAW_SW_SHADOW_CACHE_SIZE + int "Allow buffering some shadow calculation" + depends on LV_DRAW_SW_COMPLEX + default 0 + help + LV_DRAW_SW_SHADOW_CACHE_SIZE is the max shadow size to buffer, where + shadow size is `shadow_width + radius`. + Caching has LV_DRAW_SW_SHADOW_CACHE_SIZE^2 RAM cost. -config LV_PORT_KEYPAD_KEY_BACKSPACE_MAP_BIT - int "LV_KEY_BACKSPACE button bit map" - default -1 + config LV_DRAW_SW_CIRCLE_CACHE_SIZE + int "Set number of maximally cached circle data" + depends on LV_DRAW_SW_COMPLEX + default 4 + help + The circumference of 1/4 circle are saved for anti-aliasing + radius * 4 bytes are used per circle (the most often used + radiuses are saved). + Set to 0 to disable caching. -config LV_PORT_KEYPAD_KEY_ENTER_MAP_BIT - int "LV_KEY_ENTER button bit map" - default -1 + choice LV_USE_DRAW_SW_ASM + prompt "Asm mode in sw draw" + default LV_DRAW_SW_ASM_NONE + depends on LV_USE_DRAW_SW + help + ASM mode to be used -config LV_PORT_KEYPAD_KEY_NEXT_MAP_BIT - int "LV_KEY_NEXT button bit map" - default -1 + config LV_DRAW_SW_ASM_NONE + bool "0: NONE" + config LV_DRAW_SW_ASM_NEON + bool "1: NEON" + config LV_DRAW_SW_ASM_HELIUM + bool "2: HELIUM" + config LV_DRAW_SW_ASM_CUSTOM + bool "255: CUSTOM" + endchoice -config LV_PORT_KEYPAD_KEY_PREV_MAP_BIT - int "LV_KEY_PREV button bit map" - default -1 + config LV_USE_DRAW_SW_ASM + int + default 0 if LV_DRAW_SW_ASM_NONE + default 1 if LV_DRAW_SW_ASM_NEON + default 2 if LV_DRAW_SW_ASM_HELIUM + default 255 if LV_DRAW_SW_ASM_CUSTOM -config LV_PORT_KEYPAD_KEY_HOME_MAP_BIT - int "LV_KEY_HOME button bit map" - default -1 + config LV_DRAW_SW_ASM_CUSTOM_INCLUDE + string "Set the custom asm include file" + default "" + depends on LV_DRAW_SW_ASM_CUSTOM -config LV_PORT_KEYPAD_KEY_END_MAP_BIT - int "LV_KEY_END button bit map" - default -1 + config LV_USE_DRAW_VGLITE + bool "Use NXP's VG-Lite GPU on iMX RTxxx platforms" + default n -endif # LV_PORT_USE_KEYPAD + config LV_USE_VGLITE_BLIT_SPLIT + bool "Enable blit quality degradation workaround recommended for screen's dimension > 352 pixels" + depends on LV_USE_DRAW_VGLITE + default n -config LV_USE_TOUCHPAD_INTERFACE - depends on INPUT_TOUCHSCREEN - bool "Touchpad input interface" - default n + config LV_USE_VGLITE_DRAW_ASYNC + bool "Enable VGLite draw async" + depends on LV_USE_DRAW_VGLITE && LV_USE_OS > 0 + default y + help + Queue multiple tasks and flash them once to the GPU. -config LV_TOUCHPAD_INTERFACE_DEFAULT_DEVICEPATH - depends on LV_USE_TOUCHPAD_INTERFACE - string "Touchpad default device path" - default "/dev/input0" + config LV_USE_VGLITE_ASSERT + bool "Enable VGLite asserts" + default n + depends on LV_USE_DRAW_VGLITE -if LV_PORT_USE_ENCODER + config LV_USE_DRAW_PXP + bool "Use NXP's PXP on iMX RTxxx platforms" + default n -config LV_PORT_ENCODER_DEFAULT_DEVICEPATH - string "Encoder default device path" - default "/dev/input0" + config LV_USE_PXP_ASSERT + bool "Enable PXP asserts" + default n + depends on LV_USE_DRAW_PXP -endif # LV_USE_ENCODER + config LV_USE_DRAW_DAVE2D + bool "Use Renesas Dave2D on RA platforms" + default n -menu "Memory configuration" + config LV_USE_DRAW_SDL + bool "Draw using cached SDL textures" + default n + help + Uses SDL renderer API -config LV_PORT_MEM_ATTRIBUTE_FAST_MEM_SECTION_NAME - string "LV_ATTRIBUTE_FAST_MEM Section Name" - default "" - ---help--- - Set this option to configure custom memory as LV_ATTRIBUTE_FAST_MEM + config LV_USE_DRAW_VG_LITE + bool "Use VG-Lite GPU" -if LV_MEM_CUSTOM + config LV_VG_LITE_USE_GPU_INIT + bool "Enable VG-Lite custom external 'gpu_init()' function" + default n + depends on LV_USE_DRAW_VG_LITE -config LV_PORT_MEM_CUSTOM_SIZE - int "Size of the custom memory used by `lv_mem_alloc` in kilobytes (>= 2kB)" - default 0 + config LV_VG_LITE_USE_ASSERT + bool "Enable VG-Lite assert" + default n + depends on LV_USE_DRAW_VG_LITE -if LV_PORT_MEM_CUSTOM_SIZE != 0 + config LV_VG_LITE_FLUSH_MAX_COUNT + int "VG-Lite flush commit trigger threshold" + default 8 + depends on LV_USE_DRAW_VG_LITE + help + GPU will try to batch these many draw tasks -config LV_PORT_MEM_CUSTOM_NAME - string "Name of the custom HEAP memory" - default "lvgl" + config LV_VG_LITE_USE_BOX_SHADOW + bool "Enable border to simulate shadow" + default n + depends on LV_USE_DRAW_VG_LITE + help + which usually improves performance, + but does not guarantee the same rendering quality as the software. -endif # LV_PORT_MEM_CUSTOM_SIZE + config LV_USE_VECTOR_GRAPHIC + bool "Use Vector Graphic APIs" + default n + help + Enable drawing support vector graphic APIs. + endmenu -endif # LV_MEM_CUSTOM + menu "Feature Configuration" + menu "Logging" + config LV_USE_LOG + bool "Enable the log module" -endmenu # "Memory configuration" + choice + bool "Default log verbosity" if LV_USE_LOG + default LV_LOG_LEVEL_WARN + help + Specify how important log should be added. + + config LV_LOG_LEVEL_TRACE + bool "A lot of logs to give detailed information" + config LV_LOG_LEVEL_INFO + bool "Log important events" + config LV_LOG_LEVEL_WARN + bool "Log if something unwanted happened but didn't cause a problem" + config LV_LOG_LEVEL_ERROR + bool "Only critical issues, when the system may fail" + config LV_LOG_LEVEL_USER + bool "Only logs added by the user" + config LV_LOG_LEVEL_NONE + bool "Do not log anything" + endchoice + + config LV_LOG_LEVEL + int + default 0 if LV_LOG_LEVEL_TRACE + default 1 if LV_LOG_LEVEL_INFO + default 2 if LV_LOG_LEVEL_WARN + default 3 if LV_LOG_LEVEL_ERROR + default 4 if LV_LOG_LEVEL_USER + default 5 if LV_LOG_LEVEL_NONE + + config LV_LOG_PRINTF + bool "Print the log with 'printf'" if LV_USE_LOG + help + Use printf for log output. + If not set the user needs to register a callback with `lv_log_register_print_cb`. + + config LV_LOG_USE_TIMESTAMP + bool "Enable print timestamp" + default y + depends on LV_USE_LOG + + config LV_LOG_USE_FILE_LINE + bool "Enable print file and line number" + default y + depends on LV_USE_LOG + + config LV_LOG_TRACE_MEM + bool "Enable/Disable LV_LOG_TRACE in mem module" + default y + depends on LV_USE_LOG + + config LV_LOG_TRACE_TIMER + bool "Enable/Disable LV_LOG_TRACE in timer module" + default y + depends on LV_USE_LOG + + config LV_LOG_TRACE_INDEV + bool "Enable/Disable LV_LOG_TRACE in indev module" + default y + depends on LV_USE_LOG + + config LV_LOG_TRACE_DISP_REFR + bool "Enable/Disable LV_LOG_TRACE in disp refr module" + default y + depends on LV_USE_LOG + + config LV_LOG_TRACE_EVENT + bool "Enable/Disable LV_LOG_TRACE in event module" + default y + depends on LV_USE_LOG + + config LV_LOG_TRACE_OBJ_CREATE + bool "Enable/Disable LV_LOG_TRACE in obj create module" + default y + depends on LV_USE_LOG + + config LV_LOG_TRACE_LAYOUT + bool "Enable/Disable LV_LOG_TRACE in layout module" + default y + depends on LV_USE_LOG + + config LV_LOG_TRACE_ANIM + bool "Enable/Disable LV_LOG_TRACE in anim module" + default y + depends on LV_USE_LOG + + config LV_LOG_TRACE_CACHE + bool "Enable/Disable LV_LOG_TRACE in cache module" + default y + depends on LV_USE_LOG + endmenu + + menu "Asserts" + config LV_USE_ASSERT_NULL + bool "Check if the parameter is NULL. (Very fast, recommended)" + default y if !LV_CONF_MINIMAL + + config LV_USE_ASSERT_MALLOC + bool "Checks if the memory is successfully allocated or no. (Very fast, recommended)" + default y if !LV_CONF_MINIMAL + + config LV_USE_ASSERT_STYLE + bool "Check if the styles are properly initialized. (Very fast, recommended)" + + config LV_USE_ASSERT_MEM_INTEGRITY + bool "Check the integrity of `lv_mem` after critical operations. (Slow)" + + config LV_USE_ASSERT_OBJ + bool "Check NULL, the object's type and existence (e.g. not deleted). (Slow)" + + config LV_ASSERT_HANDLER_INCLUDE + string "Header to include for the custom assert function" + default "assert.h" + help + Add a custom handler when assert happens e.g. to restart the MCU + endmenu + + menu "Debug" + config LV_USE_REFR_DEBUG + bool "Draw random colored rectangles over the redrawn areas" + + config LV_USE_LAYER_DEBUG + bool "Draw a red overlay for ARGB layers and a green overlay for RGB layers" + + config LV_USE_PARALLEL_DRAW_DEBUG + bool "Draw overlays with different colors for each draw_unit's tasks" + help + Also add the index number of the draw unit on white background. + For layers add the index number of the draw unit on black background. + endmenu + + menu "Others" + config LV_ENABLE_GLOBAL_CUSTOM + bool "Enable 'lv_global' customization" + + config LV_GLOBAL_CUSTOM_INCLUDE + string "Header to include for the custom 'lv_global' function" + depends on LV_ENABLE_GLOBAL_CUSTOM + default "lv_global.h" + + config LV_CACHE_DEF_SIZE + int "Default image cache size. 0 to disable caching" + default 0 + depends on LV_USE_DRAW_SW + help + If only the built-in image formats are used there is no real advantage of caching. + (I.e. no new image decoder is added). + + With complex image decoders (e.g. PNG or JPG) caching can + save the continuous open/decode of images. + However the opened images might consume additional RAM. + + config LV_IMAGE_HEADER_CACHE_DEF_CNT + int "Default image header cache count. 0 to disable caching" + default 0 + depends on LV_USE_DRAW_SW + help + If only the built-in image formats are used there is no real advantage of caching. + (I.e. no new image decoder is added). + + With complex image decoders (e.g. PNG or JPG) caching can + save the continuous getting header information of images. + However the records of opened images headers might consume additional RAM. + + config LV_GRADIENT_MAX_STOPS + int "Number of stops allowed per gradient" + default 2 + depends on LV_USE_DRAW_SW + help + Increase this to allow more stops. + This adds (sizeof(lv_color_t) + 1) bytes per additional stop + + config LV_COLOR_MIX_ROUND_OFS + int "Adjust color mix functions rounding" + default 128 if !LV_COLOR_DEPTH_32 + default 0 if LV_COLOR_DEPTH_32 + range 0 254 + help + 0: no adjustment, get the integer part of the result (round down) + 64: round up from x.75 + 128: round up from half + 192: round up from x.25 + 254: round up + + config LV_OBJ_STYLE_CACHE + bool "Use cache to speed up getting object style properties" + default n + help + Add 2 x 32 bit variables to each lv_obj_t to speed up getting style properties + + config LV_USE_OBJ_ID + bool "Add id field to obj" + default n + + config LV_USE_OBJ_ID_BUILTIN + bool "Use builtin method to deal with obj ID" + default n + + config LV_USE_OBJ_PROPERTY + bool "Use obj property set/get API" + default n + + config LV_USE_VG_LITE_THORVG + bool "VG-Lite Simulator" + default n + depends on LV_USE_THORVG + help + Use thorvg to simulate VG-Lite hardware behavior, it's useful + for debugging and testing on PC simulator. Enable LV_USE_THORVG, + Either internal ThorVG or external ThorVG library is required. + + config LV_VG_LITE_THORVG_LVGL_BLEND_SUPPORT + bool "Enable LVGL blend mode support" + default n + depends on LV_USE_VG_LITE_THORVG + + config LV_VG_LITE_THORVG_YUV_SUPPORT + bool "Enable YUV color format support" + default n + depends on LV_USE_VG_LITE_THORVG + + config LV_VG_LITE_THORVG_16PIXELS_ALIGN + bool "Enable 16 pixels alignment" + default y + depends on LV_USE_VG_LITE_THORVG + + config LV_VG_LITE_THORVG_BUF_ADDR_ALIGN + int "Buffer address alignment" + default 64 + depends on LV_USE_VG_LITE_THORVG + + config LV_VG_LITE_THORVG_THREAD_RENDER + bool "Enable multi-thread render" + default n + depends on LV_USE_VG_LITE_THORVG + endmenu + endmenu + + menu "Compiler Settings" + config LV_BIG_ENDIAN_SYSTEM + bool "For big endian systems set to 1" + + config LV_ATTRIBUTE_MEM_ALIGN_SIZE + int "Required alignment size for buffers" + default 1 + + config LV_ATTRIBUTE_FAST_MEM_USE_IRAM + bool "Set IRAM as LV_ATTRIBUTE_FAST_MEM" + help + Set this option to configure IRAM as LV_ATTRIBUTE_FAST_MEM + + config LV_USE_FLOAT + bool "Use float as lv_value_precise_t" + default n + endmenu + + menu "Font Usage" + menu "Enable built-in fonts" + config LV_FONT_MONTSERRAT_8 + bool "Enable Montserrat 8" + config LV_FONT_MONTSERRAT_10 + bool "Enable Montserrat 10" + config LV_FONT_MONTSERRAT_12 + bool "Enable Montserrat 12" + config LV_FONT_MONTSERRAT_14 + bool "Enable Montserrat 14" + default y if !LV_CONF_MINIMAL + config LV_FONT_MONTSERRAT_16 + bool "Enable Montserrat 16" + config LV_FONT_MONTSERRAT_18 + bool "Enable Montserrat 18" + config LV_FONT_MONTSERRAT_20 + bool "Enable Montserrat 20" + config LV_FONT_MONTSERRAT_22 + bool "Enable Montserrat 22" + config LV_FONT_MONTSERRAT_24 + bool "Enable Montserrat 24" + config LV_FONT_MONTSERRAT_26 + bool "Enable Montserrat 26" + config LV_FONT_MONTSERRAT_28 + bool "Enable Montserrat 28" + config LV_FONT_MONTSERRAT_30 + bool "Enable Montserrat 30" + config LV_FONT_MONTSERRAT_32 + bool "Enable Montserrat 32" + config LV_FONT_MONTSERRAT_34 + bool "Enable Montserrat 34" + config LV_FONT_MONTSERRAT_36 + bool "Enable Montserrat 36" + config LV_FONT_MONTSERRAT_38 + bool "Enable Montserrat 38" + config LV_FONT_MONTSERRAT_40 + bool "Enable Montserrat 40" + config LV_FONT_MONTSERRAT_42 + bool "Enable Montserrat 42" + config LV_FONT_MONTSERRAT_44 + bool "Enable Montserrat 44" + config LV_FONT_MONTSERRAT_46 + bool "Enable Montserrat 46" + config LV_FONT_MONTSERRAT_48 + bool "Enable Montserrat 48" + + config LV_FONT_MONTSERRAT_28_COMPRESSED + bool "Enable Montserrat 28 compressed" + config LV_FONT_DEJAVU_16_PERSIAN_HEBREW + bool "Enable Dejavu 16 Persian, Hebrew, Arabic letters" + config LV_FONT_SIMSUN_16_CJK + bool "Enable Simsun 16 CJK" + + config LV_FONT_UNSCII_8 + bool "Enable UNSCII 8 (Perfect monospace font)" + default y if LV_CONF_MINIMAL + config LV_FONT_UNSCII_16 + bool "Enable UNSCII 16 (Perfect monospace font)" + endmenu + + choice LV_FONT_DEFAULT + prompt "Select theme default title font" + default LV_FONT_DEFAULT_MONTSERRAT_14 if !LV_CONF_MINIMAL + default LV_FONT_DEFAULT_UNSCII_8 if LV_CONF_MINIMAL + help + Select theme default title font + + config LV_FONT_DEFAULT_MONTSERRAT_8 + bool "Montserrat 8" + select LV_FONT_MONTSERRAT_8 + config LV_FONT_DEFAULT_MONTSERRAT_12 + bool "Montserrat 12" + select LV_FONT_MONTSERRAT_12 + config LV_FONT_DEFAULT_MONTSERRAT_14 + bool "Montserrat 14" + select LV_FONT_MONTSERRAT_14 + config LV_FONT_DEFAULT_MONTSERRAT_16 + bool "Montserrat 16" + select LV_FONT_MONTSERRAT_16 + config LV_FONT_DEFAULT_MONTSERRAT_18 + bool "Montserrat 18" + select LV_FONT_MONTSERRAT_18 + config LV_FONT_DEFAULT_MONTSERRAT_20 + bool "Montserrat 20" + select LV_FONT_MONTSERRAT_20 + config LV_FONT_DEFAULT_MONTSERRAT_22 + bool "Montserrat 22" + select LV_FONT_MONTSERRAT_22 + config LV_FONT_DEFAULT_MONTSERRAT_24 + bool "Montserrat 24" + select LV_FONT_MONTSERRAT_24 + config LV_FONT_DEFAULT_MONTSERRAT_26 + bool "Montserrat 26" + select LV_FONT_MONTSERRAT_26 + config LV_FONT_DEFAULT_MONTSERRAT_28 + bool "Montserrat 28" + select LV_FONT_MONTSERRAT_28 + config LV_FONT_DEFAULT_MONTSERRAT_30 + bool "Montserrat 30" + select LV_FONT_MONTSERRAT_30 + config LV_FONT_DEFAULT_MONTSERRAT_32 + bool "Montserrat 32" + select LV_FONT_MONTSERRAT_32 + config LV_FONT_DEFAULT_MONTSERRAT_34 + bool "Montserrat 34" + select LV_FONT_MONTSERRAT_34 + config LV_FONT_DEFAULT_MONTSERRAT_36 + bool "Montserrat 36" + select LV_FONT_MONTSERRAT_36 + config LV_FONT_DEFAULT_MONTSERRAT_38 + bool "Montserrat 38" + select LV_FONT_MONTSERRAT_38 + config LV_FONT_DEFAULT_MONTSERRAT_40 + bool "Montserrat 40" + select LV_FONT_MONTSERRAT_40 + config LV_FONT_DEFAULT_MONTSERRAT_42 + bool "Montserrat 42" + select LV_FONT_MONTSERRAT_42 + config LV_FONT_DEFAULT_MONTSERRAT_44 + bool "Montserrat 44" + select LV_FONT_MONTSERRAT_44 + config LV_FONT_DEFAULT_MONTSERRAT_46 + bool "Montserrat 46" + select LV_FONT_MONTSERRAT_46 + config LV_FONT_DEFAULT_MONTSERRAT_48 + bool "Montserrat 48" + select LV_FONT_MONTSERRAT_48 + config LV_FONT_DEFAULT_MONTSERRAT_28_COMPRESSED + bool "Montserrat 28 compressed" + select LV_FONT_MONTSERRAT_28_COMPRESSED + config LV_FONT_DEFAULT_DEJAVU_16_PERSIAN_HEBREW + bool "Dejavu 16 Persian, Hebrew, Arabic letters" + select LV_FONT_DEJAVU_16_PERSIAN_HEBREW + config LV_FONT_DEFAULT_SIMSUN_16_CJK + bool "Simsun 16 CJK" + select LV_FONT_SIMSUN_16_CJK + config LV_FONT_DEFAULT_UNSCII_8 + bool "UNSCII 8 (Perfect monospace font)" + select LV_FONT_UNSCII_8 + config LV_FONT_DEFAULT_UNSCII_16 + bool "UNSCII 16 (Perfect monospace font)" + select LV_FONT_UNSCII_16 + endchoice + + config LV_FONT_FMT_TXT_LARGE + bool "Enable it if you have fonts with a lot of characters" + help + The limit depends on the font size, font face and format + but with > 10,000 characters if you see issues probably you + need to enable it. + + config LV_USE_FONT_COMPRESSED + bool "Sets support for compressed fonts" + + config LV_USE_FONT_PLACEHOLDER + bool "Enable drawing placeholders when glyph dsc is not found" + default y + endmenu + + menu "Text Settings" + choice LV_TXT_ENC + prompt "Select a character encoding for strings" + help + Select a character encoding for strings. Your IDE or editor should have the same character encoding. + default LV_TXT_ENC_UTF8 if !LV_CONF_MINIMAL + default LV_TXT_ENC_ASCII if LV_CONF_MINIMAL + + config LV_TXT_ENC_UTF8 + bool "UTF8" + config LV_TXT_ENC_ASCII + bool "ASCII" + endchoice + + config LV_TXT_BREAK_CHARS + string "Can break (wrap) texts on these chars" + default " ,.;:-_)]}" + + config LV_TXT_LINE_BREAK_LONG_LEN + int "Line break long length" + default 0 + help + If a word is at least this long, will break wherever 'prettiest'. + To disable, set to a value <= 0. + + config LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN + int "Min num chars before break" + default 3 + depends on LV_TXT_LINE_BREAK_LONG_LEN > 0 + help + Minimum number of characters in a long word to put on a line before a break. + + config LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN + int "Min num chars after break" + default 3 + depends on LV_TXT_LINE_BREAK_LONG_LEN > 0 + help + Minimum number of characters in a long word to put on a line after a break + + config LV_USE_BIDI + bool "Support bidirectional texts" + help + Allows mixing Left-to-Right and Right-to-Left texts. + The direction will be processed according to the Unicode Bidirectional Algorithm: + https://www.w3.org/International/articles/inline-bidi-markup/uba-basics + + choice + prompt "Set the default BIDI direction" + default LV_BIDI_DIR_AUTO + depends on LV_USE_BIDI + + config LV_BIDI_DIR_LTR + bool "Left-to-Right" + config LV_BIDI_DIR_RTL + bool "Right-to-Left" + config LV_BIDI_DIR_AUTO + bool "Detect texts base direction" + endchoice + + config LV_USE_ARABIC_PERSIAN_CHARS + bool "Enable Arabic/Persian processing" + help + In these languages characters should be replaced with + an other form based on their position in the text. + endmenu + + menu "Widget Usage" + config LV_WIDGETS_HAS_DEFAULT_VALUE + bool "Widgets has default value" + default y if !LV_CONF_MINIMAL + config LV_USE_ANIMIMG + bool "Anim image" + default y if !LV_CONF_MINIMAL + config LV_USE_ARC + bool "Arc" + default y if !LV_CONF_MINIMAL + config LV_USE_BAR + bool "Bar" + default y if !LV_CONF_MINIMAL + config LV_USE_BUTTON + bool "Button" + default y if !LV_CONF_MINIMAL + config LV_USE_BUTTONMATRIX + bool "Button matrix" + default y if !LV_CONF_MINIMAL + config LV_USE_CALENDAR + bool "Calendar" + default y if !LV_CONF_MINIMAL + config LV_CALENDAR_WEEK_STARTS_MONDAY + bool "Calendar week starts monday" + depends on LV_USE_CALENDAR + config LV_USE_CALENDAR_HEADER_ARROW + bool "Use calendar header arrow" + depends on LV_USE_CALENDAR + default y + config LV_USE_CALENDAR_HEADER_DROPDOWN + bool "Use calendar header dropdown" + depends on LV_USE_CALENDAR + default y + config LV_USE_CANVAS + bool "Canvas. Requires: lv_image" + imply LV_USE_IMAGE + default y if !LV_CONF_MINIMAL + config LV_USE_CHART + bool "Chart" + default y if !LV_CONF_MINIMAL + config LV_USE_CHECKBOX + bool "Check Box" + default y if !LV_CONF_MINIMAL + config LV_USE_DROPDOWN + bool "Drop down list. Requires: lv_label" + imply LV_USE_LABEL + default y if !LV_CONF_MINIMAL + config LV_USE_IMAGE + bool "Image. Requires: lv_label" + imply LV_USE_LABEL + default y if !LV_CONF_MINIMAL + config LV_USE_IMAGEBUTTON + bool "ImageButton" + default y if !LV_CONF_MINIMAL + config LV_USE_KEYBOARD + bool "Keyboard" + default y if !LV_CONF_MINIMAL + config LV_USE_LABEL + bool "Label" + default y if !LV_CONF_MINIMAL + config LV_LABEL_TEXT_SELECTION + bool "Enable selecting text of the label" + depends on LV_USE_LABEL + default y + config LV_LABEL_LONG_TXT_HINT + bool "Store extra some info in labels (12 bytes) to speed up drawing of very long texts" + depends on LV_USE_LABEL + default y + config LV_LABEL_WAIT_CHAR_COUNT + int "The count of wait chart" + depends on LV_USE_LABEL + default 3 + config LV_USE_LED + bool "LED" + default y if !LV_CONF_MINIMAL + config LV_USE_LINE + bool "Line" + default y if !LV_CONF_MINIMAL + config LV_USE_LIST + bool "List" + default y if !LV_CONF_MINIMAL + config LV_USE_MENU + bool "Menu" + default y if !LV_CONF_MINIMAL + config LV_USE_MSGBOX + bool "Msgbox" + default y if !LV_CONF_MINIMAL + config LV_USE_OBSERVER + bool "Observer" + default n + config LV_USE_ROLLER + bool "Roller. Requires: lv_label" + imply LV_USE_LABEL + default y if !LV_CONF_MINIMAL + config LV_USE_SCALE + bool "Scale" + default y if !LV_CONF_MINIMAL + config LV_USE_SLIDER + bool "Slider. Requires: lv_bar" + imply LV_USE_BAR + default y if !LV_CONF_MINIMAL + config LV_USE_SPAN + bool "Span" + default y if !LV_CONF_MINIMAL + config LV_SPAN_SNIPPET_STACK_SIZE + int "Maximum number of span descriptor" + default 64 + depends on LV_USE_SPAN + config LV_USE_SPINBOX + bool "Spinbox" + default y if !LV_CONF_MINIMAL + config LV_USE_SPINNER + bool "Spinner" + default y if !LV_CONF_MINIMAL + config LV_USE_SWITCH + bool "Switch" + default y if !LV_CONF_MINIMAL + config LV_USE_TEXTAREA + bool "Text area. Requires: lv_label" + select LV_USE_LABEL + default y if !LV_CONF_MINIMAL + config LV_TEXTAREA_DEF_PWD_SHOW_TIME + int "Text area def. pwd show time [ms]" + default 1500 + depends on LV_USE_TEXTAREA + config LV_USE_TABLE + bool "Table" + default y if !LV_CONF_MINIMAL + config LV_USE_TABVIEW + bool "Tabview" + default y if !LV_CONF_MINIMAL + config LV_USE_TILEVIEW + bool "Tileview" + default y if !LV_CONF_MINIMAL + config LV_USE_WIN + bool "Win" + default y if !LV_CONF_MINIMAL + endmenu + + menu "Themes" + config LV_USE_THEME_DEFAULT + bool "A simple, impressive and very complete theme" + default y if !LV_COLOR_DEPTH_1 && !LV_CONF_MINIMAL + config LV_THEME_DEFAULT_DARK + bool "Yes to set dark mode, No to set light mode" + depends on LV_USE_THEME_DEFAULT + config LV_THEME_DEFAULT_GROW + bool "Enable grow on press" + default y + depends on LV_USE_THEME_DEFAULT + config LV_THEME_DEFAULT_TRANSITION_TIME + int "Default transition time in [ms]" + default 80 + depends on LV_USE_THEME_DEFAULT + config LV_USE_THEME_SIMPLE + bool "A very simple theme that is a good starting point for a custom theme" + default y if !LV_COLOR_DEPTH_1 && !LV_CONF_MINIMAL + config LV_USE_THEME_MONO + bool "Monochrome theme, suitable for some E-paper & dot matrix displays" + default y if LV_COLOR_DEPTH_1 && !LV_CONF_MINIMAL + endmenu + + menu "Layouts" + config LV_USE_FLEX + bool "A layout similar to Flexbox in CSS" + default y if !LV_CONF_MINIMAL + config LV_USE_GRID + bool "A layout similar to Grid in CSS" + default y if !LV_CONF_MINIMAL + endmenu + + menu "3rd Party Libraries" + config LV_USE_FS_STDIO + bool "File system on top of stdio API" + config LV_FS_STDIO_LETTER + int "Set an upper cased letter on which the drive will accessible (e.g. 'A' i.e. 65 )" + default 0 + depends on LV_USE_FS_STDIO + config LV_FS_STDIO_PATH + string "Set the working directory" + depends on LV_USE_FS_STDIO + config LV_FS_STDIO_CACHE_SIZE + int ">0 to cache this number of bytes in lv_fs_read()" + default 0 + depends on LV_USE_FS_STDIO + + config LV_USE_FS_POSIX + bool "File system on top of posix API" + config LV_FS_POSIX_LETTER + int "Set an upper cased letter on which the drive will accessible (e.g. 'A' i.e. 65)" + default 0 + depends on LV_USE_FS_POSIX + config LV_FS_POSIX_PATH + string "Set the working directory" + depends on LV_USE_FS_POSIX + config LV_FS_POSIX_CACHE_SIZE + int ">0 to cache this number of bytes in lv_fs_read()" + default 0 + depends on LV_USE_FS_POSIX + + config LV_USE_FS_WIN32 + bool "File system on top of Win32 API" + config LV_FS_WIN32_LETTER + int "Set an upper cased letter on which the drive will accessible (e.g. 'A' i.e. 65)" + default 0 + depends on LV_USE_FS_WIN32 + config LV_FS_WIN32_PATH + string "Set the working directory" + depends on LV_USE_FS_WIN32 + config LV_FS_WIN32_CACHE_SIZE + int ">0 to cache this number of bytes in lv_fs_read()" + default 0 + depends on LV_USE_FS_WIN32 + + config LV_USE_FS_FATFS + bool "File system on top of FatFS" + config LV_FS_FATFS_LETTER + int "Set an upper cased letter on which the drive will accessible (e.g. 'A' i.e. 65)" + default 0 + depends on LV_USE_FS_FATFS + config LV_FS_FATFS_CACHE_SIZE + int ">0 to cache this number of bytes in lv_fs_read()" + default 0 + depends on LV_USE_FS_FATFS + + config LV_USE_FS_MEMFS + bool "File system on top of memory-mapped API" + config LV_FS_MEMFS_LETTER + int "Set an upper cased letter on which the drive will accessible (e.g. 'A' i.e. 65)" + default 0 + depends on LV_USE_FS_MEMFS + + config LV_USE_FS_LITTLEFS + bool "File system on top of littlefs API" + config LV_FS_LITTLEFS_LETTER + int "Set an upper cased letter on which the drive will accessible (e.g. 'A' i.e. 65)" + default 0 + depends on LV_USE_FS_LITTLEFS + + config LV_USE_LODEPNG + bool "PNG decoder library" + + config LV_USE_LIBPNG + bool "PNG decoder(libpng) library" + + config LV_USE_BMP + bool "BMP decoder library" + + config LV_USE_TJPGD + bool "TJPGD decoder library" + + config LV_USE_LIBJPEG_TURBO + bool "libjpeg-turbo decoder library" + + config LV_USE_GIF + bool "GIF decoder library" + + config LV_GIF_CACHE_DECODE_DATA + bool "Use extra 16KB RAM to cache decoded data to accerlate" + depends on LV_USE_GIF + + config LV_BIN_DECODER_RAM_LOAD + bool "Decode whole image to RAM for bin decoder" + default n + + config LV_USE_RLE + bool "LVGL's version of RLE compression method" + + config LV_USE_QRCODE + bool "QR code library" + + config LV_USE_BARCODE + bool "Barcode library" + + config LV_USE_FREETYPE + bool "FreeType library" + config LV_FREETYPE_USE_LVGL_PORT + bool "Let FreeType to use LVGL memory and file porting" + default n + depends on LV_USE_FREETYPE + config LV_FREETYPE_CACHE_FT_GLYPH_CNT + int "The maximum number of Glyph in count" + default 256 + depends on LV_USE_FREETYPE + + config LV_USE_TINY_TTF + bool "Enable Tiny TTF decoder" + default n + config LV_TINY_TTF_FILE_SUPPORT + bool "Enable loading Tiny TTF data from files" + default n + depends on LV_USE_TINY_TTF + + config LV_USE_RLOTTIE + bool "Lottie library" + config LV_USE_THORVG + bool "ThorVG library" + choice + prompt "Use ThorVG config" + depends on LV_USE_THORVG + default LV_USE_THORVG_INTERNAL + config LV_USE_THORVG_INTERNAL + bool "Use ThorVG internal" + config LV_USE_THORVG_EXTERNAL + bool "Use ThorVG external" + endchoice + + config LV_USE_LZ4 + bool "Enable LZ4 compress/decompress lib" + choice + prompt "Choose lvgl built-in LZ4 lib or external lib" + depends on LV_USE_LZ4 + default LV_USE_LZ4_INTERNAL + config LV_USE_LZ4_INTERNAL + bool "Use lvgl built-in LZ4 lib" + config LV_USE_LZ4_EXTERNAL + bool "Use external LZ4 library" + endchoice + + config LV_USE_FFMPEG + bool "FFmpeg library" + config LV_FFMPEG_DUMP_FORMAT + bool "Dump format" + depends on LV_USE_FFMPEG + default n + endmenu + + menu "Others" + config LV_USE_SNAPSHOT + bool "Enable API to take snapshot" + default n if !LV_CONF_MINIMAL + + config LV_USE_SYSMON + bool "Enable system monitor component" + default n + + config LV_USE_PERF_MONITOR + bool "Show CPU usage and FPS count" + depends on LV_USE_SYSMON + + choice + prompt "Performance monitor position" + depends on LV_USE_PERF_MONITOR + default LV_PERF_MONITOR_ALIGN_BOTTOM_RIGHT + + config LV_PERF_MONITOR_ALIGN_TOP_LEFT + bool "Top left" + config LV_PERF_MONITOR_ALIGN_TOP_MID + bool "Top middle" + config LV_PERF_MONITOR_ALIGN_TOP_RIGHT + bool "Top right" + config LV_PERF_MONITOR_ALIGN_BOTTOM_LEFT + bool "Bottom left" + config LV_PERF_MONITOR_ALIGN_BOTTOM_MID + bool "Bottom middle" + config LV_PERF_MONITOR_ALIGN_BOTTOM_RIGHT + bool "Bottom right" + config LV_PERF_MONITOR_ALIGN_LEFT_MID + bool "Left middle" + config LV_PERF_MONITOR_ALIGN_RIGHT_MID + bool "Right middle" + config LV_PERF_MONITOR_ALIGN_CENTER + bool "Center" + endchoice + + config LV_USE_PERF_MONITOR_LOG_MODE + bool "Prints performance data using log" + depends on LV_USE_PERF_MONITOR + default n + + config LV_USE_MEM_MONITOR + bool "Show the used memory and the memory fragmentation" + default n + depends on LV_STDLIB_BUILTIN && LV_USE_SYSMON + + choice + prompt "Memory monitor position" + depends on LV_USE_MEM_MONITOR + default LV_MEM_MONITOR_ALIGN_BOTTOM_LEFT + + config LV_MEM_MONITOR_ALIGN_TOP_LEFT + bool "Top left" + config LV_MEM_MONITOR_ALIGN_TOP_MID + bool "Top middle" + config LV_MEM_MONITOR_ALIGN_TOP_RIGHT + bool "Top right" + config LV_MEM_MONITOR_ALIGN_BOTTOM_LEFT + bool "Bottom left" + config LV_MEM_MONITOR_ALIGN_BOTTOM_MID + bool "Bottom middle" + config LV_MEM_MONITOR_ALIGN_BOTTOM_RIGHT + bool "Bottom right" + config LV_MEM_MONITOR_ALIGN_LEFT_MID + bool "Left middle" + config LV_MEM_MONITOR_ALIGN_RIGHT_MID + bool "Right middle" + config LV_MEM_MONITOR_ALIGN_CENTER + bool "Center" + endchoice + + config LV_USE_MONKEY + bool "Enable Monkey test" + default n + + config LV_USE_PROFILER + bool "Runtime performance profiler" + config LV_USE_PROFILER_BUILTIN + bool "Enable the built-in profiler" + depends on LV_USE_PROFILER + default y + config LV_PROFILER_BUILTIN_BUF_SIZE + int "Default profiler trace buffer size in bytes" + depends on LV_USE_PROFILER_BUILTIN + default 16384 + config LV_PROFILER_INCLUDE + string "Header to include for the profiler" + depends on LV_USE_PROFILER + default "lvgl/src/misc/lv_profiler_builtin.h" + + config LV_USE_GRIDNAV + bool "Enable grid navigation" + default n + + config LV_USE_FRAGMENT + bool "Enable lv_obj fragment" + default n + + config LV_USE_IMGFONT + bool "draw image in label or span obj" + default n + + config LV_USE_IME_PINYIN + bool "Enable Pinyin input method" + default n + config LV_IME_PINYIN_USE_K9_MODE + bool "Enable Pinyin input method 9 key input mode" + depends on LV_USE_IME_PINYIN + default n + config LV_IME_PINYIN_K9_CAND_TEXT_NUM + int "Maximum number of candidate panels for 9-key input mode" + depends on LV_IME_PINYIN_USE_K9_MODE + default 3 + config LV_IME_PINYIN_USE_DEFAULT_DICT + bool "Use built-in Thesaurus" + depends on LV_USE_IME_PINYIN + default y + help + If you do not use the default thesaurus, be sure to use lv_ime_pinyin after setting the thesauruss + config LV_IME_PINYIN_CAND_TEXT_NUM + int "Maximum number of candidate panels" + depends on LV_USE_IME_PINYIN + default 6 + help + Set the maximum number of candidate panels that can be displayed. + This needs to be adjusted according to the size of the screen. + + config LV_USE_FILE_EXPLORER + bool "Enable file explorer" + default n + config LV_FILE_EXPLORER_PATH_MAX_LEN + int "Maximum length of path" + depends on LV_USE_FILE_EXPLORER + default 128 + config LV_FILE_EXPLORER_QUICK_ACCESS + bool "Enable quick access bar" + depends on LV_USE_FILE_EXPLORER + default y + help + This can save some memory, but not much. After the quick access bar is created, it can be hidden by clicking the button at the top left corner of the browsing area, which is very useful for small screen devices. + endmenu + + menu "Devices" + config LV_USE_SDL + bool "Use SDL to open window on PC and handle mouse and keyboard" + default n + config LV_SDL_INCLUDE_PATH + string "SDL include path" + depends on LV_USE_SDL + default "SDL2/SDL.h" + + choice + prompt "SDL rendering mode" + depends on LV_USE_SDL + default LV_SDL_RENDER_MODE_DIRECT + help + LV_DISPLAY_RENDER_MODE_DIRECT is recommended for best performance + + config LV_SDL_RENDER_MODE_PARTIAL + bool "Use the buffer(s) to render the screen is smaller parts" + + config LV_SDL_RENDER_MODE_DIRECT + bool "Only the changed areas will be updated with 2 screen sized buffers" + + config LV_SDL_RENDER_MODE_FULL + bool "Always redraw the whole screen even if only one pixel has been changed with 2 screen sized buffers" + endchoice + + choice + prompt "SDL buffer size" + depends on LV_USE_SDL + default LV_SDL_SINGLE_BUFFER + + config LV_SDL_SINGLE_BUFFER + bool "One screen-sized buffer" + + config LV_SDL_DOUBLE_BUFFER + bool "Two screen-sized buffer" + depends on !LV_SDL_RENDER_MODE_PARTIAL + + config LV_SDL_CUSTOM_BUFFER + bool "Custom-sized buffer" + depends on LV_SDL_RENDER_MODE_PARTIAL + endchoice + + config LV_SDL_BUFFER_COUNT + int + depends on LV_USE_SDL + default 0 if LV_SDL_CUSTOM_BUFFER + default 1 if LV_SDL_SINGLE_BUFFER + default 2 if LV_SDL_DOUBLE_BUFFER + + config LV_SDL_FULLSCREEN + bool "SDL fullscreen" + depends on LV_USE_SDL + default n + config LV_SDL_DIRECT_EXIT + bool "Exit the application when all SDL windows are closed" + depends on LV_USE_SDL + default y + + config LV_USE_X11 + bool "Use X11 window manager to open window on Linux PC and handle mouse and keyboard" + default n + config LV_X11_DOUBLE_BUFFER + bool "Use double buffers for lvgl rendering" + depends on LV_USE_X11 + default y + config LV_X11_DIRECT_EXIT + bool "Exit the application when all X11 windows have been closed" + depends on LV_USE_X11 + default y + choice + prompt "X11 device render mode" + depends on LV_USE_X11 + default LV_X11_RENDER_MODE_PARTIAL + + config LV_X11_RENDER_MODE_PARTIAL + bool "Partial render mode (preferred)" + help + Use the buffer(s) to render the screen is smaller parts. This way the buffers can be smaller then the display to save RAM. + Appr. 1/10 screen size buffer(s) are used. + config LV_X11_RENDER_MODE_DIRECT + bool "Direct render mode" + help + The buffer(s) has to be screen sized and LVGL will render into the correct location of the buffer. This way the buffer always contain the whole image. Only the changed ares will be updated. + With 2 buffers the buffers' content are kept in sync automatically and in flush_cb only address change is required. + config LV_X11_RENDER_MODE_FULL + bool "Full render mode" + help + Always redraw the whole screen even if only one pixel has been changed. + With 2 buffers in flush_cb only and address change is required. + endchoice + + config LV_USE_LINUX_FBDEV + bool "Use Linux framebuffer device" + default n + config LV_LINUX_FBDEV_BSD + bool "Use BSD flavored framebuffer device" + depends on LV_USE_LINUX_FBDEV + default n + + choice + prompt "Framebuffer device render mode" + depends on LV_USE_LINUX_FBDEV + default LV_LINUX_FBDEV_RENDER_MODE_PARTIAL + + config LV_LINUX_FBDEV_RENDER_MODE_PARTIAL + bool "Partial mode" + help + Use the buffer(s) to render the screen is smaller parts. This way the buffers can be smaller then the display to save RAM. At least 1/10 screen size buffer(s) are recommended. + + config LV_LINUX_FBDEV_RENDER_MODE_DIRECT + bool "Direct mode" + help + The buffer(s) has to be screen sized and LVGL will render into the correct location of the buffer. This way the buffer always contain the whole image. Only the changed ares will be updated. With 2 buffers the buffers' content are kept in sync automatically and in flush_cb only address change is required. + + config LV_LINUX_FBDEV_RENDER_MODE_FULL + bool "Full mode" + help + Always redraw the whole screen even if only one pixel has been changed. With 2 buffers in flush_cb only and address change is required. + + endchoice + + choice + prompt "Framebuffer size" + depends on LV_USE_LINUX_FBDEV + default LV_LINUX_FBDEV_SINGLE_BUFFER + + config LV_LINUX_FBDEV_SINGLE_BUFFER + bool "One screen-sized buffer" + + config LV_LINUX_FBDEV_DOUBLE_BUFFER + bool "Two screen-sized buffer" + depends on !LV_LINUX_FBDEV_RENDER_MODE_PARTIAL + + config LV_LINUX_FBDEV_CUSTOM_BUFFER + bool "Custom-sized buffer" + depends on LV_LINUX_FBDEV_RENDER_MODE_PARTIAL + + endchoice + + config LV_LINUX_FBDEV_BUFFER_COUNT + int + depends on LV_USE_LINUX_FBDEV + default 0 if LV_LINUX_FBDEV_CUSTOM_BUFFER + default 1 if LV_LINUX_FBDEV_SINGLE_BUFFER + default 2 if LV_LINUX_FBDEV_DOUBLE_BUFFER + + config LV_LINUX_FBDEV_BUFFER_SIZE + int "Custom partial buffer size (in number of rows)" + depends on LV_USE_LINUX_FBDEV && LV_LINUX_FBDEV_CUSTOM_BUFFER + default 60 + + config LV_USE_NUTTX + bool "Use Nuttx to open window and handle touchscreen" + default n + + config LV_USE_NUTTX_LIBUV + bool "Use uv loop to replace default timer loop and other fb/indev timers" + depends on LV_USE_NUTTX + default n + + config LV_USE_NUTTX_CUSTOM_INIT + bool "Use Custom Nuttx init API to open window and handle touchscreen" + depends on LV_USE_NUTTX + default n + + config LV_USE_NUTTX_LCD + bool "Use NuttX LCD device" + depends on LV_USE_NUTTX + default n + + choice + prompt "NuttX LCD buffer size" + depends on LV_USE_NUTTX_LCD + default LV_NUTTX_LCD_SINGLE_BUFFER + + config LV_NUTTX_LCD_SINGLE_BUFFER + bool "One screen-sized buffer" + + config LV_NUTTX_LCD_DOUBLE_BUFFER + bool "Two screen-sized buffer" + + config LV_NUTTX_LCD_CUSTOM_BUFFER + bool "Custom-sized buffer" + + endchoice + + config LV_NUTTX_LCD_BUFFER_COUNT + int + depends on LV_USE_NUTTX_LCD + default 0 if LV_NUTTX_LCD_CUSTOM_BUFFER + default 1 if LV_NUTTX_LCD_SINGLE_BUFFER + default 2 if LV_NUTTX_LCD_DOUBLE_BUFFER + + config LV_NUTTX_LCD_BUFFER_SIZE + int "Custom partial buffer size (in number of rows)" + depends on LV_USE_NUTTX_LCD && LV_NUTTX_LCD_CUSTOM_BUFFER + default 60 + + config LV_USE_NUTTX_TOUCHSCREEN + bool "Use NuttX touchscreen driver" + depends on LV_USE_NUTTX + default n + + config LV_USE_LINUX_DRM + bool "Use Linux DRM device" + default n + + config LV_USE_TFT_ESPI + bool "Use TFT_eSPI driver" + default n + + config LV_USE_EVDEV + bool "Use evdev input driver" + default n + + config LV_USE_LIBINPUT + bool "Use libinput input driver" + default n + + config LV_LIBINPUT_BSD + bool "Use the BSD variant of the libinput input driver" + depends on LV_USE_LIBINPUT + default n + + config LV_LIBINPUT_XKB + bool "Enable full keyboard support via XKB" + depends on LV_USE_LIBINPUT + default n + + config LV_USE_ST7735 + bool "Use ST7735 LCD driver" + default n + + config LV_USE_ST7789 + bool "Use ST7789 LCD driver" + default n + + config LV_USE_ST7796 + bool "Use ST7796 LCD driver" + default n + + config LV_USE_ILI9341 + bool "Use ILI9341 LCD driver" + default n + + config LV_USE_GENERIC_MIPI + bool "Generic MIPI driver" + default y if LV_USE_ST7735 || LV_USE_ST7789 || LV_USE_ST7796 || LV_USE_ILI9341 + + config LV_USE_WINDOWS + bool "Use LVGL Windows backend" + default n + endmenu + + menu "Examples" + config LV_BUILD_EXAMPLES + bool "Enable the examples to be built" + default y if !LV_CONF_MINIMAL + endmenu + + menu "Demos" + config LV_USE_DEMO_WIDGETS + bool "Show some widget" + default n + + config LV_USE_DEMO_KEYPAD_AND_ENCODER + bool "Demonstrate the usage of encoder and keyboard" + default n + + config LV_USE_DEMO_BENCHMARK + bool "Benchmark your system" + default n + depends on LV_FONT_MONTSERRAT_14 && LV_FONT_MONTSERRAT_24 && LV_USE_DEMO_WIDGETS + config LV_USE_DEMO_RENDER + bool "Render test for each primitives. Requires at least 480x272 display" + default n + + config LV_USE_DEMO_SCROLL + bool "Scroll settings test for LVGL" + default n + + config LV_USE_DEMO_STRESS + bool "Stress test for LVGL" + default n + + config LV_USE_DEMO_TRANSFORM + bool "Transform test for LVGL" + default n + depends on LV_FONT_MONTSERRAT_18 + + config LV_USE_DEMO_MUSIC + bool "Music player demo" + default n + config LV_DEMO_MUSIC_SQUARE + bool "Enable Square" + depends on LV_USE_DEMO_MUSIC + default n + config LV_DEMO_MUSIC_LANDSCAPE + bool "Enable Landscape" + depends on LV_USE_DEMO_MUSIC + default n + config LV_DEMO_MUSIC_ROUND + bool "Enable Round" + depends on LV_USE_DEMO_MUSIC + default n + config LV_DEMO_MUSIC_LARGE + bool "Enable Large" + depends on LV_USE_DEMO_MUSIC + default n + config LV_DEMO_MUSIC_AUTO_PLAY + bool "Enable Auto play" + depends on LV_USE_DEMO_MUSIC + default n + + config LV_USE_DEMO_FLEX_LAYOUT + bool "Flex layout previewer" + default n + config LV_USE_DEMO_MULTILANG + bool "multi-language demo" + default n + config LV_USE_DEMO_VECTOR_GRAPHIC + bool "vector graphic demo" + default n + depends on LV_USE_VECTOR_GRAPHIC + endmenu + +endmenu endif # GRAPHICS_LVGL diff --git a/graphics/lvgl/Makefile b/graphics/lvgl/Makefile index c303afaf5..11d62265c 100644 --- a/graphics/lvgl/Makefile +++ b/graphics/lvgl/Makefile @@ -25,69 +25,8 @@ include $(APPDIR)/Make.defs LVGL_DIR = . LVGL_DIR_NAME = lvgl -# Relax LVGL's format checking and unused variable checking to avoid errors - -CFLAGS += -Wno-format -Wno-format-security -Wno-unused-variable - -# Since this change is only merged into the lvgl.v9, let us workaround for v8 -# ./lvgl/src/core/lv_obj.c:363:25: warning: variable 'x' set but not used [-Wunused-but-set-variable] -# 363 | static uint32_t x = 0; -# | ^ -# 1 warning generated. - -CFLAGS += -Wno-unused-but-set-variable - -include ./lvgl/lvgl.mk -CSRCS += port/lv_port.c -CSRCS += port/lv_port_tick.c - -ifeq ($(CONFIG_LIBUV),y) -CSRCS += port/lv_port_libuv.c -endif - -ifeq ($(CONFIG_LV_PORT_USE_LCDDEV),y) -CSRCS += port/lv_port_lcddev.c -endif - -ifeq ($(CONFIG_LV_PORT_USE_FBDEV),y) -CSRCS += port/lv_port_fbdev.c -endif - -ifeq ($(CONFIG_LV_PORT_USE_TOUCHPAD),y) -CSRCS += port/lv_port_touchpad.c -endif - -ifeq ($(CONFIG_LV_PORT_USE_BUTTON),y) -CSRCS += port/lv_port_button.c -endif - -ifeq ($(CONFIG_LV_PORT_USE_KEYPAD),y) -CSRCS += port/lv_port_keypad.c -endif - -ifeq ($(CONFIG_LV_PORT_USE_ENCODER),y) -CSRCS += port/lv_port_encoder.c -endif - -ifeq ($(CONFIG_LV_USE_LOG),y) -CSRCS += port/lv_port_syslog.c -endif - -ifneq ($(CONFIG_LV_PORT_MEM_ATTRIBUTE_FAST_MEM_SECTION_NAME), "") -CFLAGS += "-DLV_ATTRIBUTE_FAST_MEM=locate_data(CONFIG_LV_PORT_MEM_ATTRIBUTE_FAST_MEM_SECTION_NAME)" -CXXFLAGS += "-DLV_ATTRIBUTE_FAST_MEM=locate_data(CONFIG_LV_PORT_MEM_ATTRIBUTE_FAST_MEM_SECTION_NAME)" -endif - -ifeq ($(CONFIG_LV_MEM_CUSTOM),y) -ifneq ($(CONFIG_LV_PORT_MEM_CUSTOM_SIZE), 0) -CFLAGS += "-DLV_MEM_CUSTOM_ALLOC=lv_port_mem_alloc" -CFLAGS += "-DLV_MEM_CUSTOM_FREE=lv_port_mem_free" -CFLAGS += "-DLV_MEM_CUSTOM_REALLOC=lv_port_mem_realloc" -CSRCS += port/lv_port_mem.c -endif -endif - ifneq ($(CONFIG_LV_ASSERT_HANDLER_INCLUDE), "") CFLAGS += "-DLV_ASSERT_HANDLER=ASSERT(0);" endif @@ -98,7 +37,7 @@ WD := ${shell echo $(CURDIR) | sed -e 's/ /\\ /g'} CONFIG_GRAPH_LVGL_URL ?= "https://github.com/lvgl/lvgl/archive/refs/tags" -LVGL_VERSION = $(patsubst "%",%,$(strip $(CONFIG_LVGL_VERSION))) +LVGL_VERSION = 9.1.0 LVGL_TARBALL = v$(LVGL_VERSION).zip LVGL_UNPACKNAME = lvgl diff --git a/graphics/lvgl/lv_conf/Kconfig b/graphics/lvgl/lv_conf/Kconfig deleted file mode 100644 index 65f02eda3..000000000 --- a/graphics/lvgl/lv_conf/Kconfig +++ /dev/null @@ -1,1115 +0,0 @@ -# -# For a description of the syntax of this configuration file, -# see the file kconfig-language.txt in the NuttX tools repository. -# - -# Kconfig file for LVGL v8.0 - -menu "LVGL configuration" - - # Define CONFIG_LV_CONF_SKIP so we can use LVGL - # without lv_conf.h file, the lv_conf_internal.h and - # lv_conf_kconfig.h files are used instead. - config LV_CONF_SKIP - bool "Uncheck this to use custom lv_conf.h" - default y - - config LV_CONF_MINIMAL - bool "LVGL minimal configuration." - - menu "Color settings" - choice LV_COLOR_DEPTH - prompt "Color depth." - default LV_COLOR_DEPTH_16 - help - Color depth to be used. - - config LV_COLOR_DEPTH_32 - bool "32: ARGB8888" - config LV_COLOR_DEPTH_16 - bool "16: RGB565" - config LV_COLOR_DEPTH_8 - bool "8: RGB232" - config LV_COLOR_DEPTH_1 - bool "1: 1 byte per pixel" - endchoice - - config LV_COLOR_DEPTH - int - default 1 if LV_COLOR_DEPTH_1 - default 8 if LV_COLOR_DEPTH_8 - default 16 if LV_COLOR_DEPTH_16 - default 32 if LV_COLOR_DEPTH_32 - - config LV_COLOR_16_SWAP - bool "Swap the 2 bytes of RGB565 color. Useful if the display has an 8-bit interface (e.g. SPI)." - depends on LV_COLOR_DEPTH_16 - - config LV_COLOR_SCREEN_TRANSP - bool "Enable more complex drawing routines to manage screens transparency." - help - Can be used if the UI is above another layer, e.g. an OSD menu or video player. - The screen's `bg_opa` should be set to non LV_OPA_COVER value - - config LV_COLOR_MIX_ROUND_OFS - int "Adjust color mix functions rounding" - default 128 if !LV_COLOR_DEPTH_32 - default 0 if LV_COLOR_DEPTH_32 - range 0 254 - help - 0: no adjustment, get the integer part of the result (round down) - 64: round up from x.75 - 128: round up from half - 192: round up from x.25 - 254: round up - - config LV_COLOR_CHROMA_KEY_HEX - hex "Images pixels with this color will not be drawn (if they are chroma keyed)." - range 0x000000 0xFFFFFF - default 0x00FF00 - help - See misc/lv_color.h for some color values examples. - endmenu - - menu "Memory settings" - config LV_MEM_CUSTOM - bool "If true use custom malloc/free, otherwise use the built-in `lv_mem_alloc()` and `lv_mem_free()`" - - config LV_MEM_SIZE_KILOBYTES - int "Size of the memory used by `lv_mem_alloc` in kilobytes (>= 2kB)" - range 2 128 - default 32 - depends on !LV_MEM_CUSTOM - - config LV_MEM_ADDR - hex "Address for the memory pool instead of allocating it as a normal array" - default 0x0 - depends on !LV_MEM_CUSTOM - - config LV_MEM_CUSTOM_INCLUDE - string "Header to include for the custom memory function" - default "stdlib.h" - depends on LV_MEM_CUSTOM - - config LV_MEM_BUF_MAX_NUM - int "Number of the memory buffer" - default 16 - help - Number of the intermediate memory buffer used during rendering and other - internal processing mechanisms. You will see an error log message if - there wasn't enough buffers. - - config LV_MEMCPY_MEMSET_STD - bool "Use the standard memcpy and memset instead of LVGL's own functions" - endmenu - - menu "HAL Settings" - config LV_DISP_DEF_REFR_PERIOD - int "Default display refresh period (ms)." - default 30 - help - Can be changed in the display driver (`lv_disp_drv_t`). - - config LV_INDEV_DEF_READ_PERIOD - int "Input device read period [ms]." - default 30 - - config LV_TICK_CUSTOM - bool "Use a custom tick source" - - config LV_TICK_CUSTOM_INCLUDE - string "Header for the system time function" - default "Arduino.h" - depends on LV_TICK_CUSTOM - - config LV_DPI_DEF - int "Default Dots Per Inch (in px)." - default 130 - help - Used to initialize default sizes such as widgets sized, style paddings. - (Not so important, you can adjust it to modify default sizes and spaces) - endmenu - - menu "Feature configuration" - - menu "Drawing" - config LV_DRAW_COMPLEX - bool "Enable complex draw engine" - default y - help - Required to draw shadow, gradient, rounded corners, circles, arc, skew lines, - image transformations or any masks. - - config LV_SHADOW_CACHE_SIZE - int "Allow buffering some shadow calculation" - depends on LV_DRAW_COMPLEX - default 0 - help - LV_SHADOW_CACHE_SIZE is the max shadow size to buffer, where - shadow size is `shadow_width + radius`. - Caching has LV_SHADOW_CACHE_SIZE^2 RAM cost. - - config LV_CIRCLE_CACHE_SIZE - int "Set number of maximally cached circle data" - depends on LV_DRAW_COMPLEX - default 4 - help - The circumference of 1/4 circle are saved for anti-aliasing - radius * 4 bytes are used per circle (the most often used - radiuses are saved). - Set to 0 to disable caching. - - config LV_LAYER_SIMPLE_BUF_SIZE - int "Optimal size to buffer the widget with opacity" - default 24576 - help - "Simple layers" are used when a widget has `style_opa < 255` - to buffer the widget into a layer and blend it as an image - with the given opacity. Note that `bg_opa`, `text_opa` etc - don't require buffering into layer. - - config LV_IMG_CACHE_DEF_SIZE - int "Default image cache size. 0 to disable caching." - default 0 - help - If only the built-in image formats are used there is no real advantage of caching. - (I.e. no new image decoder is added). - - With complex image decoders (e.g. PNG or JPG) caching can - save the continuous open/decode of images. - However the opened images might consume additional RAM. - - config LV_GRADIENT_MAX_STOPS - int "Number of stops allowed per gradient." - default 2 - help - Increase this to allow more stops. - This adds (sizeof(lv_color_t) + 1) bytes per additional stop - - config LV_GRAD_CACHE_DEF_SIZE - int "Default gradient buffer size." - default 0 - help - When LVGL calculates the gradient "maps" it can save them into a cache to avoid calculating them again. - LV_GRAD_CACHE_DEF_SIZE sets the size of this cache in bytes. - If the cache is too small the map will be allocated only while it's required for the drawing. - 0 mean no caching. - - config LV_DITHER_GRADIENT - bool "Allow dithering the gradients" - help - Allow dithering the gradients (to achieve visual smooth color gradients on limited color depth display) - LV_DITHER_GRADIENT implies allocating one or two more lines of the object's rendering surface - The increase in memory consumption is (32 bits * object width) plus 24 bits * object width if using error diffusion - - config LV_DITHER_ERROR_DIFFUSION - bool "Add support for error diffusion dithering" - depends on LV_DITHER_GRADIENT - help - Error diffusion dithering gets a much better visual result, but implies more CPU consumption and memory when drawing. - The increase in memory consumption is (24 bits * object's width) - - config LV_DISP_ROT_MAX_BUF - int "Maximum buffer size to allocate for rotation" - default 10240 - help - Only used if software rotation is enabled in the display driver. - endmenu - - menu "GPU" - config LV_USE_GPU_ARM2D - bool "Enable Arm's 2D image processing library (Arm-2D) for all Cortex-M processors." - default n - help - Must deploy arm-2d library to your project and add include PATH for "arm_2d.h". - - config LV_USE_GPU_STM32_DMA2D - bool "Enable STM32 DMA2D (aka Chrom Art) GPU." - config LV_GPU_DMA2D_CMSIS_INCLUDE - string "include path of CMSIS header of target processor" - depends on LV_USE_GPU_STM32_DMA2D - default "" - help - Must be defined to include path of CMSIS header of target processor - e.g. "stm32f769xx.h" or "stm32f429xx.h" - - config LV_USE_GPU_SWM341_DMA2D - bool "Enable SWM341 DMA2D GPU." - config LV_GPU_SWM341_DMA2D_INCLUDE - string "include path of CMSIS header of target processor" - depends on LV_USE_GPU_SWM341_DMA2D - default "SWM341.h" - help - Must be defined to include path of CMSIS header of target processor - e.g. "SWM341.h" - - config LV_USE_GPU_NXP_PXP - bool "Use NXP's PXP GPU iMX RTxxx platforms." - config LV_USE_GPU_NXP_PXP_AUTO_INIT - bool "Call lv_gpu_nxp_pxp_init() automatically or manually." - depends on LV_USE_GPU_NXP_PXP - help - 1: Add default bare metal and FreeRTOS interrupt handling - routines for PXP (lv_gpu_nxp_pxp_osa.c) and call - lv_gpu_nxp_pxp_init() automatically during lv_init(). - Note that symbol SDK_OS_FREE_RTOS has to be defined in order - to use FreeRTOS OSA, otherwise bare-metal implementation is - selected. - 0: lv_gpu_nxp_pxp_init() has to be called manually before - lv_init(). - - config LV_USE_GPU_NXP_VG_LITE - bool "Use NXP's VG-Lite GPU iMX RTxxx platforms." - - config LV_USE_GPU_SDL - bool "Use SDL renderer API" - default n - config LV_GPU_SDL_INCLUDE_PATH - string "include path of SDL header" - depends on LV_USE_GPU_SDL - default "SDL2/SDL.h" - config LV_GPU_SDL_LRU_SIZE - int "Maximum buffer size to allocate for rotation" - depends on LV_USE_GPU_SDL - default 8388608 - help - Texture cache size, 8MB by default. - endmenu - - menu "Logging" - config LV_USE_LOG - bool "Enable the log module" - - choice - bool "Default log verbosity" if LV_USE_LOG - default LV_LOG_LEVEL_WARN - help - Specify how important log should be added. - - config LV_LOG_LEVEL_TRACE - bool "A lot of logs to give detailed information" - config LV_LOG_LEVEL_INFO - bool "Log important events" - config LV_LOG_LEVEL_WARN - bool "Log if something unwanted happened but didn't cause a problem" - config LV_LOG_LEVEL_ERROR - bool "Only critical issues, when the system may fail" - config LV_LOG_LEVEL_USER - bool "Only logs added by the user" - config LV_LOG_LEVEL_NONE - bool "Do not log anything" - endchoice - - config LV_LOG_LEVEL - int - default 0 if LV_LOG_LEVEL_TRACE - default 1 if LV_LOG_LEVEL_INFO - default 2 if LV_LOG_LEVEL_WARN - default 3 if LV_LOG_LEVEL_ERROR - default 4 if LV_LOG_LEVEL_USER - default 5 if LV_LOG_LEVEL_NONE - - config LV_LOG_PRINTF - bool "Print the log with 'printf'" if LV_USE_LOG - help - Use printf for log output. - If not set the user needs to register a callback with `lv_log_register_print_cb`. - - config LV_LOG_TRACE_MEM - bool "Enable/Disable LV_LOG_TRACE in mem module" - default y - depends on LV_USE_LOG - - config LV_LOG_TRACE_TIMER - bool "Enable/Disable LV_LOG_TRACE in timer module" - default y - depends on LV_USE_LOG - - config LV_LOG_TRACE_INDEV - bool "Enable/Disable LV_LOG_TRACE in indev module" - default y - depends on LV_USE_LOG - - config LV_LOG_TRACE_DISP_REFR - bool "Enable/Disable LV_LOG_TRACE in disp refr module" - default y - depends on LV_USE_LOG - - config LV_LOG_TRACE_EVENT - bool "Enable/Disable LV_LOG_TRACE in event module" - default y - depends on LV_USE_LOG - - config LV_LOG_TRACE_OBJ_CREATE - bool "Enable/Disable LV_LOG_TRACE in obj create module" - default y - depends on LV_USE_LOG - - config LV_LOG_TRACE_LAYOUT - bool "Enable/Disable LV_LOG_TRACE in layout module" - default y - depends on LV_USE_LOG - - config LV_LOG_TRACE_ANIM - bool "Enable/Disable LV_LOG_TRACE in anim module" - default y - depends on LV_USE_LOG - endmenu - - menu "Asserts" - config LV_USE_ASSERT_NULL - bool "Check if the parameter is NULL. (Very fast, recommended)" - default y if !LV_CONF_MINIMAL - - config LV_USE_ASSERT_MALLOC - bool "Checks if the memory is successfully allocated or no. (Very fast, recommended)" - default y if !LV_CONF_MINIMAL - - config LV_USE_ASSERT_STYLE - bool "Check if the styles are properly initialized. (Very fast, recommended)" - - config LV_USE_ASSERT_MEM_INTEGRITY - bool "Check the integrity of `lv_mem` after critical operations. (Slow)" - - config LV_USE_ASSERT_OBJ - bool "Check NULL, the object's type and existence (e.g. not deleted). (Slow)." - - config LV_ASSERT_HANDLER_INCLUDE - string "Header to include for the custom assert function" - default "assert.h" - endmenu - - menu "Others" - config LV_USE_PERF_MONITOR - bool "Show CPU usage and FPS count." - - choice - prompt "Performance monitor position." - depends on LV_USE_PERF_MONITOR - default LV_PERF_MONITOR_ALIGN_BOTTOM_RIGHT - - config LV_PERF_MONITOR_ALIGN_TOP_LEFT - bool "Top left" - config LV_PERF_MONITOR_ALIGN_TOP_MID - bool "Top middle" - config LV_PERF_MONITOR_ALIGN_TOP_RIGHT - bool "Top right" - config LV_PERF_MONITOR_ALIGN_BOTTOM_LEFT - bool "Bottom left" - config LV_PERF_MONITOR_ALIGN_BOTTOM_MID - bool "Bottom middle" - config LV_PERF_MONITOR_ALIGN_BOTTOM_RIGHT - bool "Bottom right" - config LV_PERF_MONITOR_ALIGN_LEFT_MID - bool "Left middle" - config LV_PERF_MONITOR_ALIGN_RIGHT_MID - bool "Right middle" - config LV_PERF_MONITOR_ALIGN_CENTER - bool "Center" - endchoice - - config LV_USE_MEM_MONITOR - bool "Show the used memory and the memory fragmentation." - depends on !LV_MEM_CUSTOM - - choice - prompt "Memory monitor position." - depends on LV_USE_MEM_MONITOR - default LV_MEM_MONITOR_ALIGN_BOTTOM_LEFT - - config LV_MEM_MONITOR_ALIGN_TOP_LEFT - bool "Top left" - config LV_MEM_MONITOR_ALIGN_TOP_MID - bool "Top middle" - config LV_MEM_MONITOR_ALIGN_TOP_RIGHT - bool "Top right" - config LV_MEM_MONITOR_ALIGN_BOTTOM_LEFT - bool "Bottom left" - config LV_MEM_MONITOR_ALIGN_BOTTOM_MID - bool "Bottom middle" - config LV_MEM_MONITOR_ALIGN_BOTTOM_RIGHT - bool "Bottom right" - config LV_MEM_MONITOR_ALIGN_LEFT_MID - bool "Left middle" - config LV_MEM_MONITOR_ALIGN_RIGHT_MID - bool "Right middle" - config LV_MEM_MONITOR_ALIGN_CENTER - bool "Center" - endchoice - - config LV_USE_REFR_DEBUG - bool "Draw random colored rectangles over the redrawn areas." - - config LV_SPRINTF_CUSTOM - bool "Change the built-in (v)snprintf functions" - - config LV_SPRINTF_INCLUDE - string "Header to include for the custom sprintf function" - depends on LV_SPRINTF_CUSTOM - default "stdio.h" - - config LV_SPRINTF_USE_FLOAT - bool "Enable float in built-in (v)snprintf functions" - depends on !LV_SPRINTF_CUSTOM - - config LV_USE_USER_DATA - bool "Add a 'user_data' to drivers and objects." - default y - - config LV_ENABLE_GC - bool "Enable garbage collector" - - config LV_GC_INCLUDE - string "Header to include for the garbage collector related things" - depends on LV_ENABLE_GC - default "gc.h" - endmenu - - menu "Compiler settings" - config LV_BIG_ENDIAN_SYSTEM - bool "For big endian systems set to 1" - - config LV_ATTRIBUTE_MEM_ALIGN_SIZE - int "Required alignment size for buffers" - default 1 - - config LV_ATTRIBUTE_FAST_MEM_USE_IRAM - bool "Set IRAM as LV_ATTRIBUTE_FAST_MEM" - help - Set this option to configure IRAM as LV_ATTRIBUTE_FAST_MEM - - config LV_USE_LARGE_COORD - bool "Extend the default -32k..32k coordinate range to -4M..4M by using int32_t for coordinates instead of int16_t" - endmenu - endmenu - - menu "Font usage" - menu "Enable built-in fonts" - config LV_FONT_MONTSERRAT_8 - bool "Enable Montserrat 8" - config LV_FONT_MONTSERRAT_10 - bool "Enable Montserrat 10" - config LV_FONT_MONTSERRAT_12 - bool "Enable Montserrat 12" - config LV_FONT_MONTSERRAT_14 - bool "Enable Montserrat 14" - default y if !LV_CONF_MINIMAL - config LV_FONT_MONTSERRAT_16 - bool "Enable Montserrat 16" - config LV_FONT_MONTSERRAT_18 - bool "Enable Montserrat 18" - config LV_FONT_MONTSERRAT_20 - bool "Enable Montserrat 20" - config LV_FONT_MONTSERRAT_22 - bool "Enable Montserrat 22" - config LV_FONT_MONTSERRAT_24 - bool "Enable Montserrat 24" - config LV_FONT_MONTSERRAT_26 - bool "Enable Montserrat 26" - config LV_FONT_MONTSERRAT_28 - bool "Enable Montserrat 28" - config LV_FONT_MONTSERRAT_30 - bool "Enable Montserrat 30" - config LV_FONT_MONTSERRAT_32 - bool "Enable Montserrat 32" - config LV_FONT_MONTSERRAT_34 - bool "Enable Montserrat 34" - config LV_FONT_MONTSERRAT_36 - bool "Enable Montserrat 36" - config LV_FONT_MONTSERRAT_38 - bool "Enable Montserrat 38" - config LV_FONT_MONTSERRAT_40 - bool "Enable Montserrat 40" - config LV_FONT_MONTSERRAT_42 - bool "Enable Montserrat 42" - config LV_FONT_MONTSERRAT_44 - bool "Enable Montserrat 44" - config LV_FONT_MONTSERRAT_46 - bool "Enable Montserrat 46" - config LV_FONT_MONTSERRAT_48 - bool "Enable Montserrat 48" - - config LV_FONT_MONTSERRAT_12_SUBPX - bool "Enable Montserrat 12 sub-pixel" - config LV_FONT_MONTSERRAT_28_COMPRESSED - bool "Enable Montserrat 28 compressed" - config LV_FONT_DEJAVU_16_PERSIAN_HEBREW - bool "Enable Dejavu 16 Persian, Hebrew, Arabic letters" - config LV_FONT_SIMSUN_16_CJK - bool "Enable Simsun 16 CJK" - - config LV_FONT_UNSCII_8 - bool "Enable UNSCII 8 (Perfect monospace font)" - default y if LV_CONF_MINIMAL - config LV_FONT_UNSCII_16 - bool "Enable UNSCII 16 (Perfect monospace font)" - - config LV_FONT_CUSTOM - bool "Enable the custom font" - config LV_FONT_CUSTOM_DECLARE - string "Header to include for the custom font" - depends on LV_FONT_CUSTOM - endmenu - - choice LV_FONT_DEFAULT - prompt "Select theme default title font" - default LV_FONT_DEFAULT_MONTSERRAT_14 if !LV_CONF_MINIMAL - default LV_FONT_DEFAULT_UNSCII_8 if LV_CONF_MINIMAL - help - Select theme default title font - - config LV_FONT_DEFAULT_MONTSERRAT_8 - bool "Montserrat 8" - select LV_FONT_MONTSERRAT_8 - config LV_FONT_DEFAULT_MONTSERRAT_12 - bool "Montserrat 12" - select LV_FONT_MONTSERRAT_12 - config LV_FONT_DEFAULT_MONTSERRAT_14 - bool "Montserrat 14" - select LV_FONT_MONTSERRAT_14 - config LV_FONT_DEFAULT_MONTSERRAT_16 - bool "Montserrat 16" - select LV_FONT_MONTSERRAT_16 - config LV_FONT_DEFAULT_MONTSERRAT_18 - bool "Montserrat 18" - select LV_FONT_MONTSERRAT_18 - config LV_FONT_DEFAULT_MONTSERRAT_20 - bool "Montserrat 20" - select LV_FONT_MONTSERRAT_20 - config LV_FONT_DEFAULT_MONTSERRAT_22 - bool "Montserrat 22" - select LV_FONT_MONTSERRAT_22 - config LV_FONT_DEFAULT_MONTSERRAT_24 - bool "Montserrat 24" - select LV_FONT_MONTSERRAT_24 - config LV_FONT_DEFAULT_MONTSERRAT_26 - bool "Montserrat 26" - select LV_FONT_MONTSERRAT_26 - config LV_FONT_DEFAULT_MONTSERRAT_28 - bool "Montserrat 28" - select LV_FONT_MONTSERRAT_28 - config LV_FONT_DEFAULT_MONTSERRAT_30 - bool "Montserrat 30" - select LV_FONT_MONTSERRAT_30 - config LV_FONT_DEFAULT_MONTSERRAT_32 - bool "Montserrat 32" - select LV_FONT_MONTSERRAT_32 - config LV_FONT_DEFAULT_MONTSERRAT_34 - bool "Montserrat 34" - select LV_FONT_MONTSERRAT_34 - config LV_FONT_DEFAULT_MONTSERRAT_36 - bool "Montserrat 36" - select LV_FONT_MONTSERRAT_36 - config LV_FONT_DEFAULT_MONTSERRAT_38 - bool "Montserrat 38" - select LV_FONT_MONTSERRAT_38 - config LV_FONT_DEFAULT_MONTSERRAT_40 - bool "Montserrat 40" - select LV_FONT_MONTSERRAT_40 - config LV_FONT_DEFAULT_MONTSERRAT_42 - bool "Montserrat 42" - select LV_FONT_MONTSERRAT_42 - config LV_FONT_DEFAULT_MONTSERRAT_44 - bool "Montserrat 44" - select LV_FONT_MONTSERRAT_44 - config LV_FONT_DEFAULT_MONTSERRAT_46 - bool "Montserrat 46" - select LV_FONT_MONTSERRAT_46 - config LV_FONT_DEFAULT_MONTSERRAT_48 - bool "Montserrat 48" - select LV_FONT_MONTSERRAT_48 - config LV_FONT_DEFAULT_MONTSERRAT_12_SUBPX - bool "Montserrat 12 sub-pixel" - select LV_FONT_MONTSERRAT_12_SUBPX - config LV_FONT_DEFAULT_MONTSERRAT_28_COMPRESSED - bool "Montserrat 28 compressed" - select LV_FONT_MONTSERRAT_28_COMPRESSED - config LV_FONT_DEFAULT_DEJAVU_16_PERSIAN_HEBREW - bool "Dejavu 16 Persian, Hebrew, Arabic letters" - select LV_FONT_DEJAVU_16_PERSIAN_HEBREW - config LV_FONT_DEFAULT_SIMSUN_16_CJK - bool "Simsun 16 CJK" - select LV_FONT_SIMSUN_16_CJK - config LV_FONT_DEFAULT_UNSCII_8 - bool "UNSCII 8 (Perfect monospace font)" - select LV_FONT_UNSCII_8 - config LV_FONT_DEFAULT_UNSCII_16 - bool "UNSCII 16 (Perfect monospace font)" - select LV_FONT_UNSCII_16 - endchoice - - config LV_FONT_FMT_TXT_LARGE - bool "Enable it if you have fonts with a lot of characters." - help - The limit depends on the font size, font face and bpp - but with > 10,000 characters if you see issues probably you - need to enable it. - - config LV_USE_FONT_COMPRESSED - bool "Sets support for compressed fonts." - - config LV_USE_FONT_SUBPX - bool "Enable subpixel rendering." - - config LV_FONT_SUBPX_BGR - bool "Use BGR instead RGB for sub-pixel rendering." - depends on LV_USE_FONT_SUBPX - help - Set the pixel order of the display. - Important only if "subpx fonts" are used. - With "normal" font it doesn't matter. - - config LV_USE_FONT_PLACEHOLDER - bool "Enable drawing placeholders when glyph dsc is not found." - default y - endmenu - - menu "Text Settings" - choice LV_TXT_ENC - prompt "Select a character encoding for strings" - help - Select a character encoding for strings. Your IDE or editor should have the same character encoding. - default LV_TXT_ENC_UTF8 if !LV_CONF_MINIMAL - default LV_TXT_ENC_ASCII if LV_CONF_MINIMAL - - config LV_TXT_ENC_UTF8 - bool "UTF8" - config LV_TXT_ENC_ASCII - bool "ASCII" - endchoice - - config LV_TXT_BREAK_CHARS - string "Can break (wrap) texts on these chars" - default " ,.;:-_" - - config LV_TXT_LINE_BREAK_LONG_LEN - int "Line break long length" - default 0 - help - If a word is at least this long, will break wherever 'prettiest'. - To disable, set to a value <= 0. - - config LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN - int "Min num chars before break" - default 3 - depends on LV_TXT_LINE_BREAK_LONG_LEN > 0 - help - Minimum number of characters in a long word to put on a line before a break. - - config LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN - int "Min num chars after break" - default 3 - depends on LV_TXT_LINE_BREAK_LONG_LEN > 0 - help - Minimum number of characters in a long word to put on a line after a break. - - config LV_TXT_COLOR_CMD - string "The control character to use for signalling text recoloring" - default "#" - - config LV_USE_BIDI - bool "Support bidirectional texts" - help - Allows mixing Left-to-Right and Right-to-Left texts. - The direction will be processed according to the Unicode Bidirectional Algorithm: - https://www.w3.org/International/articles/inline-bidi-markup/uba-basics - - choice - prompt "Set the default BIDI direction" - default LV_BIDI_DIR_AUTO - depends on LV_USE_BIDI - - config LV_BIDI_DIR_LTR - bool "Left-to-Right" - config LV_BIDI_DIR_RTL - bool "Right-to-Left" - config LV_BIDI_DIR_AUTO - bool "Detect texts base direction" - endchoice - - config LV_USE_ARABIC_PERSIAN_CHARS - bool "Enable Arabic/Persian processing" - help - In these languages characters should be replaced with - an other form based on their position in the text. - endmenu - - menu "Widget usage" - config LV_USE_ARC - bool "Arc." - default y if !LV_CONF_MINIMAL - config LV_USE_BAR - bool "Bar." - default y if !LV_CONF_MINIMAL - config LV_USE_BTN - bool "Button." - default y if !LV_CONF_MINIMAL - config LV_USE_BTNMATRIX - bool "Button matrix." - default y if !LV_CONF_MINIMAL - config LV_USE_CANVAS - bool "Canvas. Dependencies: lv_img." - select LV_USE_IMG - default y if !LV_CONF_MINIMAL - config LV_USE_CHECKBOX - bool "Check Box" - default y if !LV_CONF_MINIMAL - config LV_USE_DROPDOWN - bool "Drop down list. Requires: lv_label." - select LV_USE_LABEL - default y if !LV_CONF_MINIMAL - config LV_USE_IMG - bool "Image. Requires: lv_label." - select LV_USE_LABEL - default y if !LV_CONF_MINIMAL - config LV_USE_LABEL - bool "Label." - default y if !LV_CONF_MINIMAL - config LV_LABEL_TEXT_SELECTION - bool "Enable selecting text of the label." - depends on LV_USE_LABEL - default y - config LV_LABEL_LONG_TXT_HINT - bool "Store extra some info in labels (12 bytes) to speed up drawing of very long texts." - depends on LV_USE_LABEL - default y - config LV_USE_LINE - bool "Line." - default y if !LV_CONF_MINIMAL - config LV_USE_ROLLER - bool "Roller. Requires: lv_label." - select LV_USE_LABEL - default y if !LV_CONF_MINIMAL - config LV_ROLLER_INF_PAGES - int "Number of extra 'pages' when the controller is infinite." - default 7 - depends on LV_USE_ROLLER - config LV_USE_SLIDER - bool "Slider. Requires: lv_bar." - select LV_USE_BAR - default y if !LV_CONF_MINIMAL - config LV_USE_SWITCH - bool "Switch." - default y if !LV_CONF_MINIMAL - config LV_USE_TEXTAREA - bool "Text area. Requires: lv_label." - select LV_USE_LABEL - default y if !LV_CONF_MINIMAL - config LV_TEXTAREA_DEF_PWD_SHOW_TIME - int "Text area def. pwd show time [ms]." - default 1500 - depends on LV_USE_TEXTAREA - config LV_USE_TABLE - bool "Table." - default y if !LV_CONF_MINIMAL - endmenu - - menu "Extra Widgets" - config LV_USE_ANIMIMG - bool "Anim image." - default y if !LV_CONF_MINIMAL - config LV_USE_CALENDAR - bool "Calendar." - default y if !LV_CONF_MINIMAL - config LV_CALENDAR_WEEK_STARTS_MONDAY - bool "Calendar week starts monday." - depends on LV_USE_CALENDAR - config LV_USE_CALENDAR_HEADER_ARROW - bool "Use calendar header arrow" - depends on LV_USE_CALENDAR - default y - config LV_USE_CALENDAR_HEADER_DROPDOWN - bool "Use calendar header dropdown" - depends on LV_USE_CALENDAR - default y - config LV_USE_CHART - bool "Chart." - default y if !LV_CONF_MINIMAL - config LV_USE_COLORWHEEL - bool "Colorwheel." - default y if !LV_CONF_MINIMAL - config LV_USE_IMGBTN - bool "Imgbtn." - default y if !LV_CONF_MINIMAL - config LV_USE_KEYBOARD - bool "Keyboard." - default y if !LV_CONF_MINIMAL - config LV_USE_LED - bool "LED." - default y if !LV_CONF_MINIMAL - config LV_USE_LIST - bool "List." - default y if !LV_CONF_MINIMAL - config LV_USE_MENU - bool "Menu." - default y if !LV_CONF_MINIMAL - config LV_USE_METER - bool "Meter." - default y if !LV_CONF_MINIMAL - config LV_USE_MSGBOX - bool "Msgbox." - default y if !LV_CONF_MINIMAL - config LV_USE_SPAN - bool "span" - default y if !LV_CONF_MINIMAL - config LV_SPAN_SNIPPET_STACK_SIZE - int "Maximum number of span descriptor" - default 64 - depends on LV_USE_SPAN - config LV_USE_SPINBOX - bool "Spinbox." - default y if !LV_CONF_MINIMAL - config LV_USE_SPINNER - bool "Spinner." - default y if !LV_CONF_MINIMAL - config LV_USE_TABVIEW - bool "Tabview." - default y if !LV_CONF_MINIMAL - config LV_USE_TILEVIEW - bool "Tileview" - default y if !LV_CONF_MINIMAL - config LV_USE_WIN - bool "Win" - default y if !LV_CONF_MINIMAL - endmenu - - menu "Themes" - config LV_USE_THEME_DEFAULT - bool "A simple, impressive and very complete theme" - default y if !LV_COLOR_DEPTH_1 && !LV_CONF_MINIMAL - config LV_THEME_DEFAULT_DARK - bool "Yes to set dark mode, No to set light mode" - depends on LV_USE_THEME_DEFAULT - config LV_THEME_DEFAULT_GROW - bool "Enable grow on press" - default y - depends on LV_USE_THEME_DEFAULT - config LV_THEME_DEFAULT_TRANSITION_TIME - int "Default transition time in [ms]" - default 80 - depends on LV_USE_THEME_DEFAULT - config LV_USE_THEME_BASIC - bool "A very simple theme that is a good starting point for a custom theme" - default y if !LV_COLOR_DEPTH_1 && !LV_CONF_MINIMAL - config LV_USE_THEME_MONO - bool "Monochrome theme, suitable for some E-paper & dot matrix displays" - default y if LV_COLOR_DEPTH_1 && !LV_CONF_MINIMAL - endmenu - - menu "Layouts" - config LV_USE_FLEX - bool "A layout similar to Flexbox in CSS." - default y if !LV_CONF_MINIMAL - config LV_USE_GRID - bool "A layout similar to Grid in CSS." - default y if !LV_CONF_MINIMAL - endmenu - - menu "3rd Party Libraries" - config LV_USE_FS_STDIO - bool "File system on top of stdio API" - config LV_FS_STDIO_LETTER - int "Set an upper cased letter on which the drive will accessible (e.g. 'A' i.e. 65 )" - default 0 - depends on LV_USE_FS_STDIO - config LV_FS_STDIO_PATH - string "Set the working directory" - depends on LV_USE_FS_STDIO - config LV_FS_STDIO_CACHE_SIZE - string ">0 to cache this number of bytes in lv_fs_read()" - depends on LV_USE_FS_STDIO - - config LV_USE_FS_POSIX - bool "File system on top of posix API" - config LV_FS_POSIX_LETTER - int "Set an upper cased letter on which the drive will accessible (e.g. 'A' i.e. 65)" - default 0 - depends on LV_USE_FS_POSIX - config LV_FS_POSIX_PATH - string "Set the working directory" - depends on LV_USE_FS_POSIX - config LV_FS_POSIX_CACHE_SIZE - int ">0 to cache this number of bytes in lv_fs_read()" - default 0 - depends on LV_USE_FS_POSIX - - config LV_USE_FS_WIN32 - bool "File system on top of Win32 API" - config LV_FS_WIN32_LETTER - int "Set an upper cased letter on which the drive will accessible (e.g. 'A' i.e. 65)" - default 0 - depends on LV_USE_FS_WIN32 - config LV_FS_WIN32_PATH - string "Set the working directory" - depends on LV_USE_FS_WIN32 - config LV_FS_WIN32_CACHE_SIZE - int ">0 to cache this number of bytes in lv_fs_read()" - default 0 - depends on LV_USE_FS_WIN32 - - config LV_USE_FS_FATFS - bool "File system on top of FatFS" - config LV_FS_FATFS_LETTER - int "Set an upper cased letter on which the drive will accessible (e.g. 'A' i.e. 65)" - default 0 - depends on LV_USE_FS_FATFS - config LV_FS_FATFS_CACHE_SIZE - int ">0 to cache this number of bytes in lv_fs_read()" - default 0 - depends on LV_USE_FS_FATFS - - config LV_USE_PNG - bool "PNG decoder library" - - config LV_USE_BMP - bool "BMP decoder library" - - config LV_USE_SJPG - bool "JPG + split JPG decoder library" - - config LV_USE_GIF - bool "GIF decoder library" - - config LV_USE_QRCODE - bool "QR code library" - - config LV_USE_FREETYPE - bool "FreeType library" - if LV_USE_FREETYPE - menu "FreeType cache config" - config LV_FREETYPE_CACHE_SIZE - int "Memory used by FreeType to cache characters [bytes] (-1: no caching)" - default 16384 - if LV_FREETYPE_CACHE_SIZE >= 0 - config LV_FREETYPE_SBIT_CACHE - bool "enable sbit cache" - default n - config LV_FREETYPE_CACHE_FT_FACES - int "The maximum number of FT_Face(0: use defaults)" - default 0 - config LV_FREETYPE_CACHE_FT_SIZES - int "The maximum number of FT_Size(0: use defaults)" - default 0 - endif - endmenu - endif - - config LV_USE_RLOTTIE - bool "Lottie library" - - config LV_USE_FFMPEG - bool "FFmpeg library" - config LV_FFMPEG_DUMP_FORMAT - bool "Dump format" - depends on LV_USE_FFMPEG - default n - endmenu - - menu "Others" - config LV_USE_SNAPSHOT - bool "Enable API to take snapshot" - default y if !LV_CONF_MINIMAL - - config LV_USE_MONKEY - bool "Enable Monkey test" - default n - - config LV_USE_GRIDNAV - bool "Enable grid navigation" - default n - - config LV_USE_FRAGMENT - bool "Enable lv_obj fragment" - default n - - config LV_USE_IMGFONT - bool "draw img in label or span obj" - default n - - config LV_USE_MSG - bool "Enable a published subscriber based messaging system" - default n - - config LV_USE_IME_PINYIN - bool "Enable Pinyin input method" - default n - config LV_IME_PINYIN_USE_K9_MODE - bool "Enable Pinyin input method 9 key input mode" - depends on LV_USE_IME_PINYIN - default n - config LV_IME_PINYIN_K9_CAND_TEXT_NUM - int "Maximum number of candidate panels for 9-key input mode" - depends on LV_IME_PINYIN_USE_K9_MODE - default 3 - config LV_IME_PINYIN_USE_DEFAULT_DICT - bool "Use built-in Thesaurus" - depends on LV_USE_IME_PINYIN - default y - help - If you do not use the default thesaurus, be sure to use lv_ime_pinyin after setting the thesauruss - config LV_IME_PINYIN_CAND_TEXT_NUM - int "Maximum number of candidate panels" - depends on LV_USE_IME_PINYIN - default 6 - help - Set the maximum number of candidate panels that can be displayed. - This needs to be adjusted according to the size of the screen. - endmenu - - menu "Examples" - config LV_BUILD_EXAMPLES - bool "Enable the examples to be built" - default y if !LV_CONF_MINIMAL - endmenu - - menu "Demos" - config LV_USE_DEMO_WIDGETS - bool "Show some widget" - default n - config LV_DEMO_WIDGETS_SLIDESHOW - bool "Enable slide show" - depends on LV_USE_DEMO_WIDGETS - default n - - config LV_USE_DEMO_KEYPAD_AND_ENCODER - bool "Demonstrate the usage of encoder and keyboard" - default n - - config LV_USE_DEMO_BENCHMARK - bool "Benchmark your system" - default n - config LV_DEMO_BENCHMARK_RGB565A8 - bool "Use RGB565A8 images with 16 bit color depth instead of ARGB8565" - depends on LV_USE_DEMO_BENCHMARK - default n - - config LV_USE_DEMO_STRESS - bool "Stress test for LVGL" - default n - - config LV_USE_DEMO_MUSIC - bool "Music player demo" - default n - config LV_DEMO_MUSIC_SQUARE - bool "Enable Square" - depends on LV_USE_DEMO_MUSIC - default n - config LV_DEMO_MUSIC_LANDSCAPE - bool "Enable Landscape" - depends on LV_USE_DEMO_MUSIC - default n - config LV_DEMO_MUSIC_ROUND - bool "Enable Round" - depends on LV_USE_DEMO_MUSIC - default n - config LV_DEMO_MUSIC_LARGE - bool "Enable Large" - depends on LV_USE_DEMO_MUSIC - default n - config LV_DEMO_MUSIC_AUTO_PLAY - bool "Enable Auto play" - depends on LV_USE_DEMO_MUSIC - default n - endmenu - -endmenu diff --git a/graphics/lvgl/port/lv_port.c b/graphics/lvgl/port/lv_port.c deleted file mode 100644 index c5056d927..000000000 --- a/graphics/lvgl/port/lv_port.c +++ /dev/null @@ -1,91 +0,0 @@ -/**************************************************************************** - * apps/graphics/lvgl/port/lv_port.c - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include "lv_port.h" -#include "lv_port_button.h" -#include "lv_port_encoder.h" -#include "lv_port_fbdev.h" -#include "lv_port_lcddev.h" -#include "lv_port_mem.h" -#include "lv_port_keypad.h" -#include "lv_port_syslog.h" -#include "lv_port_touchpad.h" - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: lv_port_init - * - * Description: - * Initialize all porting. - * - ****************************************************************************/ - -void lv_port_init(void) -{ -#if defined(CONFIG_LV_USE_LOG) - lv_port_syslog_init(); -#endif - -#if defined(CONFIG_LV_PORT_USE_LCDDEV) - lv_port_lcddev_init(NULL, 0); -#endif - -#if defined(CONFIG_LV_PORT_USE_FBDEV) - lv_port_fbdev_init(NULL); -#endif - -#if defined(CONFIG_LV_PORT_USE_BUTTON) - lv_port_button_init(NULL); - -#if defined(CONFIG_UINPUT_BUTTON) - lv_port_button_init("/dev/ubutton"); -#endif - -#endif - -#if defined(CONFIG_LV_PORT_USE_KEYPAD) - lv_port_keypad_init(NULL); - -#if defined(CONFIG_UINPUT_BUTTON) - lv_port_keypad_init("/dev/ubutton"); -#endif - -#endif - -#if defined(CONFIG_LV_PORT_USE_TOUCHPAD) - lv_port_touchpad_init(NULL); - -#if defined(CONFIG_UINPUT_TOUCH) - lv_port_touchpad_init("/dev/utouch"); -#endif - -#endif - -#if defined(CONFIG_LV_PORT_USE_ENCODER) - lv_port_encoder_init(NULL); -#endif -} diff --git a/graphics/lvgl/port/lv_port.h b/graphics/lvgl/port/lv_port.h deleted file mode 100644 index 3b48525b5..000000000 --- a/graphics/lvgl/port/lv_port.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** - * apps/graphics/lvgl/port/lv_port.h - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -#ifndef __APPS_GRAPHICS_LVGL_PORT_LV_PORT_H -#define __APPS_GRAPHICS_LVGL_PORT_LV_PORT_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Type Definitions - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -#ifdef __cplusplus -#define EXTERN extern "C" -extern "C" -{ -#else -#define EXTERN extern -#endif - -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Name: lv_port_init - * - * Description: - * Initialize all porting. - * - ****************************************************************************/ - -void lv_port_init(void); - -#undef EXTERN -#ifdef __cplusplus -} -#endif - -#endif /* __APPS_GRAPHICS_LVGL_PORT_LV_PORT_H */ diff --git a/graphics/lvgl/port/lv_port_button.c b/graphics/lvgl/port/lv_port_button.c deleted file mode 100644 index 7bf215009..000000000 --- a/graphics/lvgl/port/lv_port_button.c +++ /dev/null @@ -1,238 +0,0 @@ -/**************************************************************************** - * apps/graphics/lvgl/port/lv_port_button.c - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include "lv_port_button.h" - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#define BUTTON_0_MAP_X CONFIG_LV_PORT_BUTTON_BUTTON_0_MAP_X -#define BUTTON_0_MAP_Y CONFIG_LV_PORT_BUTTON_BUTTON_0_MAP_Y -#define BUTTON_1_MAP_X CONFIG_LV_PORT_BUTTON_BUTTON_1_MAP_X -#define BUTTON_1_MAP_Y CONFIG_LV_PORT_BUTTON_BUTTON_1_MAP_Y -#define BUTTON_2_MAP_X CONFIG_LV_PORT_BUTTON_BUTTON_2_MAP_X -#define BUTTON_2_MAP_Y CONFIG_LV_PORT_BUTTON_BUTTON_2_MAP_Y -#define BUTTON_3_MAP_X CONFIG_LV_PORT_BUTTON_BUTTON_3_MAP_X -#define BUTTON_3_MAP_Y CONFIG_LV_PORT_BUTTON_BUTTON_3_MAP_Y -#define BUTTON_4_MAP_X CONFIG_LV_PORT_BUTTON_BUTTON_4_MAP_X -#define BUTTON_4_MAP_Y CONFIG_LV_PORT_BUTTON_BUTTON_4_MAP_Y -#define BUTTON_5_MAP_X CONFIG_LV_PORT_BUTTON_BUTTON_5_MAP_X -#define BUTTON_5_MAP_Y CONFIG_LV_PORT_BUTTON_BUTTON_5_MAP_Y - -/**************************************************************************** - * Private Type Declarations - ****************************************************************************/ - -struct button_obj_s -{ - int fd; - uint8_t last_btn; - lv_indev_drv_t indev_drv; -}; - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/* Assign buttons to points on the screen */ - -static const lv_point_t g_button_points_map[6] = -{ - {BUTTON_0_MAP_X, BUTTON_0_MAP_Y}, - {BUTTON_1_MAP_X, BUTTON_1_MAP_Y}, - {BUTTON_2_MAP_X, BUTTON_2_MAP_Y}, - {BUTTON_3_MAP_X, BUTTON_3_MAP_Y}, - {BUTTON_4_MAP_X, BUTTON_4_MAP_Y}, - {BUTTON_5_MAP_X, BUTTON_5_MAP_Y} -}; - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: button_get_pressed_id - ****************************************************************************/ - -static int button_get_pressed_id(int fd) -{ - int btn_act = -1; - btn_buttonset_t buttonset; - const int buttonset_bits = sizeof(btn_buttonset_t) * 8; - int bit; - - int ret = read(fd, &buttonset, sizeof(btn_buttonset_t)); - if (ret < 0) - { - return -1; - } - - for (bit = 0; bit < buttonset_bits; bit++) - { - btn_buttonset_t mask = (btn_buttonset_t)(1 << bit); - - if ((buttonset & mask) != 0) - { - btn_act = bit; - break; - } - } - - return btn_act; -} - -/**************************************************************************** - * Name: button_read - ****************************************************************************/ - -static void button_read(FAR lv_indev_drv_t *drv, FAR lv_indev_data_t *data) -{ - FAR struct button_obj_s *button_obj = drv->user_data; - - /* Get the pressed button's ID */ - - int btn_act = button_get_pressed_id(button_obj->fd); - - if (btn_act >= 0) - { - data->state = LV_INDEV_STATE_PR; - button_obj->last_btn = btn_act; - } - else - { - data->state = LV_INDEV_STATE_REL; - } - - /* Save the last pressed button's ID */ - - data->btn_id = button_obj->last_btn; -} - -/**************************************************************************** - * Name: button_init - ****************************************************************************/ - -static FAR lv_indev_t *button_init(int fd) -{ - FAR struct button_obj_s *button_obj; - FAR lv_indev_t *indev_button; - - button_obj = malloc(sizeof(struct button_obj_s)); - - if (button_obj == NULL) - { - LV_LOG_ERROR("button_obj_s malloc failed"); - return NULL; - } - - button_obj->fd = fd; - button_obj->last_btn = 0; - - lv_indev_drv_init(&(button_obj->indev_drv)); - button_obj->indev_drv.type = LV_INDEV_TYPE_BUTTON; - button_obj->indev_drv.read_cb = button_read; -#if ( LV_USE_USER_DATA != 0 ) - button_obj->indev_drv.user_data = button_obj; -#else -#error LV_USE_USER_DATA must be enabled -#endif - indev_button = lv_indev_drv_register(&(button_obj->indev_drv)); - lv_indev_set_button_points(indev_button, g_button_points_map); - - return indev_button; -} - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: lv_port_button_init - * - * Description: - * Button interface initialization. - * - * Input Parameters: - * dev_path - input device path, set to NULL to use the default path - * - * Returned Value: - * lv_indev object address on success; NULL on failure. - * - ****************************************************************************/ - -FAR lv_indev_t *lv_port_button_init(FAR const char *dev_path) -{ - FAR const char *device_path = dev_path; - FAR lv_indev_t *indev; - int fd; - btn_buttonset_t supported; - int ret; - - if (device_path == NULL) - { - device_path = CONFIG_LV_PORT_BUTTON_DEFAULT_DEVICEPATH; - } - - LV_LOG_INFO("button %s opening", device_path); - fd = open(device_path, O_RDONLY | O_NONBLOCK); - if (fd < 0) - { - LV_LOG_ERROR("button %s open failed: %d", device_path, errno); - return NULL; - } - - /* Get the set of BUTTONs supported */ - - ret = ioctl(fd, BTNIOC_SUPPORTED, - (unsigned long)((uintptr_t)&supported)); - if (ret < 0) - { - LV_LOG_ERROR("button ioctl(BTNIOC_SUPPORTED) failed: %d", errno); - return NULL; - } - - LV_LOG_INFO("button supported BUTTONs 0x%08x", (unsigned int)supported); - - indev = button_init(fd); - - if (indev == NULL) - { - close(fd); - } - - return indev; -} diff --git a/graphics/lvgl/port/lv_port_button.h b/graphics/lvgl/port/lv_port_button.h deleted file mode 100644 index 12bf133e3..000000000 --- a/graphics/lvgl/port/lv_port_button.h +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** - * apps/graphics/lvgl/port/lv_port_button.h - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -#ifndef __APPS_GRAPHICS_LVGL_PORT_LV_PORT_BUTTON_H -#define __APPS_GRAPHICS_LVGL_PORT_LV_PORT_BUTTON_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#if defined(CONFIG_LV_PORT_USE_BUTTON) - -/**************************************************************************** - * Type Definitions - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -#ifdef __cplusplus -#define EXTERN extern "C" -extern "C" -{ -#else -#define EXTERN extern -#endif - -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Name: lv_port_button_init - * - * Description: - * Button interface initialization. - * - * Input Parameters: - * dev_path - input device path, set to NULL to use the default path - * - * Returned Value: - * lv_indev object address on success; NULL on failure. - * - ****************************************************************************/ - -FAR lv_indev_t *lv_port_button_init(FAR const char *dev_path); - -#undef EXTERN -#ifdef __cplusplus -} -#endif - -#endif /* CONFIG_LV_PORT_USE_BUTTON */ - -#endif /* __APPS_GRAPHICS_LVGL_PORT_LV_PORT_BUTTON_H */ diff --git a/graphics/lvgl/port/lv_port_encoder.c b/graphics/lvgl/port/lv_port_encoder.c deleted file mode 100644 index d079b886f..000000000 --- a/graphics/lvgl/port/lv_port_encoder.c +++ /dev/null @@ -1,162 +0,0 @@ -/**************************************************************************** - * apps/graphics/lvgl/port/lv_port_encoder.c - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "lv_port_encoder.h" - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Type Declarations - ****************************************************************************/ - -struct encoder_obj_s -{ - int fd; - lv_indev_state_t last_state; - lv_indev_drv_t indev_drv; -}; - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: encoder_read - ****************************************************************************/ - -static void encoder_read(FAR lv_indev_drv_t *drv, FAR lv_indev_data_t *data) -{ - FAR struct encoder_obj_s *encoder_obj = drv->user_data; - - /* Read one sample */ - - struct mouse_report_s sample; - int16_t wheel = 0; - - int nbytes = read(encoder_obj->fd, &sample, - sizeof(struct mouse_report_s)); - - /* Handle unexpected return values */ - - if (nbytes == sizeof(struct mouse_report_s)) - { - wheel = sample.wheel; - encoder_obj->last_state = (sample.buttons & MOUSE_BUTTON_3) ? - LV_INDEV_STATE_PRESSED : LV_INDEV_STATE_RELEASED; - } - - /* Update encoder data */ - - data->enc_diff = wheel; - data->state = encoder_obj->last_state; -} - -/**************************************************************************** - * Name: encoder_init - ****************************************************************************/ - -static FAR lv_indev_t *encoder_init(int fd) -{ - FAR struct encoder_obj_s *encoder_obj; - encoder_obj = malloc(sizeof(struct encoder_obj_s)); - - if (encoder_obj == NULL) - { - LV_LOG_ERROR("encoder_obj_s malloc failed"); - return NULL; - } - - encoder_obj->fd = fd; - encoder_obj->last_state = LV_INDEV_STATE_RELEASED; - - lv_indev_drv_init(&(encoder_obj->indev_drv)); - encoder_obj->indev_drv.type = LV_INDEV_TYPE_ENCODER; - encoder_obj->indev_drv.read_cb = encoder_read; -#if ( LV_USE_USER_DATA != 0 ) - encoder_obj->indev_drv.user_data = encoder_obj; -#else -#error LV_USE_USER_DATA must be enabled -#endif - return lv_indev_drv_register(&(encoder_obj->indev_drv)); -} - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: lv_port_encoder_init - * - * Description: - * Encoder interface initialization. - * - * Input Parameters: - * dev_path - input device path, set to NULL to use the default path. - * - * Returned Value: - * lv_indev object address on success; NULL on failure. - * - ****************************************************************************/ - -FAR lv_indev_t *lv_port_encoder_init(FAR const char *dev_path) -{ - FAR const char *device_path = dev_path; - FAR lv_indev_t *indev; - int fd; - - if (device_path == NULL) - { - device_path = CONFIG_LV_PORT_ENCODER_DEFAULT_DEVICEPATH; - } - - LV_LOG_INFO("encoder %s opening", device_path); - fd = open(device_path, O_RDONLY | O_NONBLOCK); - if (fd < 0) - { - LV_LOG_ERROR("encoder %s open failed: %d", device_path, errno); - return NULL; - } - - LV_LOG_INFO("encoder %s open success", device_path); - - indev = encoder_init(fd); - - if (indev == NULL) - { - close(fd); - } - - return indev; -} diff --git a/graphics/lvgl/port/lv_port_encoder.h b/graphics/lvgl/port/lv_port_encoder.h deleted file mode 100644 index 89465298f..000000000 --- a/graphics/lvgl/port/lv_port_encoder.h +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** - * apps/graphics/lvgl/port/lv_port_encoder.h - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -#ifndef __APPS_GRAPHICS_LVGL_PORT_LV_PORT_ENCODER_H -#define __APPS_GRAPHICS_LVGL_PORT_LV_PORT_ENCODER_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#if defined(CONFIG_LV_PORT_USE_ENCODER) - -/**************************************************************************** - * Type Definitions - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -#ifdef __cplusplus -#define EXTERN extern "C" -extern "C" -{ -#else -#define EXTERN extern -#endif - -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Name: lv_port_encoder_init - * - * Description: - * Encoder interface initialization. - * - * Input Parameters: - * dev_path - input device path, set to NULL to use the default path. - * - * Returned Value: - * lv_indev object address on success; NULL on failure. - * - ****************************************************************************/ - -FAR lv_indev_t *lv_port_encoder_init(FAR const char *dev_path); - -#undef EXTERN -#ifdef __cplusplus -} -#endif - -#endif /* CONFIG_LV_PORT_USE_ENCODER */ - -#endif /* __APPS_GRAPHICS_LVGL_PORT_LV_PORT_ENCODER_H */ diff --git a/graphics/lvgl/port/lv_port_fbdev.c b/graphics/lvgl/port/lv_port_fbdev.c deleted file mode 100644 index 38eeda3c7..000000000 --- a/graphics/lvgl/port/lv_port_fbdev.c +++ /dev/null @@ -1,675 +0,0 @@ -/**************************************************************************** - * apps/graphics/lvgl/port/lv_port_fbdev.c - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "lv_port_fbdev.h" - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#if defined(CONFIG_FB_UPDATE) -# define FBDEV_UPDATE_AREA(obj, area) fbdev_update_area(obj, area) -#else -# define FBDEV_UPDATE_AREA(obj, area) -#endif - -/**************************************************************************** - * Private Type Declarations - ****************************************************************************/ - -struct fbdev_obj_s -{ - lv_disp_draw_buf_t disp_draw_buf; - lv_disp_drv_t disp_drv; - FAR lv_disp_t *disp; - FAR void *last_buffer; - FAR void *act_buffer; - lv_area_t inv_areas[LV_INV_BUF_SIZE]; - uint16_t inv_areas_len; - lv_area_t final_area; - - int fd; - FAR void *fbmem; - uint32_t fbmem2_yoffset; - struct fb_videoinfo_s vinfo; - struct fb_planeinfo_s pinfo; - - bool double_buffer; -}; - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -#if defined(CONFIG_FB_UPDATE) - -/**************************************************************************** - * Name: fbdev_update_area - ****************************************************************************/ - -static void fbdev_update_area(FAR struct fbdev_obj_s *fbdev_obj, - FAR const lv_area_t *area_p) -{ - struct fb_area_s fb_area; - - fb_area.x = area_p->x1; - fb_area.y = area_p->y1; - fb_area.w = area_p->x2 - area_p->x1 + 1; - fb_area.h = area_p->y2 - area_p->y1 + 1; - - LV_LOG_TRACE("area: (%d, %d) %d x %d", - fb_area.x, fb_area.y, fb_area.w, fb_area.h); - - ioctl(fbdev_obj->fd, FBIO_UPDATE, - (unsigned long)((uintptr_t)&fb_area)); - - LV_LOG_TRACE("finished"); -} -#endif - -/**************************************************************************** - * Name: fbdev_switch_buffer - ****************************************************************************/ - -static void fbdev_switch_buffer(FAR struct fbdev_obj_s *fbdev_obj) -{ - FAR lv_disp_t *disp_refr = fbdev_obj->disp; - uint16_t inv_index; - - /* check inv_areas_len, it must == 0 */ - - if (fbdev_obj->inv_areas_len != 0) - { - LV_LOG_ERROR("Repeated flush action detected! " - "inv_areas_len(%d) != 0", - fbdev_obj->inv_areas_len); - fbdev_obj->inv_areas_len = 0; - } - - /* Save dirty area table for next synchronizationn */ - - for (inv_index = 0; inv_index < disp_refr->inv_p; inv_index++) - { - if (disp_refr->inv_area_joined[inv_index] == 0) - { - fbdev_obj->inv_areas[fbdev_obj->inv_areas_len] = - disp_refr->inv_areas[inv_index]; - fbdev_obj->inv_areas_len++; - } - } - - /* Save the buffer address for the next synchronization */ - - fbdev_obj->last_buffer = fbdev_obj->act_buffer; - - LV_LOG_TRACE("Commit buffer = %p, yoffset = %" PRIu32, - fbdev_obj->act_buffer, - fbdev_obj->pinfo.yoffset); - - if (fbdev_obj->act_buffer == fbdev_obj->fbmem) - { - fbdev_obj->pinfo.yoffset = 0; - fbdev_obj->act_buffer = fbdev_obj->fbmem - + fbdev_obj->fbmem2_yoffset * fbdev_obj->pinfo.stride; - } - else - { - fbdev_obj->pinfo.yoffset = fbdev_obj->fbmem2_yoffset; - fbdev_obj->act_buffer = fbdev_obj->fbmem; - } - - /* Commit buffer to fb driver */ - - ioctl(fbdev_obj->fd, FBIOPAN_DISPLAY, - (unsigned long)((uintptr_t)&(fbdev_obj->pinfo))); - - LV_LOG_TRACE("finished"); -} - -#if defined(CONFIG_FB_SYNC) - -/**************************************************************************** - * Name: fbdev_disp_vsync_refr - ****************************************************************************/ - -static void fbdev_disp_vsync_refr(FAR lv_timer_t *timer) -{ - int ret; - FAR struct fbdev_obj_s *fbdev_obj = timer->user_data; - - LV_LOG_TRACE("Check vsync..."); - - ret = ioctl(fbdev_obj->fd, FBIO_WAITFORVSYNC, NULL); - if (ret != OK) - { - LV_LOG_TRACE("No vsync signal detect"); - return; - } - - LV_LOG_TRACE("Refresh start"); - - _lv_disp_refr_timer(NULL); -} - -#endif /* CONFIG_FB_SYNC */ - -/**************************************************************************** - * Name: fbdev_check_inv_area_covered - ****************************************************************************/ - -static bool fbdev_check_inv_area_covered(FAR lv_disp_t *disp_refr, - FAR const lv_area_t *area_p) -{ - int i; - - for (i = 0; i < disp_refr->inv_p; i++) - { - FAR const lv_area_t *cur_area; - - /* Skip joined area */ - - if (disp_refr->inv_area_joined[i]) - { - continue; - } - - cur_area = &disp_refr->inv_areas[i]; - - /* Check cur_area is coverd area_p */ - - if (_lv_area_is_in(area_p, cur_area, 0)) - { - return true; - } - } - - return false; -} - -/**************************************************************************** - * Name: fbdev_render_start - ****************************************************************************/ - -static void fbdev_render_start(FAR lv_disp_drv_t *disp_drv) -{ - FAR struct fbdev_obj_s *fbdev_obj = disp_drv->user_data; - FAR lv_disp_t *disp_refr; - FAR lv_draw_ctx_t *draw_ctx; - lv_coord_t hor_res; - int i; - - /* No need sync buffer when inv_areas_len == 0 */ - - if (fbdev_obj->inv_areas_len == 0) - { - LV_LOG_TRACE("No sync area"); - return; - } - - LV_LOG_TRACE("Start sync %d areas...", fbdev_obj->inv_areas_len); - - disp_refr = _lv_refr_get_disp_refreshing(); - draw_ctx = disp_drv->draw_ctx; - hor_res = disp_drv->hor_res; - - for (i = 0; i < fbdev_obj->inv_areas_len; i++) - { - FAR const lv_area_t *last_area = &fbdev_obj->inv_areas[i]; - - LV_LOG_TRACE("Check area[%d]: (%d, %d) %d x %d", - i, - (int)last_area->x1, (int)last_area->y1, - (int)lv_area_get_width(last_area), - (int)lv_area_get_height(last_area)); - - if (fbdev_check_inv_area_covered(disp_refr, last_area)) - { - LV_LOG_TRACE("Skipped"); - continue; - } - - /* Sync the inv area of ​​the previous frame */ - - draw_ctx->buffer_copy( - draw_ctx, - fbdev_obj->act_buffer, hor_res, last_area, - fbdev_obj->last_buffer, hor_res, last_area); - - LV_LOG_TRACE("Copied"); - } - - fbdev_obj->inv_areas_len = 0; -} - -/**************************************************************************** - * Name: fbdev_flush_direct - ****************************************************************************/ - -static void fbdev_flush_direct(FAR lv_disp_drv_t *disp_drv, - FAR const lv_area_t *area_p, - FAR lv_color_t *color_p) -{ - FAR struct fbdev_obj_s *fbdev_obj = disp_drv->user_data; - - /* Commit the buffer after the last flush */ - - if (!lv_disp_flush_is_last(disp_drv)) - { - lv_disp_flush_ready(disp_drv); - return; - } - - fbdev_switch_buffer(fbdev_obj); - - FBDEV_UPDATE_AREA(fbdev_obj, area_p); - - /* Tell the flushing is ready */ - - lv_disp_flush_ready(disp_drv); -} - -/**************************************************************************** - * Name: fbdev_update_part - ****************************************************************************/ - -static void fbdev_update_part(FAR struct fbdev_obj_s *fbdev_obj, - FAR lv_disp_drv_t *disp_drv, - FAR const lv_area_t *area_p) -{ - FAR lv_area_t *final_area = &fbdev_obj->final_area; - - if (final_area->x1 < 0) - { - *final_area = *area_p; - } - else - { - _lv_area_join(final_area, final_area, area_p); - } - - if (!lv_disp_flush_is_last(disp_drv)) - { - lv_disp_flush_ready(disp_drv); - return; - } - - if (fbdev_obj->double_buffer) - { - fbdev_switch_buffer(fbdev_obj); - } - - FBDEV_UPDATE_AREA(fbdev_obj, final_area); - - /* Mark it is invalid */ - - final_area->x1 = -1; - - /* Tell the flushing is ready */ - - lv_disp_flush_ready(disp_drv); -} - -/**************************************************************************** - * Name: fbdev_flush_normal - ****************************************************************************/ - -static void fbdev_flush_normal(FAR lv_disp_drv_t *disp_drv, - FAR const lv_area_t *area_p, - FAR lv_color_t *color_p) -{ - FAR struct fbdev_obj_s *fbdev_obj = disp_drv->user_data; - - int x1 = area_p->x1; - int y1 = area_p->y1; - int y2 = area_p->y2; - int y; - int w = lv_area_get_width(area_p); - - FAR lv_color_t *fbp = fbdev_obj->act_buffer; - fb_coord_t fb_xres = fbdev_obj->vinfo.xres; - int hor_size = w * sizeof(lv_color_t); - FAR lv_color_t *cur_pos = fbp + y1 * fb_xres + x1; - - LV_LOG_TRACE("start copy"); - - for (y = y1; y <= y2; y++) - { - lv_memcpy(cur_pos, color_p, hor_size); - cur_pos += fb_xres; - color_p += w; - } - - LV_LOG_TRACE("end copy"); - - fbdev_update_part(fbdev_obj, disp_drv, area_p); -} - -/**************************************************************************** - * Name: fbdev_get_pinfo - ****************************************************************************/ - -static int fbdev_get_pinfo(int fd, FAR struct fb_planeinfo_s *pinfo) -{ - int ret = ioctl(fd, FBIOGET_PLANEINFO, - (unsigned long)((uintptr_t)pinfo)); - if (ret < 0) - { - LV_LOG_ERROR("ERROR: ioctl(FBIOGET_PLANEINFO) failed: %d", errno); - return ret; - } - - LV_LOG_INFO("PlaneInfo (plane %d):", pinfo->display); - LV_LOG_INFO(" fbmem: %p", pinfo->fbmem); - LV_LOG_INFO(" fblen: %lu", (unsigned long)pinfo->fblen); - LV_LOG_INFO(" stride: %u", pinfo->stride); - LV_LOG_INFO(" display: %u", pinfo->display); - LV_LOG_INFO(" bpp: %u", pinfo->bpp); - - /* Only these pixel depths are supported. viinfo.fmt is ignored, only - * certain color formats are supported. - */ - - if (pinfo->bpp != 32 && pinfo->bpp != 16 && - pinfo->bpp != 8 && pinfo->bpp != 1) - { - LV_LOG_ERROR("bpp = %u not supported", pinfo->bpp); - return -1; - } - - return 0; -} - -/**************************************************************************** - * Name: fbdev_try_init_fbmem2 - ****************************************************************************/ - -static int fbdev_try_init_fbmem2(FAR struct fbdev_obj_s *state) -{ - uintptr_t buf_offset; - struct fb_planeinfo_s pinfo; - - memset(&pinfo, 0, sizeof(pinfo)); - - /* Get display[1] planeinfo */ - - pinfo.display = state->pinfo.display + 1; - - if (fbdev_get_pinfo(state->fd, &pinfo) < 0) - { - return -1; - } - - /* check display and match bpp */ - - if (!(pinfo.display != state->pinfo.display - && pinfo.bpp == state->pinfo.bpp)) - { - LV_LOG_INFO("fbmem2 is incorrect"); - return -1; - } - - /* Check the buffer address offset, - * It needs to be divisible by pinfo.stride - */ - - buf_offset = pinfo.fbmem - state->fbmem; - - if ((buf_offset % state->pinfo.stride) != 0) - { - LV_LOG_ERROR("The buf_offset(%" PRIuPTR ") is incorrect," - " it needs to be divisible" - " by pinfo.stride(%d)", - buf_offset, state->pinfo.stride); - return -1; - } - - /* Enable double buffer mode */ - - state->double_buffer = true; - state->fbmem2_yoffset = buf_offset / state->pinfo.stride; - - LV_LOG_INFO("Use non-consecutive fbmem2 = %p, yoffset = %" PRIu32, - pinfo.fbmem, state->fbmem2_yoffset); - - return 0; -} - -/**************************************************************************** - * Name: fbdev_init - ****************************************************************************/ - -static FAR lv_disp_t *fbdev_init(FAR struct fbdev_obj_s *state) -{ - FAR struct fbdev_obj_s *fbdev_obj = malloc(sizeof(struct fbdev_obj_s)); - FAR lv_disp_drv_t *disp_drv; - int fb_xres = state->vinfo.xres; - int fb_yres = state->vinfo.yres; - size_t fb_size = fb_xres * fb_yres; - FAR lv_color_t *buf1 = NULL; - FAR lv_color_t *buf2 = NULL; - - if (fbdev_obj == NULL) - { - LV_LOG_ERROR("fbdev_obj_s malloc failed"); - return NULL; - } - - *fbdev_obj = *state; - disp_drv = &(fbdev_obj->disp_drv); - - lv_disp_drv_init(disp_drv); - disp_drv->draw_buf = &(fbdev_obj->disp_draw_buf); - disp_drv->screen_transp = false; - disp_drv->user_data = fbdev_obj; - disp_drv->hor_res = fb_xres; - disp_drv->ver_res = fb_yres; - - if (fbdev_obj->double_buffer) - { - LV_LOG_INFO("Double buffer mode"); - - buf1 = fbdev_obj->fbmem; - buf2 = fbdev_obj->fbmem - + fbdev_obj->fbmem2_yoffset * fbdev_obj->pinfo.stride; - - disp_drv->direct_mode = true; - disp_drv->flush_cb = fbdev_flush_direct; - disp_drv->render_start_cb = fbdev_render_start; - } - else - { - LV_LOG_INFO("Single buffer mode"); - - buf1 = malloc(fb_size * sizeof(lv_color_t)); - LV_ASSERT_MALLOC(buf1); - - if (!buf1) - { - LV_LOG_ERROR("failed to malloc draw buffer"); - goto failed; - } - - disp_drv->flush_cb = fbdev_flush_normal; - } - - lv_disp_draw_buf_init(&(fbdev_obj->disp_draw_buf), buf1, buf2, fb_size); - fbdev_obj->act_buffer = fbdev_obj->fbmem; - fbdev_obj->disp = lv_disp_drv_register(&(fbdev_obj->disp_drv)); - -#if defined(CONFIG_FB_SYNC) - /* If double buffer and vsync is supported, use active refresh method */ - - if (fbdev_obj->disp_drv.direct_mode) - { - FAR lv_timer_t *refr_timer = _lv_disp_get_refr_timer(fbdev_obj->disp); - lv_timer_del(refr_timer); - fbdev_obj->disp->refr_timer = NULL; - lv_timer_create(fbdev_disp_vsync_refr, 1, fbdev_obj); - } -#endif - - return fbdev_obj->disp; - -failed: - free(fbdev_obj); - return NULL; -} - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: lv_port_fbdev_init - * - * Description: - * Framebuffer device interface initialization. - * - * Input Parameters: - * dev_path - Framebuffer device path, set to NULL to use the default path. - * - * Returned Value: - * lv_disp object address on success; NULL on failure. - * - ****************************************************************************/ - -FAR lv_disp_t *lv_port_fbdev_init(FAR const char *dev_path) -{ - FAR const char *device_path = dev_path; - struct fbdev_obj_s state; - int ret; - FAR lv_disp_t *disp; - - memset(&state, 0, sizeof(state)); - - if (device_path == NULL) - { - device_path = CONFIG_LV_PORT_FBDEV_DEFAULT_DEVICEPATH; - } - - LV_LOG_INFO("fbdev %s opening", device_path); - - state.fd = open(device_path, O_RDWR); - if (state.fd < 0) - { - LV_LOG_ERROR("fbdev %s open failed: %d", device_path, errno); - return NULL; - } - - /* Get the characteristics of the framebuffer */ - - ret = ioctl(state.fd, FBIOGET_VIDEOINFO, - (unsigned long)((uintptr_t)&state.vinfo)); - if (ret < 0) - { - LV_LOG_ERROR("ioctl(FBIOGET_VIDEOINFO) failed: %d", errno); - close(state.fd); - return NULL; - } - - LV_LOG_INFO("VideoInfo:"); - LV_LOG_INFO(" fmt: %u", state.vinfo.fmt); - LV_LOG_INFO(" xres: %u", state.vinfo.xres); - LV_LOG_INFO(" yres: %u", state.vinfo.yres); - LV_LOG_INFO(" nplanes: %u", state.vinfo.nplanes); - - ret = fbdev_get_pinfo(state.fd, &state.pinfo); - - if (ret < 0) - { - close(state.fd); - return NULL; - } - - /* Check color depth */ - - if (!(state.pinfo.bpp == LV_COLOR_DEPTH || - (state.pinfo.bpp == 24 && LV_COLOR_DEPTH == 32))) - { - LV_LOG_ERROR("fbdev bpp = %d, LV_COLOR_DEPTH = %d, " - "color depth does not match.", - state.pinfo.bpp, LV_COLOR_DEPTH); - close(state.fd); - return NULL; - } - - state.double_buffer = (state.pinfo.yres_virtual == (state.vinfo.yres * 2)); - - /* mmap() the framebuffer. - * - * NOTE: In the FLAT build the frame buffer address returned by the - * FBIOGET_PLANEINFO IOCTL command will be the same as the framebuffer - * address. mmap(), however, is the preferred way to get the framebuffer - * address because in the KERNEL build, it will perform the necessary - * address mapping to make the memory accessible to the application. - */ - - state.fbmem = mmap(NULL, state.pinfo.fblen, PROT_READ | PROT_WRITE, - MAP_SHARED | MAP_FILE, state.fd, 0); - if (state.fbmem == MAP_FAILED) - { - LV_LOG_ERROR("ioctl(FBIOGET_PLANEINFO) failed: %d", errno); - close(state.fd); - return NULL; - } - - LV_LOG_INFO("Mapped FB: %p", state.fbmem); - - if (state.double_buffer) - { - state.fbmem2_yoffset = state.vinfo.yres; - } - else - { - fbdev_try_init_fbmem2(&state); - } - - disp = fbdev_init(&state); - - if (!disp) - { - munmap(state.fbmem, state.pinfo.fblen); - close(state.fd); - return NULL; - } - - return disp; -} diff --git a/graphics/lvgl/port/lv_port_fbdev.h b/graphics/lvgl/port/lv_port_fbdev.h deleted file mode 100644 index 8bb47c353..000000000 --- a/graphics/lvgl/port/lv_port_fbdev.h +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** - * apps/graphics/lvgl/port/lv_port_fbdev.h - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -#ifndef __APPS_GRAPHICS_LVGL_PORT_LV_PORT_FBDEV_H -#define __APPS_GRAPHICS_LVGL_PORT_LV_PORT_FBDEV_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#if defined(CONFIG_LV_PORT_USE_FBDEV) - -/**************************************************************************** - * Type Definitions - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -#ifdef __cplusplus -#define EXTERN extern "C" -extern "C" -{ -#else -#define EXTERN extern -#endif - -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Name: lv_port_fbdev_init - * - * Description: - * Framebuffer device interface initialization. - * - * Input Parameters: - * dev_path - Framebuffer device path, set to NULL to use the default path. - * - * Returned Value: - * lv_disp object address on success; NULL on failure. - * - ****************************************************************************/ - -FAR lv_disp_t *lv_port_fbdev_init(FAR const char *dev_path); - -#undef EXTERN -#ifdef __cplusplus -} -#endif - -#endif /* CONFIG_LV_PORT_USE_FBDEV */ - -#endif /* __APPS_GRAPHICS_LVGL_PORT_LV_PORT_FBDEV_H */ diff --git a/graphics/lvgl/port/lv_port_keypad.c b/graphics/lvgl/port/lv_port_keypad.c deleted file mode 100644 index e80f6d774..000000000 --- a/graphics/lvgl/port/lv_port_keypad.c +++ /dev/null @@ -1,252 +0,0 @@ -/**************************************************************************** - * apps/graphics/lvgl/port/lv_port_keypad.c - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "lv_port_keypad.h" - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#define LV_KEY_UP_MAP_BIT CONFIG_LV_PORT_KEYPAD_KEY_UP_MAP_BIT -#define LV_KEY_DOWN_MAP_BIT CONFIG_LV_PORT_KEYPAD_KEY_DOWN_MAP_BIT -#define LV_KEY_RIGHT_MAP_BIT CONFIG_LV_PORT_KEYPAD_KEY_RIGHT_MAP_BIT -#define LV_KEY_LEFT_MAP_BIT CONFIG_LV_PORT_KEYPAD_KEY_LEFT_MAP_BIT - -#define LV_KEY_ESC_MAP_BIT CONFIG_LV_PORT_KEYPAD_KEY_ESC_MAP_BIT -#define LV_KEY_DEL_MAP_BIT CONFIG_LV_PORT_KEYPAD_KEY_DEL_MAP_BIT -#define LV_KEY_BACKSPACE_MAP_BIT CONFIG_LV_PORT_KEYPAD_KEY_BACKSPACE_MAP_BIT -#define LV_KEY_ENTER_MAP_BIT CONFIG_LV_PORT_KEYPAD_KEY_ENTER_MAP_BIT - -#define LV_KEY_NEXT_MAP_BIT CONFIG_LV_PORT_KEYPAD_KEY_NEXT_MAP_BIT -#define LV_KEY_PREV_MAP_BIT CONFIG_LV_PORT_KEYPAD_KEY_PREV_MAP_BIT -#define LV_KEY_HOME_MAP_BIT CONFIG_LV_PORT_KEYPAD_KEY_HOME_MAP_BIT -#define LV_KEY_END_MAP_BIT CONFIG_LV_PORT_KEYPAD_KEY_END_MAP_BIT - -/**************************************************************************** - * Private Type Declarations - ****************************************************************************/ - -struct keypad_map_s -{ - const lv_key_t key; - int bit; -}; - -struct keypad_obj_s -{ - int fd; - uint32_t last_key; - lv_indev_drv_t indev_drv; -}; - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -static const struct keypad_map_s g_keypad_map[] = -{ - {LV_KEY_UP, LV_KEY_UP_MAP_BIT}, - {LV_KEY_DOWN, LV_KEY_DOWN_MAP_BIT}, - {LV_KEY_RIGHT, LV_KEY_RIGHT_MAP_BIT}, - {LV_KEY_LEFT, LV_KEY_LEFT_MAP_BIT}, - {LV_KEY_ESC, LV_KEY_ESC_MAP_BIT}, - {LV_KEY_DEL, LV_KEY_DEL_MAP_BIT}, - {LV_KEY_BACKSPACE, LV_KEY_BACKSPACE_MAP_BIT}, - {LV_KEY_ENTER, LV_KEY_ENTER_MAP_BIT}, - {LV_KEY_NEXT, LV_KEY_NEXT_MAP_BIT}, - {LV_KEY_PREV, LV_KEY_PREV_MAP_BIT}, - {LV_KEY_HOME, LV_KEY_HOME_MAP_BIT}, - {LV_KEY_END, LV_KEY_END_MAP_BIT} -}; - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: keypad_get_key - ****************************************************************************/ - -static uint32_t keypad_get_key(int fd) -{ - uint32_t act_key = 0; - btn_buttonset_t buttonset; - const int buttonset_bits = sizeof(btn_buttonset_t) * 8; - int i; - - int ret = read(fd, &buttonset, sizeof(btn_buttonset_t)); - if (ret < 0) - { - return 0; - } - - for (i = 0; i < nitems(g_keypad_map); i++) - { - int bit = g_keypad_map[i].bit; - - if (bit >= 0 && bit < buttonset_bits) - { - btn_buttonset_t mask = (btn_buttonset_t)(1 << bit); - if ((buttonset & mask) != 0) - { - act_key = g_keypad_map[i].key; - break; - } - } - } - - return act_key; -} - -/**************************************************************************** - * Name: keypad_read - ****************************************************************************/ - -static void keypad_read(FAR lv_indev_drv_t *drv, FAR lv_indev_data_t *data) -{ - FAR struct keypad_obj_s *keypad_obj = drv->user_data; - - /* Get whether the a key is pressed and save the pressed key */ - - uint32_t act_key = keypad_get_key(keypad_obj->fd); - - if (act_key != 0) - { - data->state = LV_INDEV_STATE_PR; - keypad_obj->last_key = act_key; - } - else - { - data->state = LV_INDEV_STATE_REL; - } - - data->key = keypad_obj->last_key; -} - -/**************************************************************************** - * Name: keypad_init - ****************************************************************************/ - -static FAR lv_indev_t *keypad_init(int fd) -{ - FAR struct keypad_obj_s *keypad_obj; - keypad_obj = malloc(sizeof(struct keypad_obj_s)); - - if (keypad_obj == NULL) - { - LV_LOG_ERROR("keypad_obj_s malloc failed"); - return NULL; - } - - keypad_obj->fd = fd; - keypad_obj->last_key = 0; - - /* Register a keypad input device */ - - lv_indev_drv_init(&(keypad_obj->indev_drv)); - keypad_obj->indev_drv.type = LV_INDEV_TYPE_KEYPAD; - keypad_obj->indev_drv.read_cb = keypad_read; -#if ( LV_USE_USER_DATA != 0 ) - keypad_obj->indev_drv.user_data = keypad_obj; -#else -#error LV_USE_USER_DATA must be enabled -#endif - return lv_indev_drv_register(&(keypad_obj->indev_drv)); -} - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: lv_port_keypad_init - * - * Description: - * Keypad interface initialization. - * - * Input Parameters: - * dev_path - input device path, set to NULL to use the default path - * - * Returned Value: - * lv_indev object address on success; NULL on failure. - * - ****************************************************************************/ - -FAR lv_indev_t *lv_port_keypad_init(FAR const char *dev_path) -{ - FAR const char *device_path = dev_path; - FAR lv_indev_t *indev; - int fd; - int ret; - btn_buttonset_t supported; - - if (device_path == NULL) - { - device_path = CONFIG_LV_PORT_KEYPAD_DEFAULT_DEVICEPATH; - } - - LV_LOG_INFO("keypad %s opening", device_path); - fd = open(device_path, O_RDONLY | O_NONBLOCK); - if (fd < 0) - { - LV_LOG_ERROR("keypad %s open failed: %d", device_path, errno); - return NULL; - } - - /* Get the set of BUTTONs supported */ - - ret = ioctl(fd, BTNIOC_SUPPORTED, - (unsigned long)((uintptr_t)&supported)); - if (ret < 0) - { - LV_LOG_ERROR("button ioctl(BTNIOC_SUPPORTED) failed: %d", - errno); - return NULL; - } - - LV_LOG_INFO("button supported BUTTONs 0x%08x", (unsigned int)supported); - - indev = keypad_init(fd); - - if (indev == NULL) - { - close(fd); - } - - return indev; -} diff --git a/graphics/lvgl/port/lv_port_keypad.h b/graphics/lvgl/port/lv_port_keypad.h deleted file mode 100644 index d7be5158a..000000000 --- a/graphics/lvgl/port/lv_port_keypad.h +++ /dev/null @@ -1,76 +0,0 @@ -/**************************************************************************** - * apps/graphics/lvgl/port/lv_port_keypad.h - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -#ifndef __APPS_GRAPHICS_LVGL_PORT_LV_PORT_KEYPAD_H -#define __APPS_GRAPHICS_LVGL_PORT_LV_PORT_KEYPAD_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#if defined(CONFIG_LV_PORT_USE_KEYPAD) - -/**************************************************************************** - * Type Definitions - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -#ifdef __cplusplus -#define EXTERN extern "C" -extern "C" -{ -#else -#define EXTERN extern -#endif - -/**************************************************************************** - * Name: lv_port_keypad_init - * - * Description: - * Keypad interface initialization. - * - * Input Parameters: - * dev_path - input device path, set to NULL to use the default path - * - * Returned Value: - * lv_indev object address on success; NULL on failure. - * - ****************************************************************************/ - -FAR lv_indev_t *lv_port_keypad_init(FAR const char *dev_path); - -#undef EXTERN -#ifdef __cplusplus -} -#endif - -#endif /* CONFIG_LV_PORT_USE_KEYPAD */ - -#endif /* __APPS_GRAPHICS_LVGL_PORT_LV_PORT_KEYPAD_H */ diff --git a/graphics/lvgl/port/lv_port_lcddev.c b/graphics/lvgl/port/lv_port_lcddev.c deleted file mode 100644 index 91efa3c51..000000000 --- a/graphics/lvgl/port/lv_port_lcddev.c +++ /dev/null @@ -1,304 +0,0 @@ -/**************************************************************************** - * apps/graphics/lvgl/port/lv_port_lcddev.c - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "lv_port_lcddev.h" - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Type Declarations - ****************************************************************************/ - -struct lcddev_obj_s -{ - int fd; - lv_disp_draw_buf_t disp_draw_buf; - lv_disp_drv_t disp_drv; - struct lcddev_area_s area; - - pthread_t write_thread; - sem_t flush_sem; - sem_t wait_sem; -}; - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: lcddev_wait - ****************************************************************************/ - -static void lcddev_wait(FAR lv_disp_drv_t *disp_drv) -{ - FAR struct lcddev_obj_s *lcddev_obj = disp_drv->user_data; - - sem_wait(&(lcddev_obj->wait_sem)); - - /* Tell the flushing is ready */ - - lv_disp_flush_ready(disp_drv); -} - -/**************************************************************************** - * Name: lcddev_update_thread - ****************************************************************************/ - -static FAR void *lcddev_update_thread(FAR void *arg) -{ - int ret = OK; - int errcode = 0; - FAR struct lcddev_obj_s *lcddev_obj = arg; - - while (ret == OK) - { - sem_wait(&lcddev_obj->flush_sem); - - ret = ioctl(lcddev_obj->fd, LCDDEVIO_PUTAREA, - (unsigned long)&(lcddev_obj->area)); - if (ret < 0) - { - errcode = errno; - } - - sem_post(&lcddev_obj->wait_sem); - } - - LV_LOG_ERROR("ioctl(LCDDEVIO_PUTAREA) failed: %d", errcode); - close(lcddev_obj->fd); - lcddev_obj->fd = -1; - - return NULL; -} - -/**************************************************************************** - * Name: lcddev_flush - ****************************************************************************/ - -static void lcddev_flush(FAR lv_disp_drv_t *disp_drv, - FAR const lv_area_t *area_p, - FAR lv_color_t *color_p) -{ - FAR struct lcddev_obj_s *lcddev_obj = disp_drv->user_data; - - lcddev_obj->area.row_start = area_p->y1; - lcddev_obj->area.row_end = area_p->y2; - lcddev_obj->area.col_start = area_p->x1; - lcddev_obj->area.col_end = area_p->x2; - lcddev_obj->area.data = (FAR uint8_t *)color_p; - - sem_post(&lcddev_obj->flush_sem); -} - -/**************************************************************************** - * Name: lcddev_init - ****************************************************************************/ - -static FAR lv_disp_t *lcddev_init(int fd, - int hor_res, - int ver_res, - int line_buf) -{ - FAR lv_color_t *buf1 = NULL; - FAR lv_color_t *buf2 = NULL; - FAR struct lcddev_obj_s *lcddev_obj; - const size_t buf_size = hor_res * line_buf * sizeof(lv_color_t); - lcddev_obj = malloc(sizeof(struct lcddev_obj_s)); - - if (lcddev_obj == NULL) - { - LV_LOG_ERROR("lcddev_obj_s malloc failed"); - return NULL; - } - - memset(lcddev_obj, 0, sizeof(struct lcddev_obj_s)); - - buf1 = malloc(buf_size); - if (buf1 == NULL) - { - LV_LOG_ERROR("display buf1 malloc failed"); - free(lcddev_obj); - return NULL; - } - -#ifdef CONFIG_LV_PORT_LCDDEV_DOUBLE_BUFFER - buf2 = malloc(buf_size); - if (buf2 == NULL) - { - LV_LOG_ERROR("display buf2 malloc failed"); - free(lcddev_obj); - free(buf1); - return NULL; - } -#endif - - LV_LOG_INFO("display buffer malloc success, buf size = %lu", buf_size); - - lcddev_obj->fd = fd; - - lv_disp_draw_buf_init(&(lcddev_obj->disp_draw_buf), buf1, buf2, - hor_res * line_buf); - - lv_disp_drv_init(&(lcddev_obj->disp_drv)); - lcddev_obj->disp_drv.flush_cb = lcddev_flush; - lcddev_obj->disp_drv.draw_buf = &(lcddev_obj->disp_draw_buf); - lcddev_obj->disp_drv.hor_res = hor_res; - lcddev_obj->disp_drv.ver_res = ver_res; - lcddev_obj->disp_drv.screen_transp = false; -#if ( LV_USE_USER_DATA != 0 ) - lcddev_obj->disp_drv.user_data = lcddev_obj; -#else -#error LV_USE_USER_DATA must be enabled -#endif - lcddev_obj->disp_drv.wait_cb = lcddev_wait; - - /* Initialize the mutexes for buffer flushing synchronization */ - - sem_init(&lcddev_obj->flush_sem, 0, 0); - sem_init(&lcddev_obj->wait_sem, 0, 0); - - /* Initialize the buffer flushing thread */ - - pthread_create(&(lcddev_obj->write_thread), NULL, - lcddev_update_thread, lcddev_obj); - - return lv_disp_drv_register(&(lcddev_obj->disp_drv)); -} - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: lv_port_lcddev_init - * - * Description: - * Lcd interface initialization. - * - * Input Parameters: - * dev_path - lcd device path, set to NULL to use the default path - * line_buf - Number of line buffers, - * set to 0 to use the default line buffer - * - * Returned Value: - * lv_disp object address on success; NULL on failure. - * - ****************************************************************************/ - -FAR lv_disp_t *lv_port_lcddev_init(FAR const char *dev_path, int line_buf) -{ - FAR const char *device_path = dev_path; - int line_buffer = line_buf; - int fd; - int ret; - FAR lv_disp_t *disp; - - struct fb_videoinfo_s vinfo; - struct lcd_planeinfo_s pinfo; - - if (device_path == NULL) - { - device_path = CONFIG_LV_PORT_LCDDEV_DEFAULT_DEVICEPATH; - } - - LV_LOG_INFO("lcddev %s opening", device_path); - fd = open(device_path, 0); - if (fd < 0) - { - LV_LOG_ERROR("lcddev open failed: %d", errno); - return NULL; - } - - LV_LOG_INFO("lcddev %s open success", device_path); - - ret = ioctl(fd, LCDDEVIO_GETVIDEOINFO, - (unsigned long)((uintptr_t)&vinfo)); - if (ret < 0) - { - LV_LOG_ERROR("ioctl(LCDDEVIO_GETVIDEOINFO) failed: %d", errno); - close(fd); - return NULL; - } - - LV_LOG_INFO("VideoInfo:"); - LV_LOG_INFO(" fmt: %u", vinfo.fmt); - LV_LOG_INFO(" xres: %u", vinfo.xres); - LV_LOG_INFO(" yres: %u", vinfo.yres); - LV_LOG_INFO(" nplanes: %u", vinfo.nplanes); - - ret = ioctl(fd, LCDDEVIO_GETPLANEINFO, - (unsigned long)((uintptr_t)&pinfo)); - if (ret < 0) - { - LV_LOG_ERROR("ERROR: ioctl(LCDDEVIO_GETPLANEINFO) failed: %d", - errno); - close(fd); - return NULL; - } - - LV_LOG_INFO("PlaneInfo:"); - LV_LOG_INFO(" bpp: %u", pinfo.bpp); - - if (pinfo.bpp != LV_COLOR_DEPTH) - { - LV_LOG_ERROR("lcddev bpp = %d, LV_COLOR_DEPTH = %d," - " color depth does not match", pinfo.bpp, LV_COLOR_DEPTH); - close(fd); - return NULL; - } - -#ifdef CONFIG_LV_PORT_LCDDEV_FULL_SCREEN_BUFFER - line_buffer = vinfo.yres; -#else - if (line_buffer <= 0) - { - line_buffer = CONFIG_LV_PORT_LCDDEV_LINE_BUFFER_DEFAULT; - } -#endif - - disp = lcddev_init(fd, vinfo.xres, vinfo.yres, - line_buffer); - if (disp == NULL) - { - close(fd); - } - - return disp; -} diff --git a/graphics/lvgl/port/lv_port_lcddev.h b/graphics/lvgl/port/lv_port_lcddev.h deleted file mode 100644 index 82efa6c65..000000000 --- a/graphics/lvgl/port/lv_port_lcddev.h +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** - * apps/graphics/lvgl/port/lv_port_lcddev.h - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -#ifndef __APPS_GRAPHICS_LVGL_PORT_LV_PORT_LCDDEV_H -#define __APPS_GRAPHICS_LVGL_PORT_LV_PORT_LCDDEV_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#if defined(CONFIG_LV_PORT_USE_LCDDEV) - -/**************************************************************************** - * Type Definitions - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -#ifdef __cplusplus -#define EXTERN extern "C" -extern "C" -{ -#else -#define EXTERN extern -#endif - -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Name: lv_port_lcddev_init - * - * Description: - * lcddev interface initialization. - * - * Input Parameters: - * dev_path - lcd device path, set to NULL to use the default path - * line_buf - Number of line buffers, - * set to 0 to use the default line buffer - * - * Returned Value: - * lv_disp object address on success; NULL on failure. - * - ****************************************************************************/ - -FAR lv_disp_t *lv_port_lcddev_init(FAR const char *dev_path, int line_buf); - -#undef EXTERN -#ifdef __cplusplus -} -#endif - -#endif /* CONFIG_LV_PORT_USE_LCDDEV */ - -#endif /* __APPS_GRAPHICS_LVGL_PORT_LV_PORT_LCDDEV_H */ diff --git a/graphics/lvgl/port/lv_port_libuv.c b/graphics/lvgl/port/lv_port_libuv.c deleted file mode 100644 index d91fdb238..000000000 --- a/graphics/lvgl/port/lv_port_libuv.c +++ /dev/null @@ -1,186 +0,0 @@ -/**************************************************************************** - * apps/graphics/lvgl/port/lv_port_libuv.c - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include "lv_port_libuv.h" - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Type Declarations - ****************************************************************************/ - -struct lv_uv_ctx_s -{ - int fd; - uv_timer_t ui_timer; - uv_poll_t ui_refr; -}; - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: ui_timer_cb - ****************************************************************************/ - -static void ui_timer_cb(FAR uv_timer_t *handle) -{ - uint32_t sleep_ms; - LV_LOG_TRACE("start"); - - sleep_ms = lv_timer_handler(); - - /* Prevent busy loops. */ - - if (sleep_ms == 0) - { - sleep_ms = 1; - } - - uv_timer_start(handle, ui_timer_cb, sleep_ms, 0); - LV_LOG_TRACE("stop, sleep %" PRIu32 " ms", sleep_ms); -} - -/**************************************************************************** - * Name: ui_refr_cb - ****************************************************************************/ - -static void ui_refr_cb(FAR uv_poll_t *handle, int status, int events) -{ - LV_LOG_TRACE("start"); - _lv_disp_refr_timer(NULL); - LV_LOG_TRACE("stop"); -} - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: lv_port_libuv_init - * - * Description: - * Add the UI event loop to the uv_loop. - * - * Input Parameters: - * loop - Pointer to uv_loop. - * - * Returned Value: - * Pointer to UI event context. - * - ****************************************************************************/ - -FAR void *lv_port_libuv_init(FAR void *loop) -{ - int fd; - FAR uv_loop_t *ui_loop = loop; - FAR lv_disp_t *disp; - FAR struct lv_uv_ctx_s *uv_ctx; - - LV_LOG_INFO("dev: " CONFIG_LV_PORT_UV_POLL_DEVICEPATH " opening..."); - fd = open(CONFIG_LV_PORT_UV_POLL_DEVICEPATH, O_WRONLY); - if (fd < 0) - { - LV_LOG_ERROR(CONFIG_LV_PORT_UV_POLL_DEVICEPATH - " open failed: %d", errno); - return NULL; - } - - disp = lv_disp_get_default(); - LV_ASSERT_NULL(disp); - - if (disp->refr_timer == NULL) - { - LV_LOG_ERROR("disp->refr_timer is NULL"); - close(fd); - return NULL; - } - - /* Remove default refr timer. */ - - lv_timer_del(disp->refr_timer); - disp->refr_timer = NULL; - - uv_ctx = malloc(sizeof(struct lv_uv_ctx_s)); - LV_ASSERT_MALLOC(uv_ctx); - - memset(uv_ctx, 0, sizeof(struct lv_uv_ctx_s)); - uv_ctx->fd = fd; - - LV_LOG_INFO("init ui_timer..."); - uv_timer_init(ui_loop, &uv_ctx->ui_timer); - uv_timer_start(&uv_ctx->ui_timer, ui_timer_cb, 1, 1); - - LV_LOG_INFO("init ui_refr..."); - uv_poll_init(ui_loop, &uv_ctx->ui_refr, fd); - uv_poll_start(&uv_ctx->ui_refr, UV_WRITABLE, ui_refr_cb); - - LV_LOG_INFO("ui loop start OK"); - return uv_ctx; -} - -/**************************************************************************** - * Name: lv_port_libuv_uninit - * - * Description: - * Remove the UI event loop. - * - * Input Parameters: - * Pointer to UI event context. - * - ****************************************************************************/ - -void lv_port_libuv_uninit(FAR void *ctx) -{ - FAR struct lv_uv_ctx_s *uv_ctx = ctx; - - if (uv_ctx == NULL) - { - LV_LOG_WARN("uv_ctx is NULL"); - return; - } - - uv_close((FAR uv_handle_t *)&uv_ctx->ui_timer, NULL); - uv_close((FAR uv_handle_t *)&uv_ctx->ui_refr, NULL); - close(uv_ctx->fd); - free(ctx); - LV_LOG_INFO("ui loop close OK"); -} diff --git a/graphics/lvgl/port/lv_port_libuv.h b/graphics/lvgl/port/lv_port_libuv.h deleted file mode 100644 index 905fb674b..000000000 --- a/graphics/lvgl/port/lv_port_libuv.h +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** - * apps/graphics/lvgl/port/lv_port_libuv.h - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -#ifndef __APPS_GRAPHICS_LVGL_PORT_LV_PORT_LIBUV_H -#define __APPS_GRAPHICS_LVGL_PORT_LV_PORT_LIBUV_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#if defined(CONFIG_LIBUV) - -/**************************************************************************** - * Type Definitions - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -#ifdef __cplusplus -#define EXTERN extern "C" -extern "C" -{ -#else -#define EXTERN extern -#endif - -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Name: lv_port_libuv_init - * - * Description: - * Add the UI event loop to the uv_loop. - * - * Input Parameters: - * loop - Pointer to uv_loop. - * - * Returned Value: - * Pointer to UI event context. - * - ****************************************************************************/ - -FAR void *lv_port_libuv_init(FAR void *loop); - -/**************************************************************************** - * Name: lv_port_libuv_uninit - * - * Description: - * Remove the UI event loop. - * - * Input Parameters: - * Pointer to UI event context. - * - ****************************************************************************/ - -void lv_port_libuv_uninit(FAR void *ctx); - -#undef EXTERN -#ifdef __cplusplus -} -#endif - -#endif /* CONFIG_LIBUV */ - -#endif /* __APPS_GRAPHICS_LVGL_PORT_LV_PORT_LIBUV_H */ diff --git a/graphics/lvgl/port/lv_port_mem.c b/graphics/lvgl/port/lv_port_mem.c deleted file mode 100644 index 73308a1fb..000000000 --- a/graphics/lvgl/port/lv_port_mem.c +++ /dev/null @@ -1,173 +0,0 @@ -/**************************************************************************** - * apps/graphics/lvgl/port/lv_port_mem.c - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include "lv_port_mem.h" - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Type Declarations - ****************************************************************************/ - -typedef CODE void *(*malloc_func_t)(FAR struct mm_heap_s *heap, size_t size); -typedef CODE void *(*realloc_func_t)(FAR struct mm_heap_s *heap, - FAR void *oldmem, size_t size); -typedef CODE void *(*memalign_func_t)(FAR struct mm_heap_s *heap, - size_t alignment, size_t size); - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -static FAR void *malloc_first(FAR struct mm_heap_s *heap, size_t size); -static FAR void *realloc_first(FAR struct mm_heap_s *heap, - FAR void *oldmem, size_t size); -static FAR void *memalign_first(FAR struct mm_heap_s *heap, - size_t alignment, size_t size); - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -static FAR struct mm_heap_s *g_lv_heap = NULL; -static malloc_func_t g_malloc_func = malloc_first; -static realloc_func_t g_realloc_func = realloc_first; -static memalign_func_t g_memalign_func = memalign_first; - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: lv_port_mem_init - * - * Description: - * Memory interface initialization. - * - ****************************************************************************/ - -static void lv_port_mem_init(void) -{ - static uint32_t heap_buf[CONFIG_LV_PORT_MEM_CUSTOM_SIZE - * 1024 / sizeof(uint32_t)]; - g_lv_heap = mm_initialize(CONFIG_LV_PORT_MEM_CUSTOM_NAME, - heap_buf, sizeof(heap_buf)); - LV_ASSERT_NULL(g_lv_heap); - if (g_lv_heap == NULL) - { - LV_LOG_ERROR("NO memory for " - CONFIG_LV_PORT_MEM_CUSTOM_NAME - " heap"); - } -} - -/**************************************************************************** - * Name: malloc_first - ****************************************************************************/ - -static FAR void *malloc_first(FAR struct mm_heap_s *heap, size_t size) -{ - if (g_lv_heap == NULL) - { - lv_port_mem_init(); - } - - g_malloc_func = mm_malloc; - return g_malloc_func(g_lv_heap, size); -} - -/**************************************************************************** - * Name: realloc_first - ****************************************************************************/ - -static FAR void *realloc_first(FAR struct mm_heap_s *heap, - FAR void *oldmem, size_t size) -{ - if (g_lv_heap == NULL) - { - lv_port_mem_init(); - } - - g_realloc_func = mm_realloc; - return g_realloc_func(g_lv_heap, oldmem, size); -} - -/**************************************************************************** - * Name: memalign_first - ****************************************************************************/ - -static FAR void *memalign_first(FAR struct mm_heap_s *heap, - size_t alignment, size_t size) -{ - if (g_lv_heap == NULL) - { - lv_port_mem_init(); - } - - g_memalign_func = mm_memalign; - return g_memalign_func(g_lv_heap, alignment, size); -} - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: lv_port_mem_alloc - ****************************************************************************/ - -FAR void *lv_port_mem_alloc(size_t size) -{ - return g_malloc_func(g_lv_heap, size); -} - -/**************************************************************************** - * Name: lv_port_mem_free - ****************************************************************************/ - -void lv_port_mem_free(FAR void *mem) -{ - mm_free(g_lv_heap, mem); -} - -/**************************************************************************** - * Name: lv_port_mem_realloc - ****************************************************************************/ - -FAR void *lv_port_mem_realloc(FAR void *oldmem, size_t size) -{ - return g_realloc_func(g_lv_heap, oldmem, size); -} - -/**************************************************************************** - * Name: lv_mem_custom_memalign - ****************************************************************************/ - -FAR void *lv_mem_custom_memalign(size_t alignment, size_t size) -{ - return g_memalign_func(g_lv_heap, alignment, size); -} diff --git a/graphics/lvgl/port/lv_port_mem.h b/graphics/lvgl/port/lv_port_mem.h deleted file mode 100644 index d6f25fbbd..000000000 --- a/graphics/lvgl/port/lv_port_mem.h +++ /dev/null @@ -1,92 +0,0 @@ -/**************************************************************************** - * apps/graphics/lvgl/port/lv_port_mem.h - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -#ifndef __APPS_GRAPHICS_LVGL_PORT_LV_PORT_MEM_H -#define __APPS_GRAPHICS_LVGL_PORT_LV_PORT_MEM_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#ifndef CONFIG_LV_PORT_MEM_CUSTOM_SIZE -# define CONFIG_LV_PORT_MEM_CUSTOM_SIZE 0 -#endif - -#if CONFIG_LV_PORT_MEM_CUSTOM_SIZE - -/**************************************************************************** - * Type Definitions - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -#ifdef __cplusplus -#define EXTERN extern "C" -extern "C" -{ -#else -#define EXTERN extern -#endif - -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Name: lv_port_mem_alloc - ****************************************************************************/ - -FAR void *lv_port_mem_alloc(size_t size); - -/**************************************************************************** - * Name: lv_port_mem_free - ****************************************************************************/ - -void lv_port_mem_free(FAR void *mem); - -/**************************************************************************** - * Name: lv_port_mem_realloc - ****************************************************************************/ - -FAR void *lv_port_mem_realloc(FAR void *oldmem, size_t size); - -/**************************************************************************** - * Name: lv_port_mem_memalign - ****************************************************************************/ - -FAR void *lv_port_mem_memalign(size_t alignment, size_t size); - -#undef EXTERN -#ifdef __cplusplus -} -#endif - -#endif /* CONFIG_LV_PORT_MEM_CUSTOM_SIZE */ - -#endif /* __APPS_GRAPHICS_LVGL_PORT_LV_PORT_MEM_H */ diff --git a/graphics/lvgl/port/lv_port_syslog.c b/graphics/lvgl/port/lv_port_syslog.c deleted file mode 100644 index c7a1ca999..000000000 --- a/graphics/lvgl/port/lv_port_syslog.c +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** - * apps/graphics/lvgl/port/lv_port_syslog.c - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include -#include "lv_port_syslog.h" - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: syslog_print_cb - ****************************************************************************/ - -static void syslog_print_cb(FAR const char *buf) -{ - syslog(LOG_INFO, "[LVGL] %s", buf); -} - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: lv_port_syslog_init - * - * Description: - * Syslog interface initialization. - * - ****************************************************************************/ - -void lv_port_syslog_init(void) -{ - lv_log_register_print_cb(syslog_print_cb); -} diff --git a/graphics/lvgl/port/lv_port_syslog.h b/graphics/lvgl/port/lv_port_syslog.h deleted file mode 100644 index c4f21a222..000000000 --- a/graphics/lvgl/port/lv_port_syslog.h +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** - * apps/graphics/lvgl/port/lv_port_syslog.h - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -#ifndef __APPS_GRAPHICS_LVGL_PORT_LV_PORT_SYSLOG_H -#define __APPS_GRAPHICS_LVGL_PORT_LV_PORT_SYSLOG_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#if defined(CONFIG_LV_USE_LOG) - -/**************************************************************************** - * Type Definitions - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -#ifdef __cplusplus -#define EXTERN extern "C" -extern "C" -{ -#else -#define EXTERN extern -#endif - -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Name: lv_port_syslog_init - * - * Description: - * Syslog interface initialization. - * - ****************************************************************************/ - -void lv_port_syslog_init(void); - -#undef EXTERN -#ifdef __cplusplus -} -#endif - -#endif /* CONFIG_LV_USE_LOG */ - -#endif /* __APPS_GRAPHICS_LVGL_PORT_LV_PORT_SYSLOG_H */ diff --git a/graphics/lvgl/port/lv_port_tick.c b/graphics/lvgl/port/lv_port_tick.c deleted file mode 100644 index 659e7c74f..000000000 --- a/graphics/lvgl/port/lv_port_tick.c +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** - * apps/graphics/lvgl/port/lv_port_tick.c - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include -#include "lv_port_tick.h" - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Type Declarations - ****************************************************************************/ - -/**************************************************************************** - * Private Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Private Data - ****************************************************************************/ - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -uint32_t millis(void) -{ - struct timespec ts; - - clock_gettime(CLOCK_MONOTONIC, &ts); - uint32_t tick = ts.tv_sec * 1000 + ts.tv_nsec / 1000000; - - return tick; -} diff --git a/graphics/lvgl/port/lv_port_tick.h b/graphics/lvgl/port/lv_port_tick.h deleted file mode 100644 index d662481f7..000000000 --- a/graphics/lvgl/port/lv_port_tick.h +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** - * apps/graphics/lvgl/port/lv_port_tick.h - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -#ifndef __APPS_GRAPHICS_LVGL_PORT_LV_PORT_TICK_H -#define __APPS_GRAPHICS_LVGL_PORT_LV_PORT_TICK_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Type Definitions - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -#ifdef __cplusplus -#define EXTERN extern "C" -extern "C" -{ -#else -#define EXTERN extern -#endif - -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -uint32_t millis(void); - -#undef EXTERN -#ifdef __cplusplus -} -#endif - -#endif /* __APPS_GRAPHICS_LVGL_PORT_LV_PORT_TICK_H */ diff --git a/graphics/lvgl/port/lv_port_touchpad.c b/graphics/lvgl/port/lv_port_touchpad.c deleted file mode 100644 index 85badc14b..000000000 --- a/graphics/lvgl/port/lv_port_touchpad.c +++ /dev/null @@ -1,207 +0,0 @@ -/**************************************************************************** - * apps/graphics/lvgl/port/lv_port_touchpad.c - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "lv_port_touchpad.h" - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -/**************************************************************************** - * Private Type Declarations - ****************************************************************************/ - -struct touchpad_obj_s -{ - int fd; - lv_coord_t last_x; - lv_coord_t last_y; - lv_indev_state_t last_state; - lv_indev_drv_t indev_drv; -}; - -/**************************************************************************** - * Private Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: touchpad_read - ****************************************************************************/ - -static void touchpad_read(FAR lv_indev_drv_t *drv, FAR lv_indev_data_t *data) -{ - FAR struct touchpad_obj_s *touchpad_obj = drv->user_data; - struct touch_sample_s sample; - - /* Read one sample */ - - int nbytes = read(touchpad_obj->fd, &sample, - sizeof(struct touch_sample_s)); - - /* Handle unexpected return values */ - - if (nbytes == sizeof(struct touch_sample_s)) - { - uint8_t touch_flags = sample.point[0].flags; - - if (touch_flags & TOUCH_DOWN || touch_flags & TOUCH_MOVE) - { - const FAR lv_disp_drv_t *disp_drv = drv->disp->driver; - lv_coord_t ver_max = disp_drv->ver_res - 1; - lv_coord_t hor_max = disp_drv->hor_res - 1; - - touchpad_obj->last_x = LV_CLAMP(0, sample.point[0].x, hor_max); - touchpad_obj->last_y = LV_CLAMP(0, sample.point[0].y, ver_max); - touchpad_obj->last_state = LV_INDEV_STATE_PR; - } - else if (touch_flags & TOUCH_UP) - { - touchpad_obj->last_state = LV_INDEV_STATE_REL; - } - } - - /* Update touchpad data */ - - data->point.x = touchpad_obj->last_x; - data->point.y = touchpad_obj->last_y; - data->state = touchpad_obj->last_state; -} - -/**************************************************************************** - * Name: touchpad_init - ****************************************************************************/ - -static FAR lv_indev_t *touchpad_init(int fd) -{ - FAR struct touchpad_obj_s *touchpad_obj; - touchpad_obj = malloc(sizeof(struct touchpad_obj_s)); - - if (touchpad_obj == NULL) - { - LV_LOG_ERROR("touchpad_obj_s malloc failed"); - return NULL; - } - - touchpad_obj->fd = fd; - touchpad_obj->last_x = 0; - touchpad_obj->last_y = 0; - touchpad_obj->last_state = LV_INDEV_STATE_REL; - - lv_indev_drv_init(&(touchpad_obj->indev_drv)); - touchpad_obj->indev_drv.type = LV_INDEV_TYPE_POINTER; - touchpad_obj->indev_drv.read_cb = touchpad_read; -#if ( LV_USE_USER_DATA != 0 ) - touchpad_obj->indev_drv.user_data = touchpad_obj; -#else -#error LV_USE_USER_DATA must be enabled -#endif - return lv_indev_drv_register(&(touchpad_obj->indev_drv)); -} - -/**************************************************************************** - * Name: touchpad_cursor_init - ****************************************************************************/ - -static void touchpad_cursor_init(FAR lv_indev_t *indev, lv_coord_t size) -{ - FAR lv_obj_t *cursor; - - if (size <= 0) - { - return; - } - - cursor = lv_obj_create(lv_layer_sys()); - lv_obj_remove_style_all(cursor); - - lv_obj_set_size(cursor, size, size); - lv_obj_set_style_translate_x(cursor, -size / 2, 0); - lv_obj_set_style_translate_y(cursor, -size / 2, 0); - lv_obj_set_style_radius(cursor, LV_RADIUS_CIRCLE, 0); - lv_obj_set_style_bg_opa(cursor, LV_OPA_50, 0); - lv_obj_set_style_bg_color(cursor, lv_color_black(), 0); - lv_obj_set_style_border_width(cursor, 2, 0); - lv_obj_set_style_border_color(cursor, lv_palette_main(LV_PALETTE_GREY), 0); - lv_indev_set_cursor(indev, cursor); -} - -/**************************************************************************** - * Public Functions - ****************************************************************************/ - -/**************************************************************************** - * Name: lv_port_touchpad_init - * - * Description: - * Touchpad interface initialization. - * - * Input Parameters: - * dev_path - input device path, set to NULL to use the default path - * - * Returned Value: - * lv_indev object address on success; NULL on failure. - * - ****************************************************************************/ - -FAR lv_indev_t *lv_port_touchpad_init(FAR const char *dev_path) -{ - FAR const char *device_path = dev_path; - FAR lv_indev_t *indev; - int fd; - - if (device_path == NULL) - { - device_path = CONFIG_LV_PORT_TOUCHPAD_DEFAULT_DEVICEPATH; - } - - LV_LOG_INFO("touchpad %s opening", device_path); - fd = open(device_path, O_RDONLY | O_NONBLOCK); - if (fd < 0) - { - LV_LOG_ERROR("touchpad %s open failed: %d", device_path, errno); - return NULL; - } - - LV_LOG_INFO("touchpad %s open success", device_path); - - indev = touchpad_init(fd); - - if (indev == NULL) - { - close(fd); - } - - touchpad_cursor_init(indev, CONFIG_LV_PORT_TOUCHPAD_CURSOR_SIZE); - - return indev; -} diff --git a/graphics/lvgl/port/lv_port_touchpad.h b/graphics/lvgl/port/lv_port_touchpad.h deleted file mode 100644 index cbcce2ea8..000000000 --- a/graphics/lvgl/port/lv_port_touchpad.h +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** - * apps/graphics/lvgl/port/lv_port_touchpad.h - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. The - * ASF licenses this file to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance with the - * License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - ****************************************************************************/ - -#ifndef __APPS_GRAPHICS_LVGL_PORT_LV_PORT_TOUCHPAD_H -#define __APPS_GRAPHICS_LVGL_PORT_LV_PORT_TOUCHPAD_H - -/**************************************************************************** - * Included Files - ****************************************************************************/ - -#include -#include - -/**************************************************************************** - * Pre-processor Definitions - ****************************************************************************/ - -#if defined(CONFIG_LV_PORT_USE_TOUCHPAD) - -/**************************************************************************** - * Type Definitions - ****************************************************************************/ - -/**************************************************************************** - * Public Data - ****************************************************************************/ - -#ifdef __cplusplus -#define EXTERN extern "C" -extern "C" -{ -#else -#define EXTERN extern -#endif - -/**************************************************************************** - * Public Function Prototypes - ****************************************************************************/ - -/**************************************************************************** - * Name: lv_port_touchpad_init - * - * Description: - * Touchpad interface initialization. - * - * Input Parameters: - * dev_path - input device path, set to NULL to use the default path - * - * Returned Value: - * lv_indev object address on success; NULL on failure. - * - ****************************************************************************/ - -FAR lv_indev_t *lv_port_touchpad_init(FAR const char *dev_path); - -#undef EXTERN -#ifdef __cplusplus -} -#endif - -#endif /* CONFIG_LV_PORT_USE_TOUCHPAD */ - -#endif /* __APPS_GRAPHICS_LVGL_PORT_LV_PORT_TOUCHPAD_H */