From 0a1a1a867cd0dcc47429f99613f613aa9bcda254 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Wed, 20 Mar 2024 12:55:30 +0100 Subject: [PATCH] udpate to v9 --- .gitignore | 4 +- CMakeLists.txt | 96 ++++ Makefile | 70 --- README.md | 40 +- lv_conf.h | 1052 +++++++++++++++++++++++----------- lv_demo_conf.h | 60 -- lv_drivers | 1 - lv_drv_conf.h | 517 ----------------- lvgl | 2 +- main/src/main.c | 274 +-------- main/src/mouse_cursor_icon.c | 78 +-- ui/simulator/README | 6 - 12 files changed, 858 insertions(+), 1342 deletions(-) create mode 100644 CMakeLists.txt delete mode 100644 Makefile delete mode 100644 lv_demo_conf.h delete mode 160000 lv_drivers delete mode 100644 lv_drv_conf.h delete mode 100644 ui/simulator/README diff --git a/.gitignore b/.gitignore index ddd143a..fa6b0fe 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ # Ignore build folder build/ +bin/ # Ignore UI folder, this should be commited in its own repository ui/ @@ -8,5 +9,4 @@ ui/ .*/ # VSCode -!.vscode/ -!.vscode/* +.vscode diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..d048ab5 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,96 @@ +cmake_minimum_required(VERSION 3.10) +project(lvgl) + +option(LV_USE_DRAW_SDL "Use SDL draw unit" OFF) +option(LV_USE_LIBPNG "Use libpng to decode PNG" OFF) +option(LV_USE_LIBJPEG_TURBO "Use libjpeg turbo to decode JPEG" OFF) +option(LV_USE_FFMPEG "Use libffmpeg to display video using lv_ffmpeg" OFF) +option(LV_USE_FREETYPE "Use freetype lib" OFF) + +set(CMAKE_C_STANDARD 99)#C99 # lvgl officially support C99 and above +set(CMAKE_CXX_STANDARD 17)#C17 +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin) + +find_package(SDL2 REQUIRED SDL2) + +add_compile_definitions($<$:LV_USE_DRAW_SDL=1>) +add_compile_definitions($<$:LV_USE_LIBPNG=1>) +add_compile_definitions($<$:LV_USE_LIBJPEG_TURBO=1>) +add_compile_definitions($<$:LV_USE_FFMPEG=1>) + +add_subdirectory(lvgl) +target_include_directories(lvgl PUBLIC ${PROJECT_SOURCE_DIR} ${SDL2_INCLUDE_DIRS}) + +add_executable(main main/src/main.c main/src/mouse_cursor_icon.c) + +target_compile_definitions(main PRIVATE LV_CONF_INCLUDE_SIMPLE) +target_link_libraries(main lvgl lvgl::examples lvgl::demos lvgl::thorvg ${SDL2_LIBRARIES} m pthread) +add_custom_target (run COMMAND ${EXECUTABLE_OUTPUT_PATH}/main DEPENDS main) + +if(LV_USE_DRAW_SDL) + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake") + # Need to install libsdl2-image-dev + # `sudo apt install libsdl2-image-dev` + # `brew install sdl2_image` + find_package(SDL2_image REQUIRED) + target_include_directories(lvgl PUBLIC ${SDL2_IMAGE_INCLUDE_DIRS}) + target_link_libraries(main ${SDL2_IMAGE_LIBRARIES}) +endif(LV_USE_DRAW_SDL) + +if(LV_USE_LIBPNG) + find_package(PNG REQUIRED) + target_include_directories(lvgl PUBLIC ${PNG_INCLUDE_DIR}) + target_link_libraries(main ${PNG_LIBRARY}) +endif(LV_USE_LIBPNG) + +if(LV_USE_LIBJPEG_TURBO) + # Need to install libjpeg-turbo8-dev + # `sudo apt install libjpeg-turbo8-dev` + # `brew install libjpeg-turbo` + find_package(JPEG REQUIRED) + target_include_directories(lvgl PUBLIC ${JPEG_INCLUDE_DIRS}) + target_link_libraries(main ${JPEG_LIBRARIES}) +endif(LV_USE_LIBJPEG_TURBO) + +if(LV_USE_FFMPEG) + target_link_libraries(main avformat avcodec avutil swscale) +endif(LV_USE_FFMPEG) + +if(LV_USE_FREETYPE) + find_package(Freetype REQUIRED) + target_link_libraries(main ${FREETYPE_LIBRARIES}) + target_include_directories(lvgl PUBLIC ${FREETYPE_INCLUDE_DIRS}) +endif(LV_USE_FREETYPE) + +if(CMAKE_BUILD_TYPE STREQUAL "Debug") + target_compile_options(lvgl PRIVATE + -pedantic-errors + -Wall + -Wclobbered + -Wdeprecated + -Wdouble-promotion + -Wempty-body + -Wextra + -Wformat-security + -Wmaybe-uninitialized + # -Wmissing-prototypes + -Wpointer-arith + -Wmultichar + -Wno-pedantic # ignored for now, we convert functions to pointers for propertis table. + -Wreturn-type + -Wshadow + -Wshift-negative-value + -Wsizeof-pointer-memaccess + -Wtype-limits + -Wundef + -Wuninitialized + -Wunreachable-code + -Wfloat-conversion + -Wstrict-aliasing + ) + + target_compile_options(main PRIVATE -fsanitize=address,leak,undefined) + target_link_options(main PRIVATE -fsanitize=address,leak,undefined) +endif() diff --git a/Makefile b/Makefile deleted file mode 100644 index d43636f..0000000 --- a/Makefile +++ /dev/null @@ -1,70 +0,0 @@ -# -# Makefile -# WARNING: relies on invocation setting current working directory to Makefile location -# This is done in .vscode/task.json -# - -# select underlaying LCGL display driver (SDL2 || X11) -LV_DRIVER := X11 -#LV_DRIVER := SDL2 - -PROJECT ?= lvgl-demo -MAKEFLAGS := -j $(shell nproc) -SRC_EXT := c -OBJ_EXT := o -CC ?= gcc - -SRC_DIR := ./ -WORKING_DIR := ./build -BUILD_DIR := $(WORKING_DIR)/obj -BIN_DIR := $(WORKING_DIR)/bin -UI_DIR := ui - -WARNINGS := -Wall -Wextra \ - -Wshadow -Wundef -Wmaybe-uninitialized -Wmissing-prototypes -Wno-discarded-qualifiers \ - -Wno-unused-function -Wno-error=strict-prototypes -Wpointer-arith -fno-strict-aliasing -Wno-error=cpp -Wuninitialized \ - -Wno-unused-parameter -Wno-missing-field-initializers -Wno-format-nonliteral -Wno-cast-qual -Wunreachable-code -Wno-switch-default \ - -Wreturn-type -Wmultichar -Wformat-security -Wno-ignored-qualifiers -Wno-error=pedantic -Wno-sign-compare -Wno-error=missing-prototypes -Wdouble-promotion -Wclobbered -Wdeprecated \ - -Wempty-body -Wshift-negative-value -Wstack-usage=2048 \ - -Wtype-limits -Wsizeof-pointer-memaccess -Wpointer-arith - -CFLAGS := -O0 -g $(WARNINGS) - -# simulator library define -ifeq "$(LV_DRIVER)" "SDL2" -LV_DRIVER_USE := USE_SDL -else -LV_DRIVER_USE := USE_$(LV_DRIVER) -endif - -# Add simulator defines to allow modification of source -DEFINES := -D SIMULATOR=1 -D LV_BUILD_TEST=0 -D $(LV_DRIVER_USE) - -# Include simulator inc folder first so lv_conf.h from custom UI can be used instead -INC := -I./ui/simulator/inc/ -I./ -I./lvgl/ #-I/usr/include/freetype2 -L/usr/local/lib -LDLIBS := -l$(LV_DRIVER) -lpthread -lm #-lfreetype -lavformat -lavcodec -lavutil -lswscale -lm -lz -BIN := $(BIN_DIR)/demo - -COMPILE = $(CC) $(CFLAGS) $(INC) $(DEFINES) - -# Automatically include all source files -SRCS := $(shell find $(SRC_DIR) -type f -name '*.c' -not -path '*/\.*') -OBJECTS := $(patsubst $(SRC_DIR)%,$(BUILD_DIR)/%,$(SRCS:.$(SRC_EXT)=.$(OBJ_EXT))) - -all: $(BIN) - -$(BUILD_DIR)/%.$(OBJ_EXT): $(SRC_DIR)/%.$(SRC_EXT) lv_demo_conf.h lv_conf.h Makefile - @echo 'Building project file: $<' - @mkdir -p $(dir $@) - @$(COMPILE) -c -o "$@" "$<" - -$(BIN): $(OBJECTS) - @mkdir -p $(BIN_DIR) - $(CC) -o $(BIN) $(OBJECTS) $(LDFLAGS) ${LDLIBS} - -clean: - rm -rf $(WORKING_DIR) - -install: ${BIN} - install -d ${DESTDIR}/usr/lib/${PROJECT}/bin - install $< ${DESTDIR}/usr/lib/${PROJECT}/bin/ diff --git a/README.md b/README.md index 945c06b..51e644e 100644 --- a/README.md +++ b/README.md @@ -2,19 +2,12 @@ The [LVGL](https://github.com/lvgl/lvgl) is written mainly for microcontrollers and embedded systems however you can run the library **on your PC** as well without any embedded hardware. The code written on PC can be simply copied when your are using an embedded system. -Using a PC simulator instead of an embedded hardware has several advantages: -* **Costs $0** because you don't have to buy or design PCB -* **Fast** because you don't have to design and manufacture PCB -* **Collaborative** because any number of developers can work in the same environment -* **Developer friendly** because much easier and faster to debug on PC - ## Requirements This project is configured for [VSCode](https://code.visualstudio.com) and only tested on Linux, although this may work on OSx or WSL. It requires a working version of GCC, GDB and make in your path. To allow debugging inside VSCode you will also require a GDB [extension](https://marketplace.visualstudio.com/items?itemName=webfreak.debug) or other suitable debugger. All the requirements have been pre-configured in the [.workspace](simulator.code-workspace) file (simply open the project by doubleclick on this file). -The project can use **SDL** or **X11** as LVGL display driver for lowlevel graphics/mouse/keyboard support. This can be defined in the [Makefile](Makefile#L8). -Please make sure the selected library is installed in the system (check [Install graphics driver](#install-graphics-driver)). +The project can use **SDL** but it can be easily relaced by any other built-in LVGL dirvers. ## Usage @@ -27,8 +20,8 @@ git clone --recursive https://github.com/lvgl/lv_port_pc_vscode ``` ### Install graphics driver -The project can use **SDL** or **X11** as LVGL display driver. This can be selected in the [Makefile](Makefile#L8). -Please make sure the used library is installed in the system: + +Please make sure **SDL** is installed in the system: #### Install SDL You can download SDL from https://www.libsdl.org/ @@ -38,12 +31,6 @@ On on Linux you can install it via terminal: sudo apt-get update && sudo apt-get install -y build-essential libsdl2-dev ``` -#### Install X11 -On on Linux you can install it via terminal: -```bash -sudo apt-get update && sudo apt-get install -y libx11-dev -``` - ### Optional library There are also FreeType and FFmpeg support. You can install FreeType support with: ```bash @@ -64,23 +51,4 @@ git checkout release/6.0 ./configure --disable-all --disable-autodetect --disable-podpages --disable-asm --enable-avcodec --enable-avformat --enable-decoders --enable-encoders --enable-demuxers --enable-parsers --enable-protocol='file' --enable-swscale --enable-zlib make sudo make install -``` - -And then remove all the comments in the `Makefile` on `INC` and `LDLIBS` lines. \ -They should be for **SDL**: -```Makefile -INC := -I./ui/simulator/inc/ -I./ -I./lvgl/ -I/usr/include/freetype2 -L/usr/local/lib -LDLIBS := -lSDL2 -lm -lfreetype -lavformat -lavcodec -lavutil -lswscale -lm -lz -lpthread -``` -They should be for **X11**: -```Makefile -INC := -I./ui/simulator/inc/ -I./ -I./lvgl/ -I/usr/include/freetype2 -L/usr/local/lib -LDLIBS := -lX11 -lm -lfreetype -lavformat -lavcodec -lavutil -lswscale -lm -lz -lpthread -``` - -### Setup -To allow custom UI code an `lv_conf.h` file placed at `ui/simulator/inc` will automatically override this projects lv_conf.h file. By default code under `ui` is ignored so you can reuse this repository for multiple projects. You will need to place a call from `main.c` to your UI's entry function. - -To build and debug, press F5. You should now have your UI displayed in a new window and can access all the debug features of VSCode through GDB. - -To allow temporary modification between simulator and device code, a SIMULATOR=1 define is added globally. +``` \ No newline at end of file diff --git a/lv_conf.h b/lv_conf.h index 6ce2234..cf62d09 100644 --- a/lv_conf.h +++ b/lv_conf.h @@ -1,167 +1,258 @@ /** * @file lv_conf.h - * Configuration file for v8.0.0 + * Configuration file for v9.1.0 */ /* - * COPY THIS FILE AS `lv_conf.h` NEXT TO the `lvgl` FOLDER + * Copy this file as `lv_conf.h` + * 1. simply next to the `lvgl` folder + * 2. or any other places and + * - define `LV_CONF_INCLUDE_SIMPLE` + * - add the path as include path */ +/* clang-format off */ #if 1 /*Set it to "1" to enable content*/ #ifndef LV_CONF_H #define LV_CONF_H -/*clang-format off*/ -#include -#include "lv_demo_conf.h" +/*If you need to include anything here, do it inside the `__ASSEMBLY__` guard */ +#if 0 && defined(__ASSEMBLY__) +#include "my_include.h" +#endif /*==================== COLOR SETTINGS *====================*/ -/*Color depth: 1 (1 byte per pixel), 8 (RGB332), 16 (RGB565), 32 (ARGB8888)*/ -#define LV_COLOR_DEPTH 32 - -/*Swap the 2 bytes of RGB565 color. Useful if the display has a 8 bit interface (e.g. SPI)*/ -#define LV_COLOR_16_SWAP 0 - -/*Enable more complex drawing routines to manage screens transparency. - *Can be used if the UI is above an other layer, e.g. an OSD menu or video player. - *Requires `LV_COLOR_DEPTH = 32` colors and the screen's `bg_opa` should be set to non LV_OPA_COVER value*/ -#define LV_COLOR_SCREEN_TRANSP 0 - -/*Images pixels with this color will not be drawn if they are chroma keyed)*/ -#define LV_COLOR_CHROMA_KEY lv_color_hex(0x00ff00) /*pure green*/ +/*Color depth: 8 (A8), 16 (RGB565), 24 (RGB888), 32 (XRGB8888)*/ +#define LV_COLOR_DEPTH 16 /*========================= - MEMORY SETTINGS + STDLIB WRAPPER SETTINGS *=========================*/ -/*1: use custom malloc/free, 0: use the built-in `lv_mem_alloc()` and `lv_mem_free()`*/ -#define LV_MEM_CUSTOM 0 -#if LV_MEM_CUSTOM == 0 -/*Size of the memory available for `lv_mem_alloc()` in bytes (>= 2kB)*/ -# define LV_MEM_SIZE (1024U * 1024U) /*[bytes]*/ +/* Possible values + * - LV_STDLIB_BUILTIN: LVGL's built in implementation + * - LV_STDLIB_CLIB: Standard C functions, like malloc, strlen, etc + * - LV_STDLIB_MICROPYTHON: MicroPython implementation + * - LV_STDLIB_RTTHREAD: RT-Thread implementation + * - LV_STDLIB_CUSTOM: Implement the functions externally + */ +#define LV_USE_STDLIB_MALLOC LV_STDLIB_BUILTIN +#define LV_USE_STDLIB_STRING LV_STDLIB_BUILTIN +#define LV_USE_STDLIB_SPRINTF LV_STDLIB_BUILTIN -/*Set an address for the memory pool instead of allocating it as a normal array. Can be in external SRAM too.*/ -# define LV_MEM_ADR 0 /*0: unused*/ -#else /*LV_MEM_CUSTOM*/ -# define LV_MEM_CUSTOM_INCLUDE /*Header for the dynamic memory function*/ -# define LV_MEM_CUSTOM_ALLOC malloc -# define LV_MEM_CUSTOM_FREE free -# define LV_MEM_CUSTOM_REALLOC realloc -#endif /*LV_MEM_CUSTOM*/ +#define LV_STDINT_INCLUDE +#define LV_STDDEF_INCLUDE +#define LV_STDBOOL_INCLUDE +#define LV_INTTYPES_INCLUDE +#define LV_LIMITS_INCLUDE +#define LV_STDARG_INCLUDE -/*Use the standard `memcpy` and `memset` instead of LVGL's own functions. (Might or might not be faster).*/ -#define LV_MEMCPY_MEMSET_STD 0 +#if LV_USE_STDLIB_MALLOC == LV_STDLIB_BUILTIN + /*Size of the memory available for `lv_malloc()` in bytes (>= 2kB)*/ + #define LV_MEM_SIZE (512 * 1024U) /*[bytes]*/ + + /*Size of the memory expand for `lv_malloc()` in bytes*/ + #define LV_MEM_POOL_EXPAND_SIZE 0 + + /*Set an address for the memory pool instead of allocating it as a normal array. Can be in external SRAM too.*/ + #define LV_MEM_ADR 0 /*0: unused*/ + /*Instead of an address give a memory allocator that will be called to get a memory pool for LVGL. E.g. my_malloc*/ + #if LV_MEM_ADR == 0 + #undef LV_MEM_POOL_INCLUDE + #undef LV_MEM_POOL_ALLOC + #endif +#endif /*LV_USE_STDLIB_MALLOC == LV_STDLIB_BUILTIN*/ /*==================== HAL SETTINGS *====================*/ -/*Default display refresh period. LVG will redraw changed areas with this period time*/ -#define LV_DISP_DEF_REFR_PERIOD 30 /*[ms]*/ - -/*Input device read period in milliseconds*/ -#define LV_INDEV_DEF_READ_PERIOD 30 /*[ms]*/ - -/*Use a custom tick source that tells the elapsed time in milliseconds. - *It removes the need to manually update the tick with `lv_tick_inc()`)*/ -#define LV_TICK_CUSTOM 0 -#if LV_TICK_CUSTOM -#define LV_TICK_CUSTOM_INCLUDE "Arduino.h" /*Header for the system time function*/ -#define LV_TICK_CUSTOM_SYS_TIME_EXPR (millis()) /*Expression evaluating to current system time in ms*/ -#endif /*LV_TICK_CUSTOM*/ +/*Default display refresh, input device read and animation step period.*/ +#define LV_DEF_REFR_PERIOD 33 /*[ms]*/ /*Default Dot Per Inch. Used to initialize default sizes such as widgets sized, style paddings. *(Not so important, you can adjust it to modify default sizes and spaces)*/ -#define LV_DPI_DEF 130 /*[px/inch]*/ +#define LV_DPI_DEF 130 /*[px/inch]*/ + +/*================= + * OPERATING SYSTEM + *=================*/ +/*Select an operating system to use. Possible options: + * - LV_OS_NONE + * - LV_OS_PTHREAD + * - LV_OS_FREERTOS + * - LV_OS_CMSIS_RTOS2 + * - LV_OS_RTTHREAD + * - LV_OS_WINDOWS + * - LV_OS_CUSTOM */ +#define LV_USE_OS LV_OS_NONE + +#if LV_USE_OS == LV_OS_CUSTOM + #define LV_OS_CUSTOM_INCLUDE +#endif + +/*======================== + * RENDERING CONFIGURATION + *========================*/ + +/*Align the stride of all layers and images to this bytes*/ +#define LV_DRAW_BUF_STRIDE_ALIGN 1 + +/*Align the start address of draw_buf addresses to this bytes*/ +#define LV_DRAW_BUF_ALIGN 4 + +/* 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. */ + +/*The target buffer size for simple layer chunks.*/ +#define LV_DRAW_LAYER_SIMPLE_BUF_SIZE (24 * 1024) /*[bytes]*/ + +#define LV_USE_DRAW_SW 1 +#if LV_USE_DRAW_SW == 1 + /* Set the number of draw unit. + * > 1 requires an operating system enabled in `LV_USE_OS` + * > 1 means multiply threads will render the screen in parallel */ + #define LV_DRAW_SW_DRAW_UNIT_CNT 1 + + /* Use Arm-2D to accelerate the sw render */ + #define LV_USE_DRAW_ARM2D_SYNC 0 + + /* Enable native helium assembly to be compiled */ + #define LV_USE_NATIVE_HELIUM_ASM 0 + + /* 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 */ + #define LV_DRAW_SW_COMPLEX 1 + + #if LV_DRAW_SW_COMPLEX == 1 + /*Allow buffering some shadow calculation. + *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*/ + #define LV_DRAW_SW_SHADOW_CACHE_SIZE 0 + + /* Set number of maximally cached circle data. + * 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) + * 0: to disable caching */ + #define LV_DRAW_SW_CIRCLE_CACHE_SIZE 4 + #endif + + #define LV_USE_DRAW_SW_ASM LV_DRAW_SW_ASM_NONE + + #if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_CUSTOM + #define LV_DRAW_SW_ASM_CUSTOM_INCLUDE "" + #endif +#endif + +/* Use NXP's VG-Lite GPU on iMX RTxxx platforms. */ +#define LV_USE_DRAW_VGLITE 0 + +#if LV_USE_DRAW_VGLITE + /* Enable blit quality degradation workaround recommended for screen's dimension > 352 pixels. */ + #define LV_USE_VGLITE_BLIT_SPLIT 0 + + #if LV_USE_OS + /* Enable VGLite draw async. Queue multiple tasks and flash them once to the GPU. */ + #define LV_USE_VGLITE_DRAW_ASYNC 1 + #endif + + /* Enable VGLite asserts. */ + #define LV_USE_VGLITE_ASSERT 0 +#endif + +/* Use NXP's PXP on iMX RTxxx platforms. */ +#define LV_USE_DRAW_PXP 0 + +#if LV_USE_DRAW_PXP + /* Enable PXP asserts. */ + #define LV_USE_PXP_ASSERT 0 +#endif + +/* Use Renesas Dave2D on RA platforms. */ +#define LV_USE_DRAW_DAVE2D 0 + +/* Draw using cached SDL textures*/ +#define LV_USE_DRAW_SDL 0 + +/* Use VG-Lite GPU. */ +#define LV_USE_DRAW_VG_LITE 0 + +#if LV_USE_DRAW_VG_LITE +/* Enable VG-Lite custom external 'gpu_init()' function */ +#define LV_VG_LITE_USE_GPU_INIT 0 + +/* Enable VG-Lite assert. */ +#define LV_VG_LITE_USE_ASSERT 0 + +/* VG-Lite flush commit trigger threshold. GPU will try to batch these many draw tasks. */ +#define LV_VG_LITE_FLUSH_MAX_COUNT 8 + +/* Enable border to simulate shadow + * NOTE: which usually improves performance, + * but does not guarantee the same rendering quality as the software. */ +#define LV_VG_LITE_USE_BOX_SHADOW 0 + +/* VG-Lite linear gradient image maximum cache number. + * NOTE: The memory usage of a single gradient image is 4K bytes. + */ +#define LV_VG_LITE_LINEAER_GRAD_CACHE_CNT 32 + +/* VG-Lite radial gradient image maximum cache size. + * NOTE: The memory usage of a single gradient image is radial grad radius * 4 bytes. + */ +#define LV_VG_LITE_RADIAL_GRAD_CACHE_CNT 32 + +#endif /*======================= * FEATURE CONFIGURATION *=======================*/ -/*------------- - * Drawing - *-----------*/ - -/*Enable complex draw engine. - *Required to draw shadow, gradient, rounded corners, circles, arc, skew lines, image transformations or any masks*/ -#define LV_DRAW_COMPLEX 1 -#if LV_DRAW_COMPLEX != 0 - -/*Allow buffering some shadow calculation. - *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*/ -#define LV_SHADOW_CACHE_SIZE 0 -#endif /*LV_DRAW_COMPLEX*/ - -/*Default image cache size. Image caching keeps the images opened. - *If only the built-in image formats are used there is no real advantage of caching. (I.e. if 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. - *0: to disable caching*/ -#define LV_IMG_CACHE_DEF_SIZE 0 - -/*Maximum buffer size to allocate for rotation. Only used if software rotation is enabled in the display driver.*/ -#define LV_DISP_ROT_MAX_BUF (10*1024) -/*------------- - * GPU - *-----------*/ - -/*Use STM32's DMA2D (aka Chrom Art) GPU*/ -#define LV_USE_GPU_STM32_DMA2D 0 -#if LV_USE_GPU_STM32_DMA2D -/*Must be defined to include path of CMSIS header of target processor -e.g. "stm32f769xx.h" or "stm32f429xx.h"*/ -#define LV_GPU_DMA2D_CMSIS_INCLUDE -#endif - -/*Use NXP's PXP GPU iMX RTxxx platforms*/ -#define LV_USE_GPU_NXP_PXP 0 -#if LV_USE_GPU_NXP_PXP -/*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 FSL_RTOS_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() - */ -#define LV_USE_GPU_NXP_PXP_AUTO_INIT 0 -#endif - -/*Use NXP's VG-Lite GPU iMX RTxxx platforms*/ -#define LV_USE_GPU_NXP_VG_LITE 0 - /*------------- * Logging *-----------*/ /*Enable the log module*/ -#define LV_USE_LOG 1 +#define LV_USE_LOG 1 #if LV_USE_LOG -/*How important log should be added: - *LV_LOG_LEVEL_TRACE A lot of logs to give detailed information - *LV_LOG_LEVEL_INFO Log important events - *LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem - *LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail - *LV_LOG_LEVEL_USER Only logs added by the user - *LV_LOG_LEVEL_NONE Do not log anything*/ -# define LV_LOG_LEVEL LV_LOG_LEVEL_WARN + /*How important log should be added: + *LV_LOG_LEVEL_TRACE A lot of logs to give detailed information + *LV_LOG_LEVEL_INFO Log important events + *LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem + *LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail + *LV_LOG_LEVEL_USER Only logs added by the user + *LV_LOG_LEVEL_NONE Do not log anything*/ + #define LV_LOG_LEVEL LV_LOG_LEVEL_WARN -/*1: Print the log with 'printf'; - *0: User need to register a callback with `lv_log_register_print_cb()`*/ -# define LV_LOG_PRINTF 1 + /*1: Print the log with 'printf'; + *0: User need to register a callback with `lv_log_register_print_cb()`*/ + #define LV_LOG_PRINTF 1 -/*Enable/disable LV_LOG_TRACE in modules that produces a huge number of logs*/ -# define LV_LOG_TRACE_MEM 1 -# define LV_LOG_TRACE_TIMER 1 -# define LV_LOG_TRACE_INDEV 1 -# define LV_LOG_TRACE_DISP_REFR 1 -# define LV_LOG_TRACE_EVENT 1 -# define LV_LOG_TRACE_OBJ_CREATE 1 -# define LV_LOG_TRACE_LAYOUT 1 -# define LV_LOG_TRACE_ANIM 1 + /*1: Enable print timestamp; + *0: Disable print timestamp*/ + #define LV_LOG_USE_TIMESTAMP 1 + + /*1: Print file and line number of the log; + *0: Do not print file and line number of the log*/ + #define LV_LOG_USE_FILE_LINE 1 + + /*Enable/disable LV_LOG_TRACE in modules that produces a huge number of logs*/ + #define LV_LOG_TRACE_MEM 1 + #define LV_LOG_TRACE_TIMER 1 + #define LV_LOG_TRACE_INDEV 1 + #define LV_LOG_TRACE_DISP_REFR 1 + #define LV_LOG_TRACE_EVENT 1 + #define LV_LOG_TRACE_OBJ_CREATE 1 + #define LV_LOG_TRACE_LAYOUT 1 + #define LV_LOG_TRACE_ANIM 1 + #define LV_LOG_TRACE_CACHE 1 #endif /*LV_USE_LOG*/ @@ -173,53 +264,98 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h"*/ *If LV_USE_LOG is enabled an error message will be printed on failure*/ #define LV_USE_ASSERT_NULL 1 /*Check if the parameter is NULL. (Very fast, recommended)*/ #define LV_USE_ASSERT_MALLOC 1 /*Checks is the memory is successfully allocated or no. (Very fast, recommended)*/ -#define LV_USE_ASSERT_STYLE 1 /*Check if the styles are properly initialized. (Very fast, recommended)*/ -#define LV_USE_ASSERT_MEM_INTEGRITY 1 /*Check the integrity of `lv_mem` after critical operations. (Slow)*/ -#define LV_USE_ASSERT_OBJ 1 /*Check the object's type and existence (e.g. not deleted). (Slow)*/ +#define LV_USE_ASSERT_STYLE 0 /*Check if the styles are properly initialized. (Very fast, recommended)*/ +#define LV_USE_ASSERT_MEM_INTEGRITY 0 /*Check the integrity of `lv_mem` after critical operations. (Slow)*/ +#define LV_USE_ASSERT_OBJ 0 /*Check the object's type and existence (e.g. not deleted). (Slow)*/ /*Add a custom handler when assert happens e.g. to restart the MCU*/ -#define LV_ASSERT_HANDLER_INCLUDE -#define LV_ASSERT_HANDLER while(1); /*Halt by default*/ +#define LV_ASSERT_HANDLER_INCLUDE +#define LV_ASSERT_HANDLER while(1); /*Halt by default*/ + +/*------------- + * Debug + *-----------*/ + +/*1: Draw random colored rectangles over the redrawn areas*/ +#define LV_USE_REFR_DEBUG 0 + +/*1: Draw a red overlay for ARGB layers and a green overlay for RGB layers*/ +#define LV_USE_LAYER_DEBUG 0 + +/*1: Draw overlays with different colors for each draw_unit's tasks. + *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.*/ +#define LV_USE_PARALLEL_DRAW_DEBUG 0 /*------------- * Others *-----------*/ -/*1: Show CPU usage and FPS count in the right bottom corner*/ -#define LV_USE_PERF_MONITOR 1 +#define LV_ENABLE_GLOBAL_CUSTOM 0 +#if LV_ENABLE_GLOBAL_CUSTOM + /*Header to include for the custom 'lv_global' function"*/ + #define LV_GLOBAL_CUSTOM_INCLUDE +#endif -/*1: Show the used memory and the memory fragmentation in the left bottom corner - * Requires LV_MEM_CUSTOM = 0*/ -#define LV_USE_MEM_MONITOR 1 +/*Default cache size in bytes. + *Used by image decoders such as `lv_lodepng` to keep the decoded image in the memory. + *If size is not set to 0, the decoder will fail to decode when the cache is full. + *If size is 0, the cache function is not enabled and the decoded mem will be released immediately after use.*/ +#define LV_CACHE_DEF_SIZE 0 -/*1: Draw random colored rectangles over the redrawn areas*/ -#define LV_USE_REFR_DEBUG 0 +/*Default number of image header cache entries. The cache is used to store the headers of images + *The main logic is like `LV_CACHE_DEF_SIZE` but for image headers.*/ +#define LV_IMAGE_HEADER_CACHE_DEF_CNT 0 -/*Change the built in (v)snprintf functions*/ -#define LV_SPRINTF_CUSTOM 0 -#if LV_SPRINTF_CUSTOM -# define LV_SPRINTF_INCLUDE -# define lv_snprintf snprintf -# define lv_vsnprintf vsnprintf -#else /*LV_SPRINTF_CUSTOM*/ -# define LV_SPRINTF_USE_FLOAT 0 -#endif /*LV_SPRINTF_CUSTOM*/ +/*Number of stops allowed per gradient. Increase this to allow more stops. + *This adds (sizeof(lv_color_t) + 1) bytes per additional stop*/ +#define LV_GRADIENT_MAX_STOPS 2 -#define LV_USE_USER_DATA 1 +/* Adjust color mix functions rounding. GPUs might calculate color mix (blending) differently. + * 0: round down, 64: round up from x.75, 128: round up from half, 192: round up from x.25, 254: round up */ +#define LV_COLOR_MIX_ROUND_OFS 0 -/*Garbage Collector settings - *Used if lvgl is binded to higher level language and the memory is managed by that language*/ -#define LV_ENABLE_GC 0 -#if LV_ENABLE_GC != 0 -# define LV_GC_INCLUDE "gc.h" /*Include Garbage Collector related things*/ -#endif /*LV_ENABLE_GC*/ +/* Add 2 x 32 bit variables to each lv_obj_t to speed up getting style properties */ +#define LV_OBJ_STYLE_CACHE 0 + +/* Add `id` field to `lv_obj_t` */ +#define LV_USE_OBJ_ID 0 + +/* Use lvgl builtin method for obj ID */ +#define LV_USE_OBJ_ID_BUILTIN 0 + +/*Use obj property set/get API*/ +#define LV_USE_OBJ_PROPERTY 0 + +/* VG-Lite Simulator */ +/*Requires: LV_USE_THORVG_INTERNAL or LV_USE_THORVG_EXTERNAL */ +#define LV_USE_VG_LITE_THORVG 0 + +#if LV_USE_VG_LITE_THORVG + + /*Enable LVGL's blend mode support*/ + #define LV_VG_LITE_THORVG_LVGL_BLEND_SUPPORT 0 + + /*Enable YUV color format support*/ + #define LV_VG_LITE_THORVG_YUV_SUPPORT 0 + + /*Enable 16 pixels alignment*/ + #define LV_VG_LITE_THORVG_16PIXELS_ALIGN 1 + + /*Buffer address alignment*/ + #define LV_VG_LITE_THORVG_BUF_ADDR_ALIGN 64 + + /*Enable multi-thread render*/ + #define LV_VG_LITE_THORVG_THREAD_RENDER 0 + +#endif /*===================== * COMPILER SETTINGS *====================*/ /*For big endian systems set to 1*/ -#define LV_BIG_ENDIAN_SYSTEM 0 +#define LV_BIG_ENDIAN_SYSTEM 0 /*Define a custom attribute to `lv_tick_inc` function*/ #define LV_ATTRIBUTE_TICK_INC @@ -227,11 +363,11 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h"*/ /*Define a custom attribute to `lv_timer_handler` function*/ #define LV_ATTRIBUTE_TIMER_HANDLER -/*Define a custom attribute to `lv_disp_flush_ready` function*/ +/*Define a custom attribute to `lv_display_flush_ready` function*/ #define LV_ATTRIBUTE_FLUSH_READY /*Required alignment size for buffers*/ -#define LV_ATTRIBUTE_MEM_ALIGN_SIZE +#define LV_ATTRIBUTE_MEM_ALIGN_SIZE 1 /*Will be added where memories needs to be aligned (with -Os data might not be aligned to boundary by default). * E.g. __attribute__((aligned(4)))*/ @@ -240,21 +376,21 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h"*/ /*Attribute to mark large constant arrays for example font's bitmaps*/ #define LV_ATTRIBUTE_LARGE_CONST -/*Complier prefix for a big array declaration in RAM*/ +/*Compiler prefix for a big array declaration in RAM*/ #define LV_ATTRIBUTE_LARGE_RAM_ARRAY /*Place performance critical functions into a faster memory (e.g RAM)*/ #define LV_ATTRIBUTE_FAST_MEM -/*Prefix variables that are used in GPU accelerated operations, often these need to be placed in RAM sections that are DMA accessible*/ -#define LV_ATTRIBUTE_DMA - /*Export integer constant to binding. This macro is used with constants in the form of LV_ that *should also appear on LVGL binding API such as Micropython.*/ #define LV_EXPORT_CONST_INT(int_value) struct _silence_gcc_warning /*The default value just prevents GCC warning*/ -/*Extend the default -32k..32k coordinate range to -4M..4M by using int32_t for coordinates instead of int16_t*/ -#define LV_USE_LARGE_COORD 0 +/*Prefix all global extern data with this*/ +#define LV_ATTRIBUTE_EXTERN_DATA + +/* Use `float` as `lv_value_precise_t` */ +#define LV_USE_FLOAT 0 /*================== * FONT USAGE @@ -262,37 +398,36 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h"*/ /*Montserrat fonts with ASCII range and some symbols using bpp = 4 *https://fonts.google.com/specimen/Montserrat*/ -#define LV_FONT_MONTSERRAT_8 1 -#define LV_FONT_MONTSERRAT_10 1 -#define LV_FONT_MONTSERRAT_12 1 -#define LV_FONT_MONTSERRAT_14 1 -#define LV_FONT_MONTSERRAT_16 1 -#define LV_FONT_MONTSERRAT_18 1 -#define LV_FONT_MONTSERRAT_20 1 -#define LV_FONT_MONTSERRAT_22 1 -#define LV_FONT_MONTSERRAT_24 1 -#define LV_FONT_MONTSERRAT_26 1 -#define LV_FONT_MONTSERRAT_28 1 -#define LV_FONT_MONTSERRAT_30 1 -#define LV_FONT_MONTSERRAT_32 1 -#define LV_FONT_MONTSERRAT_34 1 -#define LV_FONT_MONTSERRAT_36 1 -#define LV_FONT_MONTSERRAT_38 1 -#define LV_FONT_MONTSERRAT_40 1 -#define LV_FONT_MONTSERRAT_42 1 -#define LV_FONT_MONTSERRAT_44 1 -#define LV_FONT_MONTSERRAT_46 1 -#define LV_FONT_MONTSERRAT_48 1 +#define LV_FONT_MONTSERRAT_8 0 +#define LV_FONT_MONTSERRAT_10 0 +#define LV_FONT_MONTSERRAT_12 0 +#define LV_FONT_MONTSERRAT_14 1 +#define LV_FONT_MONTSERRAT_16 0 +#define LV_FONT_MONTSERRAT_18 0 +#define LV_FONT_MONTSERRAT_20 0 +#define LV_FONT_MONTSERRAT_22 0 +#define LV_FONT_MONTSERRAT_24 0 +#define LV_FONT_MONTSERRAT_26 0 +#define LV_FONT_MONTSERRAT_28 0 +#define LV_FONT_MONTSERRAT_30 0 +#define LV_FONT_MONTSERRAT_32 0 +#define LV_FONT_MONTSERRAT_34 0 +#define LV_FONT_MONTSERRAT_36 0 +#define LV_FONT_MONTSERRAT_38 0 +#define LV_FONT_MONTSERRAT_40 0 +#define LV_FONT_MONTSERRAT_42 0 +#define LV_FONT_MONTSERRAT_44 0 +#define LV_FONT_MONTSERRAT_46 0 +#define LV_FONT_MONTSERRAT_48 0 /*Demonstrate special features*/ -#define LV_FONT_MONTSERRAT_12_SUBPX 1 -#define LV_FONT_MONTSERRAT_28_COMPRESSED 1 /*bpp = 3*/ -#define LV_FONT_DEJAVU_16_PERSIAN_HEBREW 1 /*Hebrew, Arabic, Perisan letters and all their forms*/ -#define LV_FONT_SIMSUN_16_CJK 1 /*1000 most common CJK radicals*/ +#define LV_FONT_MONTSERRAT_28_COMPRESSED 0 /*bpp = 3*/ +#define LV_FONT_DEJAVU_16_PERSIAN_HEBREW 0 /*Hebrew, Arabic, Persian letters and all their forms*/ +#define LV_FONT_SIMSUN_16_CJK 0 /*1000 most common CJK radicals*/ /*Pixel perfect monospace fonts*/ -#define LV_FONT_UNSCII_8 1 -#define LV_FONT_UNSCII_16 1 +#define LV_FONT_UNSCII_8 0 +#define LV_FONT_UNSCII_16 0 /*Optionally declare custom fonts here. *You can use these fonts as default font too and they will be available globally. @@ -305,17 +440,13 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h"*/ /*Enable handling large font and/or fonts with a lot of characters. *The limit depends on the font size, font face and bpp. *Compiler error will be triggered if a font needs it.*/ -#define LV_FONT_FMT_TXT_LARGE 1 +#define LV_FONT_FMT_TXT_LARGE 0 /*Enables/disables support for compressed fonts.*/ -#define LV_USE_FONT_COMPRESSED 1 +#define LV_USE_FONT_COMPRESSED 0 -/*Enable subpixel rendering*/ -#define LV_USE_FONT_SUBPX 1 -#if LV_USE_FONT_SUBPX -/*Set the pixel order of the display. Physical order of RGB channels. Doesn't matter with "normal" fonts.*/ -#define LV_FONT_SUBPX_BGR 0 /*0: RGB; 1:BGR order*/ -#endif +/*Enable drawing placeholders when glyph dsc is not found*/ +#define LV_USE_FONT_PLACEHOLDER 1 /*================= * TEXT SETTINGS @@ -329,185 +460,175 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h"*/ */ #define LV_TXT_ENC LV_TXT_ENC_UTF8 - /*Can break (wrap) texts on these chars*/ -#define LV_TXT_BREAK_CHARS " ,.;:-_" +/*Can break (wrap) texts on these chars*/ +#define LV_TXT_BREAK_CHARS " ,.;:-_)]}" /*If a word is at least this long, will break wherever "prettiest" *To disable, set to a value <= 0*/ -#define LV_TXT_LINE_BREAK_LONG_LEN 0 +#define LV_TXT_LINE_BREAK_LONG_LEN 0 /*Minimum number of characters in a long word to put on a line before a break. *Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/ -#define LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN 3 +#define LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN 3 /*Minimum number of characters in a long word to put on a line after a break. *Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/ #define LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN 3 -/*The control character to use for signalling text recoloring.*/ -#define LV_TXT_COLOR_CMD "#" - /*Support bidirectional texts. Allows mixing Left-to-Right and Right-to-Left texts. - *The direction will be processed according to the Unicode Bidirectioanl Algorithm: + *The direction will be processed according to the Unicode Bidirectional Algorithm: *https://www.w3.org/International/articles/inline-bidi-markup/uba-basics*/ -#define LV_USE_BIDI 1 +#define LV_USE_BIDI 0 #if LV_USE_BIDI -/*Set the default direction. Supported values: - *`LV_BASE_DIR_LTR` Left-to-Right - *`LV_BASE_DIR_RTL` Right-to-Left - *`LV_BASE_DIR_AUTO` detect texts base direction*/ -#define LV_BIDI_BASE_DIR_DEF LV_BASE_DIR_AUTO + /*Set the default direction. Supported values: + *`LV_BASE_DIR_LTR` Left-to-Right + *`LV_BASE_DIR_RTL` Right-to-Left + *`LV_BASE_DIR_AUTO` detect texts base direction*/ + #define LV_BIDI_BASE_DIR_DEF LV_BASE_DIR_AUTO #endif /*Enable Arabic/Persian processing *In these languages characters should be replaced with an other form based on their position in the text*/ -#define LV_USE_ARABIC_PERSIAN_CHARS 1 +#define LV_USE_ARABIC_PERSIAN_CHARS 0 /*================== - * WIDGET USAGE + * WIDGETS *================*/ /*Documentation of the widgets: https://docs.lvgl.io/latest/en/html/widgets/index.html*/ -#define LV_USE_ARC 1 +#define LV_WIDGETS_HAS_DEFAULT_VALUE 1 -#define LV_USE_ANIMIMG 1 +#define LV_USE_ANIMIMG 1 -#define LV_USE_BAR 1 +#define LV_USE_ARC 1 -#define LV_USE_BTN 1 +#define LV_USE_BAR 1 -#define LV_USE_BTNMATRIX 1 +#define LV_USE_BUTTON 1 -#define LV_USE_CANVAS 1 +#define LV_USE_BUTTONMATRIX 1 -#define LV_USE_CHECKBOX 1 - - -#define LV_USE_DROPDOWN 1 /*Requires: lv_label*/ - -#define LV_USE_IMG 1 /*Requires: lv_label*/ - -#define LV_USE_LABEL 1 -#if LV_USE_LABEL -# define LV_LABEL_TEXT_SELECTION 1 /*Enable selecting text of the label*/ -# define LV_LABEL_LONG_TXT_HINT 1 /*Store some extra info in labels to speed up drawing of very long texts*/ -#endif - -#define LV_USE_LINE 1 - -#define LV_USE_ROLLER 1 /*Requires: lv_label*/ -#if LV_USE_ROLLER -# define LV_ROLLER_INF_PAGES 7 /*Number of extra "pages" when the roller is infinite*/ -#endif - -#define LV_USE_SLIDER 1 /*Requires: lv_bar*/ - -#define LV_USE_SWITCH 1 - -#define LV_USE_TEXTAREA 1 /*Requires: lv_label*/ -#if LV_USE_TEXTAREA != 0 -# define LV_TEXTAREA_DEF_PWD_SHOW_TIME 1500 /*ms*/ -#endif - -#define LV_USE_TABLE 1 - -/*================== - * EXTRA COMPONENTS - *==================*/ - -/*----------- - * Widgets - *----------*/ -#define LV_USE_CALENDAR 1 +#define LV_USE_CALENDAR 1 #if LV_USE_CALENDAR -# define LV_CALENDAR_WEEK_STARTS_MONDAY 0 -# if LV_CALENDAR_WEEK_STARTS_MONDAY -# define LV_CALENDAR_DEFAULT_DAY_NAMES {"Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"} -# else -# define LV_CALENDAR_DEFAULT_DAY_NAMES {"Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"} -# endif + #define LV_CALENDAR_WEEK_STARTS_MONDAY 0 + #if LV_CALENDAR_WEEK_STARTS_MONDAY + #define LV_CALENDAR_DEFAULT_DAY_NAMES {"Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"} + #else + #define LV_CALENDAR_DEFAULT_DAY_NAMES {"Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"} + #endif -# define LV_CALENDAR_DEFAULT_MONTH_NAMES {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"} -# define LV_USE_CALENDAR_HEADER_ARROW 1 -# define LV_USE_CALENDAR_HEADER_DROPDOWN 1 + #define LV_CALENDAR_DEFAULT_MONTH_NAMES {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"} + #define LV_USE_CALENDAR_HEADER_ARROW 1 + #define LV_USE_CALENDAR_HEADER_DROPDOWN 1 #endif /*LV_USE_CALENDAR*/ -#define LV_USE_CHART 1 +#define LV_USE_CANVAS 1 -#define LV_USE_COLORWHEEL 1 +#define LV_USE_CHART 1 -#define LV_USE_IMGBTN 1 +#define LV_USE_CHECKBOX 1 -#define LV_USE_KEYBOARD 1 +#define LV_USE_DROPDOWN 1 /*Requires: lv_label*/ -#define LV_USE_LED 1 +#define LV_USE_IMAGE 1 /*Requires: lv_label*/ -#define LV_USE_LIST 1 +#define LV_USE_IMAGEBUTTON 1 -#define LV_USE_METER 1 +#define LV_USE_KEYBOARD 1 -#define LV_USE_MSGBOX 1 - -#define LV_USE_SPINBOX 1 - -#define LV_USE_SPINNER 1 - -#define LV_USE_TABVIEW 1 - -#define LV_USE_TILEVIEW 1 - -#define LV_USE_WIN 1 - -#define LV_USE_SPAN 1 -#if LV_USE_SPAN -/*A line text can contain maximum num of span descriptor */ -# define LV_SPAN_SNIPPET_STACK_SIZE 64 +#define LV_USE_LABEL 1 +#if LV_USE_LABEL + #define LV_LABEL_TEXT_SELECTION 1 /*Enable selecting text of the label*/ + #define LV_LABEL_LONG_TXT_HINT 1 /*Store some extra info in labels to speed up drawing of very long texts*/ + #define LV_LABEL_WAIT_CHAR_COUNT 3 /*The count of wait chart*/ #endif -/*----------- - * Themes - *----------*/ +#define LV_USE_LED 1 + +#define LV_USE_LINE 1 + +#define LV_USE_LIST 1 + +#define LV_USE_MENU 1 + +#define LV_USE_MSGBOX 1 + +#define LV_USE_ROLLER 1 /*Requires: lv_label*/ + +#define LV_USE_SCALE 1 + +#define LV_USE_SLIDER 1 /*Requires: lv_bar*/ + +#define LV_USE_SPAN 1 +#if LV_USE_SPAN + /*A line text can contain maximum num of span descriptor */ + #define LV_SPAN_SNIPPET_STACK_SIZE 64 +#endif + +#define LV_USE_SPINBOX 1 + +#define LV_USE_SPINNER 1 + +#define LV_USE_SWITCH 1 + +#define LV_USE_TEXTAREA 1 /*Requires: lv_label*/ +#if LV_USE_TEXTAREA != 0 + #define LV_TEXTAREA_DEF_PWD_SHOW_TIME 1500 /*ms*/ +#endif + +#define LV_USE_TABLE 1 + +#define LV_USE_TABVIEW 1 + +#define LV_USE_TILEVIEW 1 + +#define LV_USE_WIN 1 + +/*================== + * THEMES + *==================*/ + /*A simple, impressive and very complete theme*/ -#define LV_USE_THEME_DEFAULT 1 +#define LV_USE_THEME_DEFAULT 1 #if LV_USE_THEME_DEFAULT -/*0: Light mode; 1: Dark mode*/ -# define LV_THEME_DEFAULT_DARK 0 + /*0: Light mode; 1: Dark mode*/ + #define LV_THEME_DEFAULT_DARK 0 -/*1: Enable grow on press*/ -# define LV_THEME_DEFAULT_GROW 1 + /*1: Enable grow on press*/ + #define LV_THEME_DEFAULT_GROW 1 -/*Default transition time in [ms]*/ -# define LV_THEME_DEFAULT_TRANSITON_TIME 80 + /*Default transition time in [ms]*/ + #define LV_THEME_DEFAULT_TRANSITION_TIME 80 #endif /*LV_USE_THEME_DEFAULT*/ -/*An very simple them that is a good starting point for a custom theme*/ - #define LV_USE_THEME_BASIC 1 +/*A very simple theme that is a good starting point for a custom theme*/ +#define LV_USE_THEME_SIMPLE 1 /*A theme designed for monochrome displays*/ -#define LV_USE_THEME_MONO 1 +#define LV_USE_THEME_MONO 1 -/*----------- - * Layouts - *----------*/ +/*================== + * LAYOUTS + *==================*/ /*A layout similar to Flexbox in CSS.*/ -#define LV_USE_FLEX 1 +#define LV_USE_FLEX 1 /*A layout similar to Grid in CSS.*/ -#define LV_USE_GRID 1 +#define LV_USE_GRID 1 -/*--------------------- - * 3rd party libraries - *--------------------*/ +/*==================== + * 3RD PARTS LIBRARIES + *====================*/ /*File system interfaces for common APIs */ /*API for fopen, fread, etc*/ -#define LV_USE_FS_STDIO 1 +#define LV_USE_FS_STDIO 0 #if LV_USE_FS_STDIO - #define LV_FS_STDIO_LETTER 'A' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ + #define LV_FS_STDIO_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ #define LV_FS_STDIO_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/ #define LV_FS_STDIO_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/ #endif @@ -535,42 +656,91 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h"*/ #define LV_FS_FATFS_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/ #endif -/*PNG decoder library*/ -#define LV_USE_PNG 0 +/*API for memory-mapped file access. */ +#define LV_USE_FS_MEMFS 0 +#if LV_USE_FS_MEMFS + #define LV_FS_MEMFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ +#endif + +/*API for LittleFs. */ +#define LV_USE_FS_LITTLEFS 0 +#if LV_USE_FS_LITTLEFS + #define LV_FS_LITTLEFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ +#endif + +/*LODEPNG decoder library*/ +#define LV_USE_LODEPNG 0 + +/*PNG decoder(libpng) library*/ +#define LV_USE_LIBPNG 0 /*BMP decoder library*/ #define LV_USE_BMP 0 /* JPG + split JPG decoder library. * Split JPG is a custom format optimized for embedded systems. */ -#define LV_USE_SJPG 0 +#define LV_USE_TJPGD 0 + +/* libjpeg-turbo decoder library. + * Supports complete JPEG specifications and high-performance JPEG decoding. */ +#define LV_USE_LIBJPEG_TURBO 0 /*GIF decoder library*/ #define LV_USE_GIF 0 +#if LV_USE_GIF +/*GIF decoder accelerate*/ +#define LV_GIF_CACHE_DECODE_DATA 0 +#endif + + +/*Decode bin images to RAM*/ +#define LV_BIN_DECODER_RAM_LOAD 0 + +/*RLE decompress library*/ +#define LV_USE_RLE 0 /*QR code library*/ #define LV_USE_QRCODE 0 +/*Barcode code library*/ +#define LV_USE_BARCODE 0 + /*FreeType library*/ #define LV_USE_FREETYPE 0 #if LV_USE_FREETYPE - /*Memory used by FreeType to cache characters [bytes] (-1: no caching)*/ - #define LV_FREETYPE_CACHE_SIZE (16 * 1024) - #if LV_FREETYPE_CACHE_SIZE >= 0 - /* 1: bitmap cache use the sbit cache, 0:bitmap cache use the image cache. */ - /* sbit cache:it is much more memory efficient for small bitmaps(font size < 256) */ - /* if font size >= 256, must be configured as image cache */ - #define LV_FREETYPE_SBIT_CACHE 0 - /* Maximum number of opened FT_Face/FT_Size objects managed by this cache instance. */ - /* (0:use system defaults) */ - #define LV_FREETYPE_CACHE_FT_FACES 0 - #define LV_FREETYPE_CACHE_FT_SIZES 0 - #endif + /*Let FreeType to use LVGL memory and file porting*/ + #define LV_FREETYPE_USE_LVGL_PORT 0 + + /*Cache count of the glyphs in FreeType. It means the number of glyphs that can be cached. + *The higher the value, the more memory will be used.*/ + #define LV_FREETYPE_CACHE_FT_GLYPH_CNT 256 +#endif + +/* Built-in TTF decoder */ +#define LV_USE_TINY_TTF 0 +#if LV_USE_TINY_TTF + /* Enable loading TTF data from files */ + #define LV_TINY_TTF_FILE_SUPPORT 0 #endif /*Rlottie library*/ #define LV_USE_RLOTTIE 0 +/*Enable Vector Graphic APIs*/ +#define LV_USE_VECTOR_GRAPHIC 0 + +/* Enable ThorVG (vector graphics library) from the src/libs folder */ +#define LV_USE_THORVG_INTERNAL 0 + +/* Enable ThorVG by assuming that its installed and linked to the project */ +#define LV_USE_THORVG_EXTERNAL 0 + +/*Use lvgl built-in LZ4 lib*/ +#define LV_USE_LZ4_INTERNAL 0 + +/*Use external LZ4 library*/ +#define LV_USE_LZ4_EXTERNAL 0 + /*FFmpeg library for image decoding and playing videos *Supports all major image formats so do not enable other image decoder with it*/ #define LV_USE_FFMPEG 0 @@ -579,13 +749,249 @@ e.g. "stm32f769xx.h" or "stm32f429xx.h"*/ #define LV_FFMPEG_DUMP_FORMAT 0 #endif +/*================== + * OTHERS + *==================*/ + +/*1: Enable API to take snapshot for object*/ +#define LV_USE_SNAPSHOT 0 + +/*1: Enable system monitor component*/ +#define LV_USE_SYSMON 0 +#if LV_USE_SYSMON + /*Get the idle percentage. E.g. uint32_t my_get_idle(void);*/ + #define LV_SYSMON_GET_IDLE lv_timer_get_idle + + /*1: Show CPU usage and FPS count + * Requires `LV_USE_SYSMON = 1`*/ + #define LV_USE_PERF_MONITOR 0 + #if LV_USE_PERF_MONITOR + #define LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT + + /*0: Displays performance data on the screen, 1: Prints performance data using log.*/ + #define LV_USE_PERF_MONITOR_LOG_MODE 0 + #endif + + /*1: Show the used memory and the memory fragmentation + * Requires `LV_USE_STDLIB_MALLOC = LV_STDLIB_BUILTIN` + * Requires `LV_USE_SYSMON = 1`*/ + #define LV_USE_MEM_MONITOR 0 + #if LV_USE_MEM_MONITOR + #define LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_LEFT + #endif + +#endif /*LV_USE_SYSMON*/ + +/*1: Enable the runtime performance profiler*/ +#define LV_USE_PROFILER 0 +#if LV_USE_PROFILER + /*1: Enable the built-in profiler*/ + #define LV_USE_PROFILER_BUILTIN 1 + #if LV_USE_PROFILER_BUILTIN + /*Default profiler trace buffer size*/ + #define LV_PROFILER_BUILTIN_BUF_SIZE (16 * 1024) /*[bytes]*/ + #endif + + /*Header to include for the profiler*/ + #define LV_PROFILER_INCLUDE "lvgl/src/misc/lv_profiler_builtin.h" + + /*Profiler start point function*/ + #define LV_PROFILER_BEGIN LV_PROFILER_BUILTIN_BEGIN + + /*Profiler end point function*/ + #define LV_PROFILER_END LV_PROFILER_BUILTIN_END + + /*Profiler start point function with custom tag*/ + #define LV_PROFILER_BEGIN_TAG LV_PROFILER_BUILTIN_BEGIN_TAG + + /*Profiler end point function with custom tag*/ + #define LV_PROFILER_END_TAG LV_PROFILER_BUILTIN_END_TAG +#endif + +/*1: Enable Monkey test*/ +#define LV_USE_MONKEY 0 + +/*1: Enable grid navigation*/ +#define LV_USE_GRIDNAV 0 + +/*1: Enable lv_obj fragment*/ +#define LV_USE_FRAGMENT 0 + +/*1: Support using images as font in label or span widgets */ +#define LV_USE_IMGFONT 0 + +/*1: Enable an observer pattern implementation*/ +#define LV_USE_OBSERVER 1 + +/*1: Enable Pinyin input method*/ +/*Requires: lv_keyboard*/ +#define LV_USE_IME_PINYIN 0 +#if LV_USE_IME_PINYIN + /*1: Use default thesaurus*/ + /*If you do not use the default thesaurus, be sure to use `lv_ime_pinyin` after setting the thesauruss*/ + #define LV_IME_PINYIN_USE_DEFAULT_DICT 1 + /*Set the maximum number of candidate panels that can be displayed*/ + /*This needs to be adjusted according to the size of the screen*/ + #define LV_IME_PINYIN_CAND_TEXT_NUM 6 + + /*Use 9 key input(k9)*/ + #define LV_IME_PINYIN_USE_K9_MODE 1 + #if LV_IME_PINYIN_USE_K9_MODE == 1 + #define LV_IME_PINYIN_K9_CAND_TEXT_NUM 3 + #endif /*LV_IME_PINYIN_USE_K9_MODE*/ +#endif + +/*1: Enable file explorer*/ +/*Requires: lv_table*/ +#define LV_USE_FILE_EXPLORER 0 +#if LV_USE_FILE_EXPLORER + /*Maximum length of path*/ + #define LV_FILE_EXPLORER_PATH_MAX_LEN (128) + /*Quick access bar, 1:use, 0:not use*/ + /*Requires: lv_list*/ + #define LV_FILE_EXPLORER_QUICK_ACCESS 1 +#endif + +/*================== + * DEVICES + *==================*/ + +/*Use SDL to open window on PC and handle mouse and keyboard*/ +#define LV_USE_SDL 1 +#if LV_USE_SDL + #define LV_SDL_INCLUDE_PATH + #define LV_SDL_RENDER_MODE LV_DISPLAY_RENDER_MODE_DIRECT /*LV_DISPLAY_RENDER_MODE_DIRECT is recommended for best performance*/ + #define LV_SDL_BUF_COUNT 1 /*1 or 2*/ + #define LV_SDL_FULLSCREEN 0 /*1: Make the window full screen by default*/ + #define LV_SDL_DIRECT_EXIT 1 /*1: Exit the application when all SDL windows are closed*/ + #define LV_SDL_MOUSEWHEEL_MODE LV_SDL_MOUSEWHEEL_MODE_ENCODER /*LV_SDL_MOUSEWHEEL_MODE_ENCODER/CROWN*/ +#endif + +/*Use X11 to open window on Linux desktop and handle mouse and keyboard*/ +#define LV_USE_X11 0 +#if LV_USE_X11 + #define LV_X11_DIRECT_EXIT 1 /*Exit the application when all X11 windows have been closed*/ + #define LV_X11_DOUBLE_BUFFER 1 /*Use double buffers for endering*/ + /*select only 1 of the following render modes (LV_X11_RENDER_MODE_PARTIAL preferred!)*/ + #define LV_X11_RENDER_MODE_PARTIAL 1 /*Partial render mode (preferred)*/ + #define LV_X11_RENDER_MODE_DIRECT 0 /*direct render mode*/ + #define LV_X11_RENDER_MODE_FULL 0 /*Full render mode*/ +#endif + +/*Driver for /dev/fb*/ +#define LV_USE_LINUX_FBDEV 0 +#if LV_USE_LINUX_FBDEV + #define LV_LINUX_FBDEV_BSD 0 + #define LV_LINUX_FBDEV_RENDER_MODE LV_DISPLAY_RENDER_MODE_PARTIAL + #define LV_LINUX_FBDEV_BUFFER_COUNT 0 + #define LV_LINUX_FBDEV_BUFFER_SIZE 60 +#endif + +/*Use Nuttx to open window and handle touchscreen*/ +#define LV_USE_NUTTX 0 + +#if LV_USE_NUTTX + #define LV_USE_NUTTX_LIBUV 0 + + /*Use Nuttx custom init API to open window and handle touchscreen*/ + #define LV_USE_NUTTX_CUSTOM_INIT 0 + + /*Driver for /dev/lcd*/ + #define LV_USE_NUTTX_LCD 0 + #if LV_USE_NUTTX_LCD + #define LV_NUTTX_LCD_BUFFER_COUNT 0 + #define LV_NUTTX_LCD_BUFFER_SIZE 60 + #endif + + /*Driver for /dev/input*/ + #define LV_USE_NUTTX_TOUCHSCREEN 0 + +#endif + +/*Driver for /dev/dri/card*/ +#define LV_USE_LINUX_DRM 0 + +/*Interface for TFT_eSPI*/ +#define LV_USE_TFT_ESPI 0 + +/*Driver for evdev input devices*/ +#define LV_USE_EVDEV 0 + +/*Driver for libinput input devices*/ +#define LV_USE_LIBINPUT 0 + +#if LV_USE_LIBINPUT + #define LV_LIBINPUT_BSD 0 + + /*Full keyboard support*/ + #define LV_LIBINPUT_XKB 0 + #if LV_LIBINPUT_XKB + /*"setxkbmap -query" can help find the right values for your keyboard*/ + #define LV_LIBINPUT_XKB_KEY_MAP { .rules = NULL, .model = "pc101", .layout = "us", .variant = NULL, .options = NULL } + #endif +#endif + +/*Drivers for LCD devices connected via SPI/parallel port*/ +#define LV_USE_ST7735 0 +#define LV_USE_ST7789 0 +#define LV_USE_ST7796 0 +#define LV_USE_ILI9341 0 + +#define LV_USE_GENERIC_MIPI (LV_USE_ST7735 | LV_USE_ST7789 | LV_USE_ST7796 | LV_USE_ILI9341) + +/* LVGL Windows backend */ +#define LV_USE_WINDOWS 0 + /*================== * EXAMPLES *==================*/ /*Enable the examples to be built with the library*/ -#define LV_BUILD_EXAMPLES 1 +#define LV_BUILD_EXAMPLES 1 +/*=================== + * DEMO USAGE + ====================*/ + +/*Show some widget. It might be required to increase `LV_MEM_SIZE` */ +#define LV_USE_DEMO_WIDGETS 1 + +/*Demonstrate the usage of encoder and keyboard*/ +#define LV_USE_DEMO_KEYPAD_AND_ENCODER 0 + +/*Benchmark your system*/ +#define LV_USE_DEMO_BENCHMARK 0 + +/*Render test for each primitives. Requires at least 480x272 display*/ +#define LV_USE_DEMO_RENDER 0 + +/*Stress test for LVGL*/ +#define LV_USE_DEMO_STRESS 0 + +/*Music player demo*/ +#define LV_USE_DEMO_MUSIC 0 +#if LV_USE_DEMO_MUSIC + #define LV_DEMO_MUSIC_SQUARE 0 + #define LV_DEMO_MUSIC_LANDSCAPE 0 + #define LV_DEMO_MUSIC_ROUND 0 + #define LV_DEMO_MUSIC_LARGE 0 + #define LV_DEMO_MUSIC_AUTO_PLAY 0 +#endif + +/*Flex layout demo*/ +#define LV_USE_DEMO_FLEX_LAYOUT 0 + +/*Smart-phone like multi-language demo*/ +#define LV_USE_DEMO_MULTILANG 0 + +/*Widget transformation demo*/ +#define LV_USE_DEMO_TRANSFORM 0 + +/*Demonstrate scroll settings*/ +#define LV_USE_DEMO_SCROLL 0 + +/*Vector graphic demo*/ +#define LV_USE_DEMO_VECTOR_GRAPHIC 0 /*--END OF LV_CONF_H--*/ #endif /*LV_CONF_H*/ diff --git a/lv_demo_conf.h b/lv_demo_conf.h deleted file mode 100644 index c4a27fd..0000000 --- a/lv_demo_conf.h +++ /dev/null @@ -1,60 +0,0 @@ -/** - * @file lv_demo_conf.h - * Configuration file for v8.0.0 - * - */ -/* - * COPY THIS FILE AS lv_demo_conf.h - */ - -#if 1 /*Set it to "1" to enable the content*/ - -#ifndef LV_EX_CONF_H -#define LV_EX_CONF_H - -/*==================== - SIMULATION SETTINGS - *====================*/ -#define DISP_HOR_RES 800 -#define DISP_VER_RES 600 - -/******************* - * GENERAL SETTING - *******************/ -#define LV_EX_PRINTF 1 /*Enable printf-ing data in demoes and examples*/ -#define LV_EX_KEYBOARD 1 /*Add PC keyboard support to some examples (`lv_drivers` repository is required)*/ -#define LV_EX_MOUSEWHEEL 1 /*Add 'encoder' (mouse wheel) support to some examples (`lv_drivers` repository is required)*/ - -/********************* - * DEMO USAGE - *********************/ - -/*Show some widget*/ -#define LV_USE_DEMO_WIDGETS 1 -#if LV_USE_DEMO_WIDGETS -#define LV_DEMO_WIDGETS_SLIDESHOW 0 -#endif - -/*Printer demo, optimized for 800x480*/ -#define LV_USE_DEMO_PRINTER 0 - -/*Demonstrate the usage of encoder and keyboard*/ -#define LV_USE_DEMO_KEYPAD_AND_ENCODER 1 - -/*Benchmark your system*/ -#define LV_USE_DEMO_BENCHMARK 1 - -/*Stress test for LVGL*/ -#define LV_USE_DEMO_STRESS 1 - -/*Music player demo*/ -#define LV_USE_DEMO_MUSIC 1 -#if LV_USE_DEMO_MUSIC -# define LV_DEMO_MUSIC_LANDSCAPE 0 -# define LV_DEMO_MUSIC_LARGE 0 -#define LV_DEMO_MUSIC_AUTO_PLAY 0 -#endif - -#endif /*LV_EX_CONF_H*/ - -#endif /*End of "Content enable"*/ diff --git a/lv_drivers b/lv_drivers deleted file mode 160000 index 5a5b4a1..0000000 --- a/lv_drivers +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5a5b4a1a3e95a46e6cf58ac6aac6ed6e826bfedd diff --git a/lv_drv_conf.h b/lv_drv_conf.h deleted file mode 100644 index 791906b..0000000 --- a/lv_drv_conf.h +++ /dev/null @@ -1,517 +0,0 @@ -/** - * @file lv_drv_conf.h - * Configuration file for v9.0.0-dev - */ - -/* - * COPY THIS FILE AS lv_drv_conf.h - */ - -/* clang-format off */ -#if 1 /*Set it to "1" to enable the content*/ - -#ifndef LV_DRV_CONF_H -#define LV_DRV_CONF_H - -#include "lv_conf.h" - -/********************* - * DELAY INTERFACE - *********************/ -#define LV_DRV_DELAY_INCLUDE /*Dummy include by default*/ -#define LV_DRV_DELAY_US(us) /*delay_us(us)*/ /*Delay the given number of microseconds*/ -#define LV_DRV_DELAY_MS(ms) /*delay_ms(ms)*/ /*Delay the given number of milliseconds*/ - -/********************* - * DISPLAY INTERFACE - *********************/ - -/*------------ - * Common - *------------*/ -#define LV_DRV_DISP_INCLUDE /*Dummy include by default*/ -#define LV_DRV_DISP_CMD_DATA(val) /*pin_x_set(val)*/ /*Set the command/data pin to 'val'*/ -#define LV_DRV_DISP_RST(val) /*pin_x_set(val)*/ /*Set the reset pin to 'val'*/ - -/*--------- - * SPI - *---------*/ -#define LV_DRV_DISP_SPI_CS(val) /*spi_cs_set(val)*/ /*Set the SPI's Chip select to 'val'*/ -#define LV_DRV_DISP_SPI_WR_BYTE(data) /*spi_wr(data)*/ /*Write a byte the SPI bus*/ -#define LV_DRV_DISP_SPI_WR_ARRAY(adr, n) /*spi_wr_mem(adr, n)*/ /*Write 'n' bytes to SPI bus from 'adr'*/ - -/*------------------ - * Parallel port - *-----------------*/ -#define LV_DRV_DISP_PAR_CS(val) /*par_cs_set(val)*/ /*Set the Parallel port's Chip select to 'val'*/ -#define LV_DRV_DISP_PAR_SLOW /*par_slow()*/ /*Set low speed on the parallel port*/ -#define LV_DRV_DISP_PAR_FAST /*par_fast()*/ /*Set high speed on the parallel port*/ -#define LV_DRV_DISP_PAR_WR_WORD(data) /*par_wr(data)*/ /*Write a word to the parallel port*/ -#define LV_DRV_DISP_PAR_WR_ARRAY(adr, n) /*par_wr_mem(adr,n)*/ /*Write 'n' bytes to Parallel ports from 'adr'*/ - -/*************************** - * INPUT DEVICE INTERFACE - ***************************/ - -/*---------- - * Common - *----------*/ -#define LV_DRV_INDEV_INCLUDE /*Dummy include by default*/ -#define LV_DRV_INDEV_RST(val) /*pin_x_set(val)*/ /*Set the reset pin to 'val'*/ -#define LV_DRV_INDEV_IRQ_READ 0 /*pn_x_read()*/ /*Read the IRQ pin*/ - -/*--------- - * SPI - *---------*/ -#define LV_DRV_INDEV_SPI_CS(val) /*spi_cs_set(val)*/ /*Set the SPI's Chip select to 'val'*/ -#define LV_DRV_INDEV_SPI_XCHG_BYTE(data) 0 /*spi_xchg(val)*/ /*Write 'val' to SPI and give the read value*/ - -/*--------- - * I2C - *---------*/ -#define LV_DRV_INDEV_I2C_START /*i2c_start()*/ /*Make an I2C start*/ -#define LV_DRV_INDEV_I2C_STOP /*i2c_stop()*/ /*Make an I2C stop*/ -#define LV_DRV_INDEV_I2C_RESTART /*i2c_restart()*/ /*Make an I2C restart*/ -#define LV_DRV_INDEV_I2C_WR(data) /*i2c_wr(data)*/ /*Write a byte to the I1C bus*/ -#define LV_DRV_INDEV_I2C_READ(last_read) 0 /*i2c_rd()*/ /*Read a byte from the I2C bud*/ - - -/********************* - * DISPLAY DRIVERS - *********************/ - -/*------------------- - * SDL - *-------------------*/ - -/* SDL based drivers for display, mouse, mousewheel and keyboard*/ -#ifndef USE_SDL -# define USE_SDL 0 -#endif - -/* Hardware accelerated SDL driver */ -#ifndef USE_SDL_GPU -# define USE_SDL_GPU 0 -#endif - -#if USE_SDL || USE_SDL_GPU -# define SDL_HOR_RES 1024 -# define SDL_VER_RES 1080 - -#define MONITOR_HOR_RES SDL_HOR_RES -#define MONITOR_VER_RES SDL_VER_RES - -/* Scale window by this factor (useful when simulating small screens) */ -# define SDL_ZOOM 1 - -/* Used to test true double buffering with only address changing. - * Use 2 draw buffers, bith with SDL_HOR_RES x SDL_VER_RES size*/ -# define SDL_DOUBLE_BUFFERED 0 - -/*Eclipse: Visual Studio: */ -# define SDL_INCLUDE_PATH - -/*Open two windows to test multi display support*/ -# define SDL_DUAL_DISPLAY 0 - -/* Window Title */ -# define SDL_WINDOW_TITLE "TFT Simulator" -#endif - -/*------------------- - * Monitor of PC - *-------------------*/ - -/*DEPRECATED: Use the SDL driver instead. */ -#ifndef USE_MONITOR -# define USE_MONITOR 0 -#endif - -#if USE_MONITOR -# define MONITOR_HOR_RES 480 -# define MONITOR_VER_RES 320 - -/* Scale window by this factor (useful when simulating small screens) */ -# define MONITOR_ZOOM 1 - -/* Used to test true double buffering with only address changing. - * Use 2 draw buffers, bith with MONITOR_HOR_RES x MONITOR_VER_RES size*/ -# define MONITOR_DOUBLE_BUFFERED 0 - -/*Eclipse: Visual Studio: */ -# define MONITOR_SDL_INCLUDE_PATH - -/*Open two windows to test multi display support*/ -# define MONITOR_DUAL 0 -#endif - -/*----------------------------------- - * Native Windows (including mouse) - *----------------------------------*/ -#ifndef USE_WINDOWS -# define USE_WINDOWS 0 -#endif - -#if USE_WINDOWS -# define WINDOW_HOR_RES 480 -# define WINDOW_VER_RES 320 -#endif - -/*---------------------------- - * Native Windows (win32drv) - *---------------------------*/ -#ifndef USE_WIN32DRV -# define USE_WIN32DRV 0 -#endif - -#if USE_WIN32DRV -/* Scale window by this factor (useful when simulating small screens) */ -# define WIN32DRV_MONITOR_ZOOM 1 -#endif - -/*---------------------------------------- - * GTK drivers (monitor, mouse, keyboard - *---------------------------------------*/ -#ifndef USE_GTK -# define USE_GTK 0 -#endif - -/*---------------------------------------- - * Wayland drivers (monitor, mouse, keyboard, touchscreen) - *---------------------------------------*/ -#ifndef USE_WAYLAND -# define USE_WAYLAND 0 -#endif - -#if USE_WAYLAND -/* Support for client-side decorations */ -# ifndef LV_WAYLAND_CLIENT_SIDE_DECORATIONS -# define LV_WAYLAND_CLIENT_SIDE_DECORATIONS 1 -# endif -/* Support for (deprecated) wl-shell protocol */ -# ifndef LV_WAYLAND_WL_SHELL -# define LV_WAYLAND_WL_SHELL 1 -# endif -/* Support for xdg-shell protocol */ -# ifndef LV_WAYLAND_XDG_SHELL -# define LV_WAYLAND_XDG_SHELL 0 -# endif -#endif - -/*---------------------------------------- - * X11 drivers (monitor, mouse, keyboard) - *---------------------------------------*/ -#ifndef USE_X11 -# define USE_X11 0 -#endif - -#if USE_X11 - /* Simulated screen resolution */ - #ifndef DISP_HOR_RES - #define DISP_HOR_RES 480 - #endif - #ifndef DISP_VER_RES - #define DISP_VER_RES 320 - #endif -#endif // USE_X11 - -/*---------------- - * SSD1963 - *--------------*/ -#ifndef USE_SSD1963 -# define USE_SSD1963 0 -#endif - -#if USE_SSD1963 -# define SSD1963_HOR_RES LV_HOR_RES -# define SSD1963_VER_RES LV_VER_RES -# define SSD1963_HT 531 -# define SSD1963_HPS 43 -# define SSD1963_LPS 8 -# define SSD1963_HPW 10 -# define SSD1963_VT 288 -# define SSD1963_VPS 12 -# define SSD1963_FPS 4 -# define SSD1963_VPW 10 -# define SSD1963_HS_NEG 0 /*Negative hsync*/ -# define SSD1963_VS_NEG 0 /*Negative vsync*/ -# define SSD1963_ORI 0 /*0, 90, 180, 270*/ -# define SSD1963_COLOR_DEPTH 16 -#endif - -/*---------------- - * R61581 - *--------------*/ -#ifndef USE_R61581 -# define USE_R61581 0 -#endif - -#if USE_R61581 -# define R61581_HOR_RES LV_HOR_RES -# define R61581_VER_RES LV_VER_RES -# define R61581_HSPL 0 /*HSYNC signal polarity*/ -# define R61581_HSL 10 /*HSYNC length (Not Implemented)*/ -# define R61581_HFP 10 /*Horitontal Front poarch (Not Implemented)*/ -# define R61581_HBP 10 /*Horitontal Back poarch (Not Implemented */ -# define R61581_VSPL 0 /*VSYNC signal polarity*/ -# define R61581_VSL 10 /*VSYNC length (Not Implemented)*/ -# define R61581_VFP 8 /*Vertical Front poarch*/ -# define R61581_VBP 8 /*Vertical Back poarch */ -# define R61581_DPL 0 /*DCLK signal polarity*/ -# define R61581_EPL 1 /*ENABLE signal polarity*/ -# define R61581_ORI 0 /*0, 180*/ -# define R61581_LV_COLOR_DEPTH 16 /*Fix 16 bit*/ -#endif - -/*------------------------------ - * ST7565 (Monochrome, low res.) - *-----------------------------*/ -#ifndef USE_ST7565 -# define USE_ST7565 0 -#endif - -#if USE_ST7565 -/*No settings*/ -#endif /*USE_ST7565*/ - -/*------------------------------ - * GC9A01 (color, low res.) - *-----------------------------*/ -#ifndef USE_GC9A01 -# define USE_GC9A01 0 -#endif - -#if USE_GC9A01 -/*No settings*/ -#endif /*USE_GC9A01*/ - -/*------------------------------------------ - * UC1610 (4 gray 160*[104|128]) - * (EA DOGXL160 160x104 tested) - *-----------------------------------------*/ -#ifndef USE_UC1610 -# define USE_UC1610 0 -#endif - -#if USE_UC1610 -# define UC1610_HOR_RES LV_HOR_RES -# define UC1610_VER_RES LV_VER_RES -# define UC1610_INIT_CONTRAST 33 /* init contrast, values in [%] */ -# define UC1610_INIT_HARD_RST 0 /* 1 : hardware reset at init, 0 : software reset */ -# define UC1610_TOP_VIEW 0 /* 0 : Bottom View, 1 : Top View */ -#endif /*USE_UC1610*/ - -/*------------------------------------------------- - * SHARP memory in pixel monochrome display series - * LS012B7DD01 (184x38 pixels.) - * LS013B7DH03 (128x128 pixels.) - * LS013B7DH05 (144x168 pixels.) - * LS027B7DH01 (400x240 pixels.) (tested) - * LS032B7DD02 (336x536 pixels.) - * LS044Q7DH01 (320x240 pixels.) - *------------------------------------------------*/ -#ifndef USE_SHARP_MIP -# define USE_SHARP_MIP 0 -#endif - -#if USE_SHARP_MIP -# define SHARP_MIP_HOR_RES LV_HOR_RES -# define SHARP_MIP_VER_RES LV_VER_RES -# define SHARP_MIP_SOFT_COM_INVERSION 0 -# define SHARP_MIP_REV_BYTE(b) /*((uint8_t) __REV(__RBIT(b)))*/ /*Architecture / compiler dependent byte bits order reverse*/ -#endif /*USE_SHARP_MIP*/ - -/*------------------------------------------------- - * ILI9341 240X320 TFT LCD - *------------------------------------------------*/ -#ifndef USE_ILI9341 -# define USE_ILI9341 0 -#endif - -#if USE_ILI9341 -# define ILI9341_HOR_RES LV_HOR_RES -# define ILI9341_VER_RES LV_VER_RES -# define ILI9341_GAMMA 1 -# define ILI9341_TEARING 0 -#endif /*USE_ILI9341*/ - -/*----------------------------------------- - * Linux frame buffer device (/dev/fbx) - *-----------------------------------------*/ -#ifndef USE_FBDEV -# define USE_FBDEV 0 -#endif - -#if USE_FBDEV -# define FBDEV_PATH "/dev/fb0" -#endif - -/*----------------------------------------- - * FreeBSD frame buffer device (/dev/fbx) - *.........................................*/ -#ifndef USE_BSD_FBDEV -# define USE_BSD_FBDEV 0 -#endif - -#if USE_BSD_FBDEV -# define FBDEV_PATH "/dev/fb0" -#endif - -/*----------------------------------------- - * DRM/KMS device (/dev/dri/cardX) - *-----------------------------------------*/ -#ifndef USE_DRM -# define USE_DRM 0 -#endif - -#if USE_DRM -# define DRM_CARD "/dev/dri/card0" -# define DRM_CONNECTOR_ID -1 /* -1 for the first connected one */ -#endif - -/********************* - * INPUT DEVICES - *********************/ - -/*-------------- - * XPT2046 - *--------------*/ -#ifndef USE_XPT2046 -# define USE_XPT2046 0 -#endif - -#if USE_XPT2046 -# define XPT2046_HOR_RES 480 -# define XPT2046_VER_RES 320 -# define XPT2046_X_MIN 200 -# define XPT2046_Y_MIN 200 -# define XPT2046_X_MAX 3800 -# define XPT2046_Y_MAX 3800 -# define XPT2046_AVG 4 -# define XPT2046_X_INV 0 -# define XPT2046_Y_INV 0 -# define XPT2046_XY_SWAP 0 -#endif - -/*----------------- - * FT5406EE8 - *-----------------*/ -#ifndef USE_FT5406EE8 -# define USE_FT5406EE8 0 -#endif - -#if USE_FT5406EE8 -# define FT5406EE8_I2C_ADR 0x38 /*7 bit address*/ -#endif - -/*--------------- - * AD TOUCH - *--------------*/ -#ifndef USE_AD_TOUCH -# define USE_AD_TOUCH 0 -#endif - -#if USE_AD_TOUCH -/*No settings*/ -#endif - - -/*--------------------------------------- - * Mouse or touchpad on PC (using SDL) - *-------------------------------------*/ -/*DEPRECATED: Use the SDL driver instead. */ -#ifndef USE_MOUSE -# define USE_MOUSE 0 -#endif - -#if USE_MOUSE -/*No settings*/ -#endif - -/*------------------------------------------- - * Mousewheel as encoder on PC (using SDL) - *------------------------------------------*/ -/*DEPRECATED: Use the SDL driver instead. */ -#ifndef USE_MOUSEWHEEL -# define USE_MOUSEWHEEL 0 -#endif - -#if USE_MOUSEWHEEL -/*No settings*/ -#endif - -/*------------------------------------------------- - * Touchscreen, mouse/touchpad or keyboard as libinput interface (for Linux based systems) - *------------------------------------------------*/ -#ifndef USE_LIBINPUT -# define USE_LIBINPUT 0 -#endif - -#ifndef USE_BSD_LIBINPUT -# define USE_BSD_LIBINPUT 0 -#endif - -#if USE_LIBINPUT || USE_BSD_LIBINPUT -/*If only a single device of the same type is connected, you can also auto detect it, e.g.: - *#define LIBINPUT_NAME libinput_find_dev(LIBINPUT_CAPABILITY_TOUCH, false)*/ -# define LIBINPUT_NAME "/dev/input/event0" /*You can use the "evtest" Linux tool to get the list of devices and test them*/ - -#endif /*USE_LIBINPUT || USE_BSD_LIBINPUT*/ - -/*------------------------------------------------- - * Mouse or touchpad as evdev interface (for Linux based systems) - *------------------------------------------------*/ -#ifndef USE_EVDEV -# define USE_EVDEV 0 -#endif - -#ifndef USE_BSD_EVDEV -# define USE_BSD_EVDEV 0 -#endif - -#if USE_EVDEV || USE_BSD_EVDEV -# define EVDEV_NAME "/dev/input/event0" /*You can use the "evtest" Linux tool to get the list of devices and test them*/ -# define EVDEV_SWAP_AXES 0 /*Swap the x and y axes of the touchscreen*/ - -# define EVDEV_CALIBRATE 0 /*Scale and offset the touchscreen coordinates by using maximum and minimum values for each axis*/ - -# if EVDEV_CALIBRATE -# define EVDEV_HOR_MIN 0 /*to invert axis swap EVDEV_XXX_MIN by EVDEV_XXX_MAX*/ -# define EVDEV_HOR_MAX 4096 /*"evtest" Linux tool can help to get the correct calibraion values>*/ -# define EVDEV_VER_MIN 0 -# define EVDEV_VER_MAX 4096 -# endif /*EVDEV_CALIBRATE*/ -#endif /*USE_EVDEV*/ - -/*------------------------------------------------- - * Full keyboard support for evdev and libinput interface - *------------------------------------------------*/ -# ifndef USE_XKB -# define USE_XKB 0 -# endif - -#if USE_LIBINPUT || USE_BSD_LIBINPUT || USE_EVDEV || USE_BSD_EVDEV -# if USE_XKB -# define XKB_KEY_MAP { .rules = NULL, \ - .model = "pc101", \ - .layout = "us", \ - .variant = NULL, \ - .options = NULL } /*"setxkbmap -query" can help find the right values for your keyboard*/ -# endif /*USE_XKB*/ -#endif /*USE_LIBINPUT || USE_BSD_LIBINPUT || USE_EVDEV || USE_BSD_EVDEV*/ - -/*------------------------------- - * Keyboard of a PC (using SDL) - *------------------------------*/ -/*DEPRECATED: Use the SDL driver instead. */ -#ifndef USE_KEYBOARD -# define USE_KEYBOARD 0 -#endif - -#if USE_KEYBOARD -/*No settings*/ -#endif - -#endif /*LV_DRV_CONF_H*/ - -#endif /*End of "Content enable"*/ diff --git a/lvgl b/lvgl index 2791d57..8691574 160000 --- a/lvgl +++ b/lvgl @@ -1 +1 @@ -Subproject commit 2791d5739fc00cb3802419c0fed73140910b5da7 +Subproject commit 8691574c5bc8a84352d851d709e6d8c6d24fd624 diff --git a/main/src/main.c b/main/src/main.c index b959cc3..d6f3770 100644 --- a/main/src/main.c +++ b/main/src/main.c @@ -11,21 +11,9 @@ #include #include #include -#include "lv_drv_conf.h" #include "lvgl/lvgl.h" #include "lvgl/examples/lv_examples.h" #include "lvgl/demos/lv_demos.h" -#if USE_SDL - #define SDL_MAIN_HANDLED /*To fix SDL's "undefined reference to WinMain" issue*/ - #include - #include "lv_drivers/sdl/sdl.h" -#elif USE_X11 - #include "lv_drivers/x11/x11.h" -#endif -// #include "lv_drivers/display/monitor.h" -// #include "lv_drivers/indev/mouse.h" -// #include "lv_drivers/indev/keyboard.h" -// #include "lv_drivers/indev/mousewheel.h" /********************* * DEFINES @@ -38,17 +26,13 @@ /********************** * STATIC PROTOTYPES **********************/ -static void hal_init(void); -static void hal_deinit(void); -static void* tick_thread(void *data); +static lv_display_t * hal_init(int32_t w, int32_t h); /********************** * STATIC VARIABLES **********************/ -static pthread_t thr_tick; /* thread */ -static bool end_tick = false; /* flag to terminate thread */ -/********************** +/********************** * MACROS **********************/ @@ -75,92 +59,6 @@ static bool end_tick = false; /* flag to terminate thread */ /********************** * GLOBAL FUNCTIONS **********************/ -#if 0 -static void user_image_demo() -{ - lv_obj_t * img = lv_gif_create(lv_scr_act()); - lv_gif_set_src(img, "A:lvgl/examples/libs/gif/bulb.gif"); - lv_obj_align(img, LV_ALIGN_BOTTOM_RIGHT, -20, -20); - - lv_color_t bg_color = lv_palette_lighten(LV_PALETTE_LIGHT_BLUE, 5); - lv_color_t fg_color = lv_palette_darken(LV_PALETTE_BLUE, 4); - - lv_obj_t * qr = lv_qrcode_create(lv_scr_act(), 150, fg_color, bg_color); - - /*Set data*/ - const char * data = "https://lvgl.io"; - lv_qrcode_update(qr, data, strlen(data)); - lv_obj_center(qr); - - /*Add a border with bg_color*/ - lv_obj_set_style_border_color(qr, bg_color, 0); - lv_obj_set_style_border_width(qr, 5, 0); - - /*Create a font*/ - static lv_ft_info_t info; - /*FreeType uses C standard file system, so no driver letter is required.*/ - info.name = "./lvgl/examples/libs/freetype/Lato-Regular.ttf"; - info.weight = 24; - info.style = FT_FONT_STYLE_NORMAL; - info.mem = NULL; - if(!lv_ft_font_init(&info)) { - LV_LOG_ERROR("create failed."); - } - - /*Create style with the new font*/ - static lv_style_t style; - lv_style_init(&style); - lv_style_set_text_font(&style, info.font); - lv_style_set_text_align(&style, LV_TEXT_ALIGN_CENTER); - - /*Create a label with the new style*/ - lv_obj_t * label = lv_label_create(lv_scr_act()); - lv_obj_add_style(label, &style, 0); - lv_label_set_text(label, "Hello world\nI'm a font created with FreeType"); - lv_obj_set_pos(label, 10, 10); - - lv_obj_t * img1 = lv_img_create(lv_scr_act()); - /* Assuming a File system is attached to letter 'A' - * E.g. set LV_USE_FS_STDIO 'A' in lv_conf.h */ - lv_img_set_src(img1, "A:lvgl/examples/libs/png/wink.png"); - lv_obj_align(img1, LV_ALIGN_LEFT_MID, 20, 0); - - lv_obj_t * wp; - - wp = lv_img_create(lv_scr_act()); - /* Assuming a File system is attached to letter 'A' - * E.g. set LV_USE_FS_STDIO 'A' in lv_conf.h */ - lv_img_set_src(wp, "A:lvgl/examples/libs/sjpg/small_image.sjpg"); - lv_obj_align(wp, LV_ALIGN_RIGHT_MID, -20, 0); - - lv_obj_t * img2 = lv_img_create(lv_scr_act()); - /* Assuming a File system is attached to letter 'A' - * E.g. set LV_USE_FS_STDIO 'A' in lv_conf.h */ - lv_img_set_src(img2, "A:lvgl/examples/libs/sjpg/lv_example_jpg.jpg"); - //lv_obj_center(img); - lv_obj_align(img2, LV_ALIGN_TOP_RIGHT, -20, 20); - - lv_obj_t * img3 = lv_img_create(lv_scr_act()); - /* Assuming a File system is attached to letter 'A' - * E.g. set LV_USE_FS_STDIO 'A' in lv_conf.h */ -#if LV_COLOR_DEPTH == 32 - lv_img_set_src(img3, "A:lvgl/examples/libs/bmp/example_32bit.bmp"); -#elif LV_COLOR_DEPTH == 16 - lv_img_set_src(img, "A:lvgl/examples/libs/bmp/example_16bit.bmp"); -#endif - lv_obj_align(img3, LV_ALIGN_BOTTOM_MID, 0, -20); - - lv_obj_t * img4 = lv_img_create(lv_scr_act()); - lv_img_set_src(img4, "A:lvgl/examples/libs/ffmpeg/ffmpeg.png"); - lv_obj_align(img4, LV_ALIGN_BOTTOM_LEFT, 20, -20); - - lv_obj_t * player = lv_ffmpeg_player_create(lv_scr_act()); - lv_ffmpeg_player_set_src(player, "./lvgl/examples/libs/ffmpeg/birds.mp4"); - lv_ffmpeg_player_set_auto_restart(player, true); - lv_ffmpeg_player_set_cmd(player, LV_FFMPEG_PLAYER_CMD_START); - lv_obj_align(player, LV_ALIGN_TOP_MID, 0, 20); -} -#endif int main(int argc, char **argv) { @@ -171,33 +69,9 @@ int main(int argc, char **argv) lv_init(); /*Initialize the HAL (display, input devices, tick) for LVGL*/ - hal_init(); - -// lv_example_switch_1(); -// lv_example_calendar_1(); -// lv_example_btnmatrix_2(); -// lv_example_checkbox_1(); -// lv_example_colorwheel_1(); -// lv_example_chart_6(); -// lv_example_table_2(); -// lv_example_scroll_2(); -// lv_example_textarea_1(); -// lv_example_msgbox_1(); -// lv_example_dropdown_2(); -// lv_example_btn_1(); -// lv_example_scroll_1(); -// lv_example_tabview_1(); -// lv_example_tabview_1(); -// lv_example_flex_3(); -// lv_example_label_1(); + hal_init(480, 272); lv_demo_widgets(); -// lv_demo_keypad_encoder(); -// lv_demo_benchmark(); -// lv_demo_stress(); -// lv_demo_music(); - -// user_image_demo(); while(1) { /* Periodically call the lv_task handler. @@ -206,7 +80,6 @@ int main(int argc, char **argv) usleep(5 * 1000); } - hal_deinit(); return 0; } @@ -218,133 +91,30 @@ int main(int argc, char **argv) * Initialize the Hardware Abstraction Layer (HAL) for the LVGL graphics * library */ -static void hal_init(void) +static lv_display_t * hal_init(int32_t w, int32_t h) { - /* mouse input device */ - static lv_indev_drv_t indev_drv_1; - lv_indev_drv_init(&indev_drv_1); - indev_drv_1.type = LV_INDEV_TYPE_POINTER; - /* keyboard input device */ - static lv_indev_drv_t indev_drv_2; - lv_indev_drv_init(&indev_drv_2); - indev_drv_2.type = LV_INDEV_TYPE_KEYPAD; + lv_group_set_default(lv_group_create()); - /* mouse scroll wheel input device */ - static lv_indev_drv_t indev_drv_3; - lv_indev_drv_init(&indev_drv_3); - indev_drv_3.type = LV_INDEV_TYPE_ENCODER; + lv_display_t * disp = lv_sdl_window_create(w, h); - lv_group_t *g = lv_group_create(); - lv_group_set_default(g); + lv_indev_t * mouse = lv_sdl_mouse_create(); + lv_indev_set_group(mouse, lv_group_get_default()); + lv_indev_set_display(mouse, disp); + lv_display_set_default(disp); - lv_disp_t *disp = NULL; + LV_IMAGE_DECLARE(mouse_cursor_icon); /*Declare the image file.*/ + lv_obj_t * cursor_obj; + cursor_obj = lv_image_create(lv_screen_active()); /*Create an image object for the cursor */ + lv_image_set_src(cursor_obj, &mouse_cursor_icon); /*Set the image source*/ + lv_indev_set_cursor(mouse, cursor_obj); /*Connect the image object to the driver*/ -#if USE_SDL - /* Use the 'monitor' driver which creates window on PC's monitor to simulate a display*/ - sdl_init(); + lv_indev_t * mousewheel = lv_sdl_mousewheel_create(); + lv_indev_set_display(mousewheel, disp); - /*Create a display buffer*/ - static lv_disp_draw_buf_t disp_buf1; - static lv_color_t buf1_1[MONITOR_HOR_RES * 100]; - static lv_color_t buf1_2[MONITOR_HOR_RES * 100]; - lv_disp_draw_buf_init(&disp_buf1, buf1_1, buf1_2, MONITOR_HOR_RES * 100); + lv_indev_t * kb = lv_sdl_keyboard_create(); + lv_indev_set_display(kb, disp); + lv_indev_set_group(kb, lv_group_get_default()); - /*Create a display*/ - static lv_disp_drv_t disp_drv; - lv_disp_drv_init(&disp_drv); /*Basic initialization*/ - disp_drv.draw_buf = &disp_buf1; - disp_drv.flush_cb = sdl_display_flush; - disp_drv.hor_res = MONITOR_HOR_RES; - disp_drv.ver_res = MONITOR_VER_RES; - disp_drv.antialiasing = 1; - - disp = lv_disp_drv_register(&disp_drv); - - /* Add the input device driver */ - // mouse_init(); - indev_drv_1.read_cb = sdl_mouse_read; - - // keyboard_init(); - indev_drv_2.read_cb = sdl_keyboard_read; - - // mousewheel_init(); - indev_drv_3.read_cb = sdl_mousewheel_read; - -#elif USE_X11 - lv_x11_init("LVGL Simulator Demo", DISP_HOR_RES, DISP_VER_RES); - - /*Create a display buffer*/ - static lv_disp_draw_buf_t disp_buf1; - static lv_color_t buf1_1[DISP_HOR_RES * 100]; - static lv_color_t buf1_2[DISP_HOR_RES * 100]; - lv_disp_draw_buf_init(&disp_buf1, buf1_1, buf1_2, DISP_HOR_RES * 100); - - /*Create a display*/ - static lv_disp_drv_t disp_drv; - lv_disp_drv_init(&disp_drv); - disp_drv.draw_buf = &disp_buf1; - disp_drv.flush_cb = lv_x11_flush; - disp_drv.hor_res = DISP_HOR_RES; - disp_drv.ver_res = DISP_VER_RES; - disp_drv.antialiasing = 1; - - disp = lv_disp_drv_register(&disp_drv); - - /* Add the input device driver */ - indev_drv_1.read_cb = lv_x11_get_pointer; - indev_drv_2.read_cb = lv_x11_get_keyboard; - indev_drv_3.read_cb = lv_x11_get_mousewheel; -#endif - /* Set diplay theme */ - lv_theme_t * th = lv_theme_default_init(disp, lv_palette_main(LV_PALETTE_BLUE), lv_palette_main(LV_PALETTE_RED), LV_THEME_DEFAULT_DARK, LV_FONT_DEFAULT); - lv_disp_set_theme(disp, th); - - /* Tick init */ - end_tick = false; - pthread_create(&thr_tick, NULL, tick_thread, NULL); - - /* register input devices */ - lv_indev_t *mouse_indev = lv_indev_drv_register(&indev_drv_1); - lv_indev_t *kb_indev = lv_indev_drv_register(&indev_drv_2); - lv_indev_t *enc_indev = lv_indev_drv_register(&indev_drv_3); - lv_indev_set_group(kb_indev, g); - lv_indev_set_group(enc_indev, g); - - /* Set a cursor for the mouse */ - LV_IMG_DECLARE(mouse_cursor_icon); /*Declare the image file.*/ - lv_obj_t * cursor_obj = lv_img_create(lv_scr_act()); /*Create an image object for the cursor*/ - lv_img_set_src(cursor_obj, &mouse_cursor_icon); /*Set the image source*/ - lv_indev_set_cursor(mouse_indev, cursor_obj); /*Connect the image object to the driver*/ -} - -/** - * Releases the Hardware Abstraction Layer (HAL) for the LVGL graphics library - */ -static void hal_deinit(void) -{ - end_tick = true; - pthread_join(thr_tick, NULL); - -#if USE_SDL - // nop -#elif USE_X11 - lv_x11_deinit(); -#endif -} - -/** - * A task to measure the elapsed time for LVGL - * @param data unused - * @return never return - */ -static void* tick_thread(void *data) { - (void)data; - - while(!end_tick) { - usleep(5000); - lv_tick_inc(5); /*Tell LittelvGL that 5 milliseconds were elapsed*/ - } - - return NULL; -} + return disp; +} \ No newline at end of file diff --git a/main/src/mouse_cursor_icon.c b/main/src/mouse_cursor_icon.c index cf82f01..dfc5611 100644 --- a/main/src/mouse_cursor_icon.c +++ b/main/src/mouse_cursor_icon.c @@ -1,76 +1,6 @@ #include "lvgl/lvgl.h" const uint8_t mouse_cursor_icon_map[] = { -#if LV_COLOR_DEPTH == 1 || LV_COLOR_DEPTH == 8 - /*Pixel format: Alpha 8 bit, Red: 3 bit, Green: 3 bit, Blue: 2 bit*/ - 0x24, 0xb8, 0x24, 0xc8, 0x00, 0x13, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x49, 0xcc, 0xdb, 0xff, 0x49, 0xcc, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x49, 0xc8, 0xff, 0xff, 0xff, 0xff, 0x49, 0xe0, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x49, 0xcb, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0x6d, 0xf3, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x49, 0xcb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x92, 0xff, 0x00, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x49, 0xcb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x92, 0xff, 0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0xb6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x49, 0xcb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb7, 0xff, 0x24, 0xab, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x49, 0xcb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xdb, 0xff, 0x24, 0xbb, 0x00, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x49, 0xcc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xdb, 0xff, 0x49, 0xd8, 0x00, 0x37, 0x00, 0x00, 0x00, 0x00, - 0x49, 0xcc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6d, 0xef, 0x00, 0x4f, 0x00, 0x00, - 0x49, 0xcc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x92, 0xff, 0x00, 0x6b, - 0x49, 0xcc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xdb, 0xff, 0x92, 0xf7, 0x92, 0xf8, 0x6e, 0xfb, 0x92, 0xf8, 0x6d, 0xff, 0x00, 0xb3, - 0x49, 0xcc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xdb, 0xff, 0x24, 0xb7, 0x00, 0x1b, 0x00, 0x14, 0x00, 0x13, 0x00, 0x0c, 0x25, 0x07, - 0x49, 0xcc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6d, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6e, 0xf0, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x49, 0xcc, 0xff, 0xff, 0xff, 0xff, 0x49, 0xd8, 0x00, 0x78, 0x92, 0xfb, 0xff, 0xff, 0xff, 0xff, 0xdb, 0xff, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x6d, 0xd3, 0xff, 0xff, 0x6d, 0xef, 0x00, 0x34, 0x00, 0x00, 0x49, 0xc7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6d, 0xdc, 0x00, 0x14, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, - 0x49, 0xe0, 0x6d, 0xff, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x92, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb7, 0xff, 0x00, 0x78, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, - 0x00, 0x68, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x49, 0xd0, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0x6d, 0xd8, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6f, 0xb7, 0xff, 0xff, 0xff, 0x92, 0xff, 0x49, 0xac, 0x00, 0x17, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x25, 0xd7, 0x49, 0xc7, 0x00, 0x47, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -#endif -#if LV_COLOR_DEPTH == 16 && LV_COLOR_16_SWAP == 0 - /*Pixel format: Alpha 8 bit, Red: 5 bit, Green: 6 bit, Blue: 5 bit*/ - 0xc3, 0x18, 0xb8, 0xe4, 0x20, 0xc8, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x49, 0x4a, 0xcc, 0x96, 0xb5, 0xff, 0xc7, 0x39, 0xcc, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xe7, 0x39, 0xc8, 0xbf, 0xff, 0xff, 0xfb, 0xde, 0xff, 0x28, 0x42, 0xe0, 0x00, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xe7, 0x39, 0xcb, 0x3d, 0xef, 0xff, 0xff, 0xff, 0xfc, 0x3d, 0xef, 0xff, 0xcb, 0x5a, 0xf3, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xe7, 0x39, 0xcb, 0x5d, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xbf, 0xff, 0xff, 0x8e, 0x73, 0xff, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xe8, 0x41, 0xcb, 0x5d, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x51, 0x8c, 0xff, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd3, 0x9c, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xe8, 0x41, 0xcb, 0x5d, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x14, 0xa5, 0xff, 0xa2, 0x10, 0xab, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x08, 0x42, 0xcb, 0x5d, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xd7, 0xbd, 0xff, 0x04, 0x21, 0xbb, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x08, 0x42, 0xcc, 0x5d, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x59, 0xce, 0xff, 0xe8, 0x41, 0xd8, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x08, 0x42, 0xcc, 0x5d, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xe6, 0xff, 0xab, 0x5a, 0xef, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, - 0x08, 0x42, 0xcc, 0x5d, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xbe, 0xf7, 0xff, 0xaf, 0x7b, 0xff, 0x00, 0x00, 0x6b, - 0x28, 0x42, 0xcc, 0x5d, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7a, 0xd6, 0xff, 0x10, 0x84, 0xf7, 0xae, 0x73, 0xf8, 0x6e, 0x73, 0xfb, 0x8e, 0x73, 0xf8, 0xcb, 0x5a, 0xff, 0x61, 0x08, 0xb3, - 0x28, 0x42, 0xcc, 0x7d, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x59, 0xce, 0xff, 0xa2, 0x10, 0xb7, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x14, 0x00, 0x00, 0x13, 0x00, 0x00, 0x0c, 0x45, 0x29, 0x07, - 0x29, 0x4a, 0xcc, 0x5d, 0xef, 0xff, 0xff, 0xff, 0xff, 0xdb, 0xde, 0xff, 0xec, 0x62, 0xff, 0x1c, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0c, 0x63, 0xf0, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x29, 0x4a, 0xcc, 0xdf, 0xff, 0xff, 0x7d, 0xef, 0xff, 0x49, 0x4a, 0xd8, 0x00, 0x00, 0x78, 0x51, 0x8c, 0xfb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x38, 0xc6, 0xff, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xcb, 0x5a, 0xd3, 0xdb, 0xde, 0xff, 0xec, 0x62, 0xef, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0xe7, 0x39, 0xc7, 0x5d, 0xef, 0xff, 0xff, 0xff, 0xff, 0xbe, 0xf7, 0xff, 0xaa, 0x52, 0xdc, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, - 0xe8, 0x41, 0xe0, 0xaa, 0x52, 0xff, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x72, 0x94, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x96, 0xb5, 0xff, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x61, 0x08, 0x04, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x68, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x69, 0x4a, 0xd0, 0x7d, 0xef, 0xff, 0xff, 0xff, 0xfc, 0xbe, 0xf7, 0xff, 0xaa, 0x52, 0xd8, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe4, 0x20, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6f, 0x75, 0xad, 0xff, 0xbf, 0xff, 0xff, 0x10, 0x84, 0xff, 0x86, 0x31, 0xac, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x41, 0x08, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x66, 0x31, 0xd7, 0xc7, 0x39, 0xc7, 0x00, 0x00, 0x47, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -#endif -#if LV_COLOR_DEPTH == 16 && LV_COLOR_16_SWAP != 0 - /*Pixel format: Alpha 8 bit, Red: 5 bit, Green: 6 bit, Blue: 5 bit BUT the 2 color bytes are swapped*/ - 0x18, 0xc3, 0xb8, 0x20, 0xe4, 0xc8, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x4a, 0x49, 0xcc, 0xb5, 0x96, 0xff, 0x39, 0xc7, 0xcc, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x39, 0xe7, 0xc8, 0xff, 0xbf, 0xff, 0xde, 0xfb, 0xff, 0x42, 0x28, 0xe0, 0x00, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x39, 0xe7, 0xcb, 0xef, 0x3d, 0xff, 0xff, 0xff, 0xfc, 0xef, 0x3d, 0xff, 0x5a, 0xcb, 0xf3, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x39, 0xe7, 0xcb, 0xef, 0x5d, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xbf, 0xff, 0x73, 0x8e, 0xff, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x41, 0xe8, 0xcb, 0xef, 0x5d, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8c, 0x51, 0xff, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9c, 0xd3, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x41, 0xe8, 0xcb, 0xef, 0x5d, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xa5, 0x14, 0xff, 0x10, 0xa2, 0xab, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x42, 0x08, 0xcb, 0xef, 0x5d, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xbd, 0xd7, 0xff, 0x21, 0x04, 0xbb, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x42, 0x08, 0xcc, 0xef, 0x5d, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xce, 0x59, 0xff, 0x41, 0xe8, 0xd8, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x42, 0x08, 0xcc, 0xef, 0x5d, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe6, 0xfc, 0xff, 0x5a, 0xab, 0xef, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, - 0x42, 0x08, 0xcc, 0xef, 0x5d, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xbe, 0xff, 0x7b, 0xaf, 0xff, 0x00, 0x00, 0x6b, - 0x42, 0x28, 0xcc, 0xef, 0x5d, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xd6, 0x7a, 0xff, 0x84, 0x10, 0xf7, 0x73, 0xae, 0xf8, 0x73, 0x6e, 0xfb, 0x73, 0x8e, 0xf8, 0x5a, 0xcb, 0xff, 0x08, 0x61, 0xb3, - 0x42, 0x28, 0xcc, 0xef, 0x7d, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xce, 0x59, 0xff, 0x10, 0xa2, 0xb7, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x14, 0x00, 0x00, 0x13, 0x00, 0x00, 0x0c, 0x29, 0x45, 0x07, - 0x4a, 0x29, 0xcc, 0xef, 0x5d, 0xff, 0xff, 0xff, 0xff, 0xde, 0xdb, 0xff, 0x62, 0xec, 0xff, 0xe7, 0x1c, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x63, 0x0c, 0xf0, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x4a, 0x29, 0xcc, 0xff, 0xdf, 0xff, 0xef, 0x7d, 0xff, 0x4a, 0x49, 0xd8, 0x00, 0x00, 0x78, 0x8c, 0x51, 0xfb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc6, 0x38, 0xff, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x5a, 0xcb, 0xd3, 0xde, 0xdb, 0xff, 0x62, 0xec, 0xef, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x39, 0xe7, 0xc7, 0xef, 0x5d, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xbe, 0xff, 0x52, 0xaa, 0xdc, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, - 0x41, 0xe8, 0xe0, 0x52, 0xaa, 0xff, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x94, 0x72, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb5, 0x96, 0xff, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x08, 0x61, 0x04, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x68, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x4a, 0x69, 0xd0, 0xef, 0x7d, 0xff, 0xff, 0xff, 0xfc, 0xf7, 0xbe, 0xff, 0x52, 0xaa, 0xd8, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xe4, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6f, 0xad, 0x75, 0xff, 0xff, 0xbf, 0xff, 0x84, 0x10, 0xff, 0x31, 0x86, 0xac, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x08, 0x41, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x31, 0x66, 0xd7, 0x39, 0xc7, 0xc7, 0x00, 0x00, 0x47, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -#endif -#if LV_COLOR_DEPTH == 32 0x19, 0x19, 0x19, 0xb8, 0x1e, 0x1e, 0x1e, 0xc8, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x48, 0x48, 0xcc, 0xb2, 0xb2, 0xb2, 0xff, 0x3a, 0x3a, 0x3a, 0xcc, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x0a, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3b, 0x3b, 0x3b, 0xc8, 0xf6, 0xf6, 0xf6, 0xff, 0xdc, 0xdc, 0xdc, 0xff, 0x43, 0x43, 0x43, 0xe0, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x0a, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -91,14 +21,14 @@ const uint8_t mouse_cursor_icon_map[] = { 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x4c, 0x4c, 0x4c, 0xd0, 0xec, 0xec, 0xec, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xf4, 0xf4, 0xf4, 0xff, 0x53, 0x53, 0x53, 0xd8, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x1e, 0x1e, 0x00, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6f, 0xab, 0xab, 0xab, 0xff, 0xf6, 0xf6, 0xf6, 0xff, 0x80, 0x80, 0x80, 0xff, 0x31, 0x31, 0x31, 0xac, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x09, 0x09, 0x03, 0x02, 0x02, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x2e, 0x2e, 0x2e, 0xd7, 0x38, 0x38, 0x38, 0xc7, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -#endif + }; lv_img_dsc_t mouse_cursor_icon = { - .header.always_zero = 0, + .header.magic = LV_IMAGE_HEADER_MAGIC, .header.w = 14, .header.h = 20, - .data_size = 280 * LV_IMG_PX_SIZE_ALPHA_BYTE, - .header.cf = LV_IMG_CF_TRUE_COLOR_ALPHA, + .data_size = 280 * 4, + .header.cf = LV_COLOR_FORMAT_ARGB8888, .data = mouse_cursor_icon_map, }; diff --git a/ui/simulator/README b/ui/simulator/README deleted file mode 100644 index fb02c5f..0000000 --- a/ui/simulator/README +++ /dev/null @@ -1,6 +0,0 @@ -## Simulator - -As most projects are targetted at embedded devices, this folder is for simulator specfic code to allow the UI to run on a desktop environment. - -lv_conf.h placed in ui/simulator/inc will automatically override the main lv_conf.h, to allow project specific settings without modifying the lv_sim_vscode project -