├── .cproject ├── .editorconfig ├── .github ├── auto-comment.yml └── stale.yml ├── .gitignore ├── .gitmodules ├── .project ├── CMakeLists.txt ├── Dockerfile ├── Makefile ├── README.md ├── cmake └── FindSDL2_image.cmake ├── licence.txt ├── lv_conf.defaults ├── lv_conf.h ├── main.c ├── manifest.json ├── mouse_cursor_icon.c ├── mouse_cursor_icon.png └── pc_simulator.launch /.cproject: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 121 | 122 | 123 | 124 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | [*.{c,h}] 2 | indent_style = space 3 | indent_size = 4 4 | end_of_line = lf 5 | insert_final_newline = true 6 | trim_trailing_whitespace = true 7 | insert_final_newline = true 8 | -------------------------------------------------------------------------------- /.github/auto-comment.yml: -------------------------------------------------------------------------------- 1 | # Comment to a new issue. 2 | pullRequestOpened: | 3 | Thank you for raising your pull request. 4 | 5 | To ensure that all licensing criteria is met all repositories of the LVGL project apply a process called DCO (Developer's Certificate of Origin). 6 | 7 | The text of DCO can be read here: https://developercertificate.org/ 8 | For a more detailed description see the [Documentation](https://docs.lvgl.io/latest/en/html/contributing/index.html#developer-certification-of-origin-dco) site. 9 | 10 | By contributing to any repositories of the LVGL project you state that your contribution corresponds with the DCO. 11 | 12 | No further action is required if your contribution fulfills the DCO. If you are not sure about it feel free to ask us in a comment. 13 | -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Number of days of inactivity before an issue becomes stale 2 | daysUntilStale: 21 3 | # Number of days of inactivity before a stale issue is closed 4 | daysUntilClose: 7 5 | # Issues with these labels will never be considered stale 6 | exemptLabels: 7 | - architecture 8 | - pinned 9 | # Label to use when marking an issue as stale 10 | staleLabel: stale 11 | # Comment to post when marking an issue as stale. Set to `false` to disable 12 | markComment: > 13 | This issue or pull request has been automatically marked as stale because it has not had 14 | recent activity. It will be closed if no further activity occurs. Thank you 15 | for your contributions. 16 | # Comment to post when closing a stale issue. Set to `false` to disable 17 | closeComment: false 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | Debug/ 2 | .settings/ 3 | lv_dev_tools/ 4 | **/*.o 5 | demo 6 | .pydevproject 7 | /.metadata/ 8 | /.tracecompass 9 | build/ 10 | bin/ 11 | cmake/ 12 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "lvgl"] 2 | path = lvgl 3 | url = https://github.com/lvgl/lvgl.git 4 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | lv_port_pc_eclipse_arch_driver 4 | 5 | 6 | 7 | 8 | 9 | org.python.pydev.PyDevBuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 15 | clean,full,incremental, 16 | 17 | 18 | 19 | 20 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 21 | full,incremental, 22 | 23 | 24 | 25 | 26 | 27 | org.eclipse.cdt.core.cnature 28 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 29 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 30 | org.python.pydev.pythonNature 31 | org.eclipse.linuxtools.tmf.project.nature 32 | org.eclipse.cdt.core.ccnature 33 | 34 | 35 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | project(lvgl) 3 | 4 | option(LV_USE_DRAW_SDL "Use SDL draw unit" OFF) 5 | option(LV_USE_LIBPNG "Use libpng to decode PNG" OFF) 6 | option(LV_USE_LIBJPEG_TURBO "Use libjpeg turbo to decode JPEG" OFF) 7 | option(LV_USE_FFMPEG "Use libffmpeg to display video using lv_ffmpeg" OFF) 8 | option(LV_USE_FREETYPE "Use freetype lib" OFF) 9 | 10 | set(CMAKE_C_STANDARD 99)#C99 # lvgl officially support C99 and above 11 | set(CMAKE_CXX_STANDARD 17)#C17 12 | set(CMAKE_CXX_STANDARD_REQUIRED ON) 13 | 14 | set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin) 15 | 16 | find_package(SDL2 REQUIRED SDL2) 17 | 18 | add_compile_definitions($<$:LV_USE_DRAW_SDL=1>) 19 | add_compile_definitions($<$:LV_USE_LIBPNG=1>) 20 | add_compile_definitions($<$:LV_USE_LIBJPEG_TURBO=1>) 21 | add_compile_definitions($<$:LV_USE_FFMPEG=1>) 22 | 23 | add_subdirectory(lvgl) 24 | target_include_directories(lvgl PUBLIC ${PROJECT_SOURCE_DIR} ${SDL2_INCLUDE_DIRS}) 25 | 26 | add_executable(main main.c mouse_cursor_icon.c) 27 | 28 | target_compile_definitions(main PRIVATE LV_CONF_INCLUDE_SIMPLE) 29 | target_link_libraries(main lvgl lvgl::examples lvgl::demos lvgl::thorvg ${SDL2_LIBRARIES} m pthread) 30 | add_custom_target (run COMMAND ${EXECUTABLE_OUTPUT_PATH}/main DEPENDS main) 31 | 32 | if(LV_USE_DRAW_SDL) 33 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake") 34 | # Need to install libsdl2-image-dev 35 | # `sudo apt install libsdl2-image-dev` 36 | # `brew install sdl2_image` 37 | find_package(SDL2_image REQUIRED) 38 | target_include_directories(lvgl PUBLIC ${SDL2_IMAGE_INCLUDE_DIRS}) 39 | target_link_libraries(main ${SDL2_IMAGE_LIBRARIES}) 40 | endif(LV_USE_DRAW_SDL) 41 | 42 | if(LV_USE_LIBPNG) 43 | find_package(PNG REQUIRED) 44 | target_include_directories(lvgl PUBLIC ${PNG_INCLUDE_DIR}) 45 | target_link_libraries(main ${PNG_LIBRARY}) 46 | endif(LV_USE_LIBPNG) 47 | 48 | if(LV_USE_LIBJPEG_TURBO) 49 | # Need to install libjpeg-turbo8-dev 50 | # `sudo apt install libjpeg-turbo8-dev` 51 | # `brew install libjpeg-turbo` 52 | find_package(JPEG REQUIRED) 53 | target_include_directories(lvgl PUBLIC ${JPEG_INCLUDE_DIRS}) 54 | target_link_libraries(main ${JPEG_LIBRARIES}) 55 | endif(LV_USE_LIBJPEG_TURBO) 56 | 57 | if(LV_USE_FFMPEG) 58 | target_link_libraries(main avformat avcodec avutil swscale) 59 | endif(LV_USE_FFMPEG) 60 | 61 | if(LV_USE_FREETYPE) 62 | find_package(Freetype REQUIRED) 63 | target_link_libraries(main ${FREETYPE_LIBRARIES}) 64 | target_include_directories(lvgl PUBLIC ${FREETYPE_INCLUDE_DIRS}) 65 | endif(LV_USE_FREETYPE) 66 | 67 | if(CMAKE_BUILD_TYPE STREQUAL "Debug") 68 | target_compile_options(lvgl PRIVATE 69 | -pedantic-errors 70 | -Wall 71 | -Wclobbered 72 | -Wdeprecated 73 | -Wdouble-promotion 74 | -Wempty-body 75 | -Wextra 76 | -Wformat-security 77 | -Wmaybe-uninitialized 78 | # -Wmissing-prototypes 79 | -Wpointer-arith 80 | -Wmultichar 81 | -Wno-pedantic # ignored for now, we convert functions to pointers for propertis table. 82 | -Wreturn-type 83 | -Wshadow 84 | -Wshift-negative-value 85 | -Wsizeof-pointer-memaccess 86 | -Wtype-limits 87 | -Wundef 88 | -Wuninitialized 89 | -Wunreachable-code 90 | -Wfloat-conversion 91 | -Wstrict-aliasing 92 | ) 93 | 94 | target_compile_options(main PRIVATE -fsanitize=address,leak,undefined) 95 | target_link_options(main PRIVATE -fsanitize=address,leak,undefined) 96 | endif() 97 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # To build: 2 | # docker build -t lvgl . 3 | # 4 | # To see how to do GUI forwarding in macOS: 5 | # https://cntnr.io/running-guis-with-docker-on-mac-os-x-a14df6a76efc 6 | # 7 | # To do GUI forwarding on linux, the following may work (easiest method, but unsafe) 8 | # xhost + && docker run --network=host --env DISPLAY=$DISPLAY lvgl 9 | 10 | FROM ubuntu:23.04 11 | 12 | RUN apt update && apt install -y \ 13 | build-essential \ 14 | cmake \ 15 | gcc \ 16 | git \ 17 | libsdl2-dev \ 18 | mesa-utils \ 19 | libgl1-mesa-glx \ 20 | x11-apps 21 | 22 | ENV DISPLAY=:0 23 | 24 | COPY . . 25 | 26 | RUN make -j3 27 | 28 | CMD ["./demo"] 29 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile 3 | # 4 | $(warning Using Make to build this project is deprecated, please switch to CMake) 5 | CC ?= gcc 6 | LVGL_DIR_NAME ?= lvgl 7 | LVGL_DIR ?= ${shell pwd} 8 | 9 | WARNINGS ?= -Wall -Werror=float-conversion -Wextra \ 10 | -Wshadow -Wundef -Wmaybe-uninitialized -Wmissing-prototypes -Wno-discarded-qualifiers \ 11 | -Wno-unused-function -Wno-error=strict-prototypes -Wpointer-arith -fno-strict-aliasing -Wno-error=cpp -Wuninitialized \ 12 | -Wno-unused-parameter -Wno-missing-field-initializers -Wno-format-nonliteral -Wno-cast-qual -Wunreachable-code -Wno-switch-default \ 13 | -Wreturn-type -Wmultichar -Wformat-security -Wno-ignored-qualifiers -Wno-error=pedantic -Wno-sign-compare -Wno-error=missing-prototypes -Wdouble-promotion -Wclobbered -Wdeprecated \ 14 | -Wempty-body -Wshift-negative-value -Wstack-usage=2048 \ 15 | -Wtype-limits -Wsizeof-pointer-memaccess -Wpointer-arith 16 | 17 | CFLAGS ?= -O3 -I$(LVGL_DIR)/ $(WARNINGS) `pkg-config --cflags wayland-client` `pkg-config --cflags xkbcommon` 18 | LDFLAGS ?= -lSDL2 -lm `pkg-config --libs wayland-client` `pkg-config --libs xkbcommon` -lpthread 19 | BIN = demo 20 | 21 | #Collect the files to compile 22 | MAINSRC = ./main.c 23 | 24 | include $(LVGL_DIR)/lvgl/lvgl.mk 25 | 26 | CSRCS +=$(LVGL_DIR)/mouse_cursor_icon.c 27 | 28 | OBJEXT ?= .o 29 | 30 | AOBJS = $(ASRCS:.S=$(OBJEXT)) 31 | COBJS = $(CSRCS:.c=$(OBJEXT)) 32 | CXXOBJS = $(CXXSRCS:.cpp=$(OBJEXT)) 33 | 34 | MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) 35 | 36 | SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) $(CXXSRCS) 37 | OBJS = $(AOBJS) $(COBJS) $(CXXOBJS) 38 | 39 | ## MAINOBJ -> OBJFILES 40 | 41 | all: default 42 | 43 | %.o: %.c 44 | @$(CC) $(CFLAGS) -c $< -o $@ 45 | @echo "CC $<" 46 | 47 | %.o: %.cpp 48 | @$(CXX) $(CFLAGS) -c $< -o $@ 49 | @echo "CXX $<" 50 | 51 | default: $(AOBJS) $(COBJS) $(MAINOBJ) $(CXXOBJS) 52 | $(CXX) -o $(BIN) $(MAINOBJ) $(AOBJS) $(COBJS) $(CXXOBJS) $(LDFLAGS) 53 | 54 | clean: 55 | rm -f $(BIN) $(AOBJS) $(COBJS) $(CXXOBJS) $(MAINOBJ) 56 | 57 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Eclipse Simulator for LVGL (using SDL) 2 | 3 | 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. 4 | 5 | The PC simulator is cross platform. **Windows, Linux and OSX** are supported, however on Windows it's easier to get started with a [another simulator](https://docs.lvgl.io/latest/en/html/get-started/pc-simulator.html) project. 6 | 7 | This project uses [Eclipse CDT](https://projects.eclipse.org/projects/tools.cdt) (as an IDE) and [SDL](https://www.libsdl.org/) =a low level driver library to open a window, and handle mouse, keyboard etc.) 8 | 9 | ## Get started 10 | 11 | ### Install Packages 12 | 13 | On Linux you can easiyl install it the requirements via terminal: 14 | ``` 15 | sudo apt-get update && sudo apt-get install -y build-essential libsdl2-dev libsdl2-image-dev libjpeg-dev libpng-dev 16 | ``` 17 | 18 | Or you can download SDL from [https://www.libsdl.org/](https://www.libsdl.org/). 19 | 20 | 21 | ### Get this project 22 | 23 | Clone this repository and the related submodules to the workspace folder of Eclipse: 24 | 25 | ``` 26 | git clone --recursive https://github.com/lvgl/lv_port_pc_eclipse 27 | ``` 28 | 29 | ### Import the PC simulator project 30 | 1. Open Eclipse CDT 31 | 2. Click **File->Import** and choose **General->Existing project into Workspace** 32 | 3. Browse the root directory of the project and click Finish 33 | 4. Build your project and run it 34 | 35 | This configures in this project, but if you start a new Eclipse project due to an Eclipse bug you need modify the Assembler command: 36 | 1. In Project properties -> C/C++ build -> Settings -> Cross GCC Assembler -> Command: change `as` to `gcc` 37 | 2. On the same place: Cross GCC Assembler -> General -> Assembler flags: add `-c` 38 | 39 | ## CMake 40 | 41 | The following steps can be used with CMake on a Unix-like system. This may also work on other OSes but has not been tested. 42 | 43 | 1. Ensure CMake is installed, i.e. the `cmake` command works on the terminal. 44 | 2. Make a new directory. The name doesn't matter but `build` will be used for this tutorial. 45 | 3. Type `cd build`. 46 | 4. Type `cmake ..`. CMake will generate the appropriate build files. 47 | - To build with SDL draw unit, add `-DLV_USE_DRAW_SDL=ON` to command line 48 | - To build with libpng to support PNG image, add `-DLV_USE_LIBPNG=ON` to command line 49 | - To build with libjpeg-turbo to support JPEG image, add `-DLV_USE_LIBJPEG_TURBO=ON` to command line 50 | 5. Type `make -j` or (more portable) `cmake --build . --parallel`. 51 | 52 | **NOTE:** `--parallel` is supported from CMake v3.12 onwards. If you are using an older version of CMake, remove `--parallel` from the command or use the make option. 53 | 54 | 6. The binary will be in `../bin/main`, and can be run by typing that command. 55 | 56 | ## Docker 57 | 1. Build the docker container 58 | ``` 59 | docker build -t lvgl_simulator . 60 | ``` 61 | 2. Run the docker container 62 | ``` 63 | docker run lvgl_simulator 64 | ``` 65 | GUI with docker is platform dependent. For example, on macOS you can follow 66 | [this tutorial](https://cntnr.io/running-guis-with-docker-on-mac-os-x-a14df6a76efc) 67 | and run a command similar to: 68 | ``` 69 | docker run -e DISPLAY=10.103.56.101:0 lvgl_simulator 70 | ``` 71 | 72 | Note that on macOS, you may need to enable indirect GLX rendering before starting Xquartz: 73 | ``` 74 | defaults write org.macosforge.xquartz.X11 enable_iglx -bool true 75 | open -a Xquartz 76 | ``` 77 | 78 | For Linux environments with X Server, the following will the `docker run` command. Note that the first command, `xhost +` grants access to X server to everyone. 79 | 80 | ``` 81 | xhost + 82 | docker run -e DISPLAY=$DISPLAY -v /tmp/.X11-unix/:/tmp/.X11-unix:ro -t lvgl_simulator 83 | ``` 84 | ## Contributing 85 | 1. Fork it! 86 | 2. Create your feature branch: `git checkout -b my-new-feature` 87 | 3. Commit your changes: `git commit -am 'Add some feature'` 88 | 4. Push to the branch: `git push origin my-new-feature` 89 | 5. Submit a pull request! 90 | 91 | If you find an issue, please report it on GitHub! 92 | -------------------------------------------------------------------------------- /cmake/FindSDL2_image.cmake: -------------------------------------------------------------------------------- 1 | # Locate SDL_image library 2 | # 3 | # This module defines: 4 | # 5 | # :: 6 | # 7 | # SDL2_IMAGE_LIBRARIES, the name of the library to link against 8 | # SDL2_IMAGE_INCLUDE_DIRS, where to find the headers 9 | # SDL2_IMAGE_FOUND, if false, do not try to link against 10 | # SDL2_IMAGE_VERSION_STRING - human-readable string containing the version of SDL_image 11 | # 12 | # 13 | # 14 | # For backward compatibility the following variables are also set: 15 | # 16 | # :: 17 | # 18 | # SDLIMAGE_LIBRARY (same value as SDL2_IMAGE_LIBRARIES) 19 | # SDLIMAGE_INCLUDE_DIR (same value as SDL2_IMAGE_INCLUDE_DIRS) 20 | # SDLIMAGE_FOUND (same value as SDL2_IMAGE_FOUND) 21 | # 22 | # 23 | # 24 | # $SDLDIR is an environment variable that would correspond to the 25 | # ./configure --prefix=$SDLDIR used in building SDL. 26 | # 27 | # Created by Eric Wing. This was influenced by the FindSDL.cmake 28 | # module, but with modifications to recognize OS X frameworks and 29 | # additional Unix paths (FreeBSD, etc). 30 | 31 | #============================================================================= 32 | # Copyright 2005-2009 Kitware, Inc. 33 | # Copyright 2012 Benjamin Eikel 34 | # 35 | # Distributed under the OSI-approved BSD License (the "License"); 36 | # see accompanying file Copyright.txt for details. 37 | # 38 | # This software is distributed WITHOUT ANY WARRANTY; without even the 39 | # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 40 | # See the License for more information. 41 | #============================================================================= 42 | # (To distribute this file outside of CMake, substitute the full 43 | # License text for the above reference.) 44 | 45 | find_path(SDL2_IMAGE_INCLUDE_DIR SDL_image.h 46 | HINTS 47 | ENV SDL2IMAGEDIR 48 | ENV SDL2DIR 49 | PATH_SUFFIXES SDL2 50 | # path suffixes to search inside ENV{SDLDIR} 51 | include/SDL2 include 52 | PATHS ${SDL2_IMAGE_PATH} 53 | ) 54 | 55 | if(CMAKE_SIZEOF_VOID_P EQUAL 8) 56 | set(VC_LIB_PATH_SUFFIX lib/x64) 57 | else() 58 | set(VC_LIB_PATH_SUFFIX lib/x86) 59 | endif() 60 | 61 | find_library(SDL2_IMAGE_LIBRARY 62 | NAMES SDL2_image 63 | HINTS 64 | ENV SDL2IMAGEDIR 65 | ENV SDL2DIR 66 | PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX} 67 | PATHS ${SDL2_IMAGE_PATH} 68 | ) 69 | 70 | if(SDL2_IMAGE_INCLUDE_DIR AND EXISTS "${SDL2_IMAGE_INCLUDE_DIR}/SDL_image.h") 71 | file(STRINGS "${SDL2_IMAGE_INCLUDE_DIR}/SDL_image.h" SDL2_IMAGE_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_IMAGE_MAJOR_VERSION[ \t]+[0-9]+$") 72 | file(STRINGS "${SDL2_IMAGE_INCLUDE_DIR}/SDL_image.h" SDL2_IMAGE_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL_IMAGE_MINOR_VERSION[ \t]+[0-9]+$") 73 | file(STRINGS "${SDL2_IMAGE_INCLUDE_DIR}/SDL_image.h" SDL2_IMAGE_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL_IMAGE_PATCHLEVEL[ \t]+[0-9]+$") 74 | string(REGEX REPLACE "^#define[ \t]+SDL_IMAGE_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_IMAGE_VERSION_MAJOR "${SDL2_IMAGE_VERSION_MAJOR_LINE}") 75 | string(REGEX REPLACE "^#define[ \t]+SDL_IMAGE_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL2_IMAGE_VERSION_MINOR "${SDL2_IMAGE_VERSION_MINOR_LINE}") 76 | string(REGEX REPLACE "^#define[ \t]+SDL_IMAGE_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL2_IMAGE_VERSION_PATCH "${SDL2_IMAGE_VERSION_PATCH_LINE}") 77 | set(SDL2_IMAGE_VERSION_STRING ${SDL2_IMAGE_VERSION_MAJOR}.${SDL2_IMAGE_VERSION_MINOR}.${SDL2_IMAGE_VERSION_PATCH}) 78 | unset(SDL2_IMAGE_VERSION_MAJOR_LINE) 79 | unset(SDL2_IMAGE_VERSION_MINOR_LINE) 80 | unset(SDL2_IMAGE_VERSION_PATCH_LINE) 81 | unset(SDL2_IMAGE_VERSION_MAJOR) 82 | unset(SDL2_IMAGE_VERSION_MINOR) 83 | unset(SDL2_IMAGE_VERSION_PATCH) 84 | endif() 85 | 86 | set(SDL2_IMAGE_LIBRARIES ${SDL2_IMAGE_LIBRARY}) 87 | set(SDL2_IMAGE_INCLUDE_DIRS ${SDL2_IMAGE_INCLUDE_DIR} ${SDL2_IMAGE_INCLUDE_DIR}/..) 88 | 89 | include(FindPackageHandleStandardArgs) 90 | 91 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2_image 92 | REQUIRED_VARS SDL2_IMAGE_LIBRARIES SDL2_IMAGE_INCLUDE_DIRS 93 | VERSION_VAR SDL2_IMAGE_VERSION_STRING) 94 | 95 | # for backward compatibility 96 | set(SDLIMAGE_LIBRARY ${SDL2_IMAGE_LIBRARIES}) 97 | set(SDLIMAGE_INCLUDE_DIR ${SDL2_IMAGE_INCLUDE_DIRS}) 98 | set(SDLIMAGE_FOUND ${SDL2_IMAGE_FOUND}) 99 | 100 | mark_as_advanced(SDL2_IMAGE_LIBRARY SDL2_IMAGE_INCLUDE_DIR) -------------------------------------------------------------------------------- /licence.txt: -------------------------------------------------------------------------------- 1 | MIT licence 2 | Copyright (c) 2016 Gábor Kiss-Vámosi 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 9 | -------------------------------------------------------------------------------- /lv_conf.defaults: -------------------------------------------------------------------------------- 1 | LV_COLOR_DEPTH 32 2 | LV_MEM_SIZE (1024 * 1024) 3 | LV_USE_MATRIX 1 4 | LV_USE_FLOAT 1 5 | LV_USE_LOTTIE 1 6 | 7 | LV_USE_DRAW_SW_COMPLEX_GRADIENTS 1 8 | LV_OBJ_STYLE_CACHE 1 9 | LV_USE_LOG 1 10 | LV_LOG_PRINTF 1 11 | LV_USE_ASSERT_MEM_INTEGRITY 1 12 | LV_USE_ASSERT_OBJ 1 13 | LV_USE_ASSERT_STYLE 1 14 | LV_FONT_MONTSERRAT_12 1 15 | LV_FONT_MONTSERRAT_14 1 16 | LV_FONT_MONTSERRAT_16 1 17 | LV_FONT_MONTSERRAT_18 1 18 | LV_FONT_MONTSERRAT_20 1 19 | LV_FONT_MONTSERRAT_22 1 20 | LV_FONT_MONTSERRAT_24 1 21 | LV_FONT_MONTSERRAT_26 1 22 | LV_FONT_MONTSERRAT_28 1 23 | LV_FONT_MONTSERRAT_30 1 24 | LV_FONT_MONTSERRAT_32 1 25 | LV_FONT_MONTSERRAT_34 1 26 | LV_FONT_MONTSERRAT_36 1 27 | LV_FONT_MONTSERRAT_38 1 28 | LV_FONT_MONTSERRAT_40 1 29 | LV_FONT_MONTSERRAT_42 1 30 | LV_FONT_MONTSERRAT_44 1 31 | LV_FONT_MONTSERRAT_46 1 32 | LV_FONT_MONTSERRAT_48 1 33 | LV_FONT_MONTSERRAT_28_COMPRESSED 1 34 | LV_FONT_DEJAVU_16_PERSIAN_HEBREW 1 35 | LV_FONT_SIMSUN_16_CJK 1 36 | LV_FONT_UNSCII_8 1 37 | 38 | LV_USE_SYSMON 1 39 | LV_USE_IMGFONT 1 40 | LV_USE_FS_STDIO 1 41 | LV_FS_STDIO_LETTER 'A' 42 | LV_USE_THORVG_INTERNAL 1 43 | LV_USE_LZ4_INTERNAL 1 44 | LV_USE_VECTOR_GRAPHIC 1 45 | LV_USE_TINY_TTF 1 46 | LV_USE_BARCODE 1 47 | LV_USE_QRCODE 1 48 | LV_USE_RLE 1 49 | LV_BIN_DECODER_RAM_LOAD 1 50 | LV_USE_TJPGD 1 51 | LV_USE_BMP 1 52 | LV_USE_LODEPNG 1 53 | LV_USE_SDL 1 54 | 55 | LV_USE_DEMO_WIDGETS 1 56 | LV_USE_DEMO_KEYPAD_AND_ENCODER 1 57 | LV_USE_DEMO_BENCHMARK 1 58 | LV_USE_DEMO_RENDER 1 59 | LV_USE_DEMO_STRESS 1 60 | LV_USE_DEMO_MUSIC 1 61 | LV_USE_DEMO_FLEX_LAYOUT 1 62 | LV_USE_DEMO_MULTILANG 1 63 | LV_USE_DEMO_TRANSFORM 1 64 | LV_USE_DEMO_SCROLL 1 65 | 66 | -------------------------------------------------------------------------------- /lv_conf.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_conf.h 3 | * Configuration file for v9.3.0-dev 4 | */ 5 | 6 | /* 7 | * Copy this file as `lv_conf.h` 8 | * 1. simply next to `lvgl` folder 9 | * 2. or to any other place and 10 | * - define `LV_CONF_INCLUDE_SIMPLE`; 11 | * - add the path as an include path. 12 | */ 13 | 14 | /* clang-format off */ 15 | #if 1 /* Enable content */ 16 | #ifndef LV_CONF_H 17 | #define LV_CONF_H 18 | 19 | /* If you need to include anything here, do it inside the `__ASSEMBLY__` guard */ 20 | #if 0 && defined(__ASSEMBLY__) 21 | #include "my_include.h" 22 | #endif 23 | 24 | /*==================== 25 | COLOR SETTINGS 26 | *====================*/ 27 | 28 | /** Color depth: 1 (I1), 8 (L8), 16 (RGB565), 24 (RGB888), 32 (XRGB8888) */ 29 | #define LV_COLOR_DEPTH 32 30 | 31 | /*========================= 32 | STDLIB WRAPPER SETTINGS 33 | *=========================*/ 34 | 35 | /** Possible values 36 | * - LV_STDLIB_BUILTIN: LVGL's built in implementation 37 | * - LV_STDLIB_CLIB: Standard C functions, like malloc, strlen, etc 38 | * - LV_STDLIB_MICROPYTHON: MicroPython implementation 39 | * - LV_STDLIB_RTTHREAD: RT-Thread implementation 40 | * - LV_STDLIB_CUSTOM: Implement the functions externally 41 | */ 42 | #define LV_USE_STDLIB_MALLOC LV_STDLIB_BUILTIN 43 | 44 | /** Possible values 45 | * - LV_STDLIB_BUILTIN: LVGL's built in implementation 46 | * - LV_STDLIB_CLIB: Standard C functions, like malloc, strlen, etc 47 | * - LV_STDLIB_MICROPYTHON: MicroPython implementation 48 | * - LV_STDLIB_RTTHREAD: RT-Thread implementation 49 | * - LV_STDLIB_CUSTOM: Implement the functions externally 50 | */ 51 | #define LV_USE_STDLIB_STRING LV_STDLIB_BUILTIN 52 | 53 | /** Possible values 54 | * - LV_STDLIB_BUILTIN: LVGL's built in implementation 55 | * - LV_STDLIB_CLIB: Standard C functions, like malloc, strlen, etc 56 | * - LV_STDLIB_MICROPYTHON: MicroPython implementation 57 | * - LV_STDLIB_RTTHREAD: RT-Thread implementation 58 | * - LV_STDLIB_CUSTOM: Implement the functions externally 59 | */ 60 | #define LV_USE_STDLIB_SPRINTF LV_STDLIB_BUILTIN 61 | 62 | #define LV_STDINT_INCLUDE 63 | #define LV_STDDEF_INCLUDE 64 | #define LV_STDBOOL_INCLUDE 65 | #define LV_INTTYPES_INCLUDE 66 | #define LV_LIMITS_INCLUDE 67 | #define LV_STDARG_INCLUDE 68 | 69 | #if LV_USE_STDLIB_MALLOC == LV_STDLIB_BUILTIN 70 | /** Size of memory available for `lv_malloc()` in bytes (>= 2kB) */ 71 | #define LV_MEM_SIZE (1024 * 1024) 72 | 73 | /** Size of the memory expand for `lv_malloc()` in bytes */ 74 | #define LV_MEM_POOL_EXPAND_SIZE 0 75 | 76 | /** Set an address for the memory pool instead of allocating it as a normal array. Can be in external SRAM too. */ 77 | #define LV_MEM_ADR 0 /**< 0: unused*/ 78 | /* Instead of an address give a memory allocator that will be called to get a memory pool for LVGL. E.g. my_malloc */ 79 | #if LV_MEM_ADR == 0 80 | #undef LV_MEM_POOL_INCLUDE 81 | #undef LV_MEM_POOL_ALLOC 82 | #endif 83 | #endif /*LV_USE_STDLIB_MALLOC == LV_STDLIB_BUILTIN*/ 84 | 85 | /*==================== 86 | HAL SETTINGS 87 | *====================*/ 88 | 89 | /** Default display refresh, input device read and animation step period. */ 90 | #define LV_DEF_REFR_PERIOD 33 /**< [ms] */ 91 | 92 | /** Default Dots Per Inch. Used to initialize default sizes such as widgets sized, style paddings. 93 | * (Not so important, you can adjust it to modify default sizes and spaces.) */ 94 | #define LV_DPI_DEF 130 /**< [px/inch] */ 95 | 96 | /*================= 97 | * OPERATING SYSTEM 98 | *=================*/ 99 | /** Select operating system to use. Possible options: 100 | * - LV_OS_NONE 101 | * - LV_OS_PTHREAD 102 | * - LV_OS_FREERTOS 103 | * - LV_OS_CMSIS_RTOS2 104 | * - LV_OS_RTTHREAD 105 | * - LV_OS_WINDOWS 106 | * - LV_OS_MQX 107 | * - LV_OS_SDL2 108 | * - LV_OS_CUSTOM */ 109 | #define LV_USE_OS LV_OS_NONE 110 | 111 | #if LV_USE_OS == LV_OS_CUSTOM 112 | #define LV_OS_CUSTOM_INCLUDE 113 | #endif 114 | #if LV_USE_OS == LV_OS_FREERTOS 115 | /* 116 | * Unblocking an RTOS task with a direct notification is 45% faster and uses less RAM 117 | * than unblocking a task using an intermediary object such as a binary semaphore. 118 | * RTOS task notifications can only be used when there is only one task that can be the recipient of the event. 119 | */ 120 | #define LV_USE_FREERTOS_TASK_NOTIFY 1 121 | #endif 122 | 123 | /*======================== 124 | * RENDERING CONFIGURATION 125 | *========================*/ 126 | 127 | /** Align stride of all layers and images to this bytes */ 128 | #define LV_DRAW_BUF_STRIDE_ALIGN 1 129 | 130 | /** Align start address of draw_buf addresses to this bytes*/ 131 | #define LV_DRAW_BUF_ALIGN 4 132 | 133 | /** Using matrix for transformations. 134 | * Requirements: 135 | * - `LV_USE_MATRIX = 1`. 136 | * - Rendering engine needs to support 3x3 matrix transformations. */ 137 | #define LV_DRAW_TRANSFORM_USE_MATRIX 0 138 | 139 | /* If a widget has `style_opa < 255` (not `bg_opa`, `text_opa` etc) or not NORMAL blend mode 140 | * it is buffered into a "simple" layer before rendering. The widget can be buffered in smaller chunks. 141 | * "Transformed layers" (if `transform_angle/zoom` are set) use larger buffers 142 | * and can't be drawn in chunks. */ 143 | 144 | /** The target buffer size for simple layer chunks. */ 145 | #define LV_DRAW_LAYER_SIMPLE_BUF_SIZE (24 * 1024) /**< [bytes]*/ 146 | 147 | /* Limit the max allocated memory for simple and transformed layers. 148 | * It should be at least `LV_DRAW_LAYER_SIMPLE_BUF_SIZE` sized but if transformed layers are also used 149 | * it should be enough to store the largest widget too (width x height x 4 area). 150 | * Set it to 0 to have no limit. */ 151 | #define LV_DRAW_LAYER_MAX_MEMORY 0 /**< No limit by default [bytes]*/ 152 | 153 | /** Stack size of drawing thread. 154 | * NOTE: If FreeType or ThorVG is enabled, it is recommended to set it to 32KB or more. 155 | */ 156 | #define LV_DRAW_THREAD_STACK_SIZE (8 * 1024) /**< [bytes]*/ 157 | 158 | /** Thread priority of the drawing task. 159 | * Higher values mean higher priority. 160 | * Can use values from lv_thread_prio_t enum in lv_os.h: LV_THREAD_PRIO_LOWEST, 161 | * LV_THREAD_PRIO_LOW, LV_THREAD_PRIO_MID, LV_THREAD_PRIO_HIGH, LV_THREAD_PRIO_HIGHEST 162 | * Make sure the priority value aligns with the OS-specific priority levels. 163 | * On systems with limited priority levels (e.g., FreeRTOS), a higher value can improve 164 | * rendering performance but might cause other tasks to starve. */ 165 | #define LV_DRAW_THREAD_PRIO LV_THREAD_PRIO_HIGH 166 | 167 | #define LV_USE_DRAW_SW 1 168 | #if LV_USE_DRAW_SW == 1 169 | /* 170 | * Selectively disable color format support in order to reduce code size. 171 | * NOTE: some features use certain color formats internally, e.g. 172 | * - gradients use RGB888 173 | * - bitmaps with transparency may use ARGB8888 174 | */ 175 | #define LV_DRAW_SW_SUPPORT_RGB565 1 176 | #define LV_DRAW_SW_SUPPORT_RGB565_SWAPPED 1 177 | #define LV_DRAW_SW_SUPPORT_RGB565A8 1 178 | #define LV_DRAW_SW_SUPPORT_RGB888 1 179 | #define LV_DRAW_SW_SUPPORT_XRGB8888 1 180 | #define LV_DRAW_SW_SUPPORT_ARGB8888 1 181 | #define LV_DRAW_SW_SUPPORT_ARGB8888_PREMULTIPLIED 1 182 | #define LV_DRAW_SW_SUPPORT_L8 1 183 | #define LV_DRAW_SW_SUPPORT_AL88 1 184 | #define LV_DRAW_SW_SUPPORT_A8 1 185 | #define LV_DRAW_SW_SUPPORT_I1 1 186 | 187 | /* The threshold of the luminance to consider a pixel as 188 | * active in indexed color format */ 189 | #define LV_DRAW_SW_I1_LUM_THRESHOLD 127 190 | 191 | /** Set number of draw units. 192 | * - > 1 requires operating system to be enabled in `LV_USE_OS`. 193 | * - > 1 means multiple threads will render the screen in parallel. */ 194 | #define LV_DRAW_SW_DRAW_UNIT_CNT 1 195 | 196 | /** Use Arm-2D to accelerate software (sw) rendering. */ 197 | #define LV_USE_DRAW_ARM2D_SYNC 0 198 | 199 | /** Enable native helium assembly to be compiled. */ 200 | #define LV_USE_NATIVE_HELIUM_ASM 0 201 | 202 | /** 203 | * - 0: Use a simple renderer capable of drawing only simple rectangles with gradient, images, text, and straight lines only. 204 | * - 1: Use a complex renderer capable of drawing rounded corners, shadow, skew lines, and arcs too. */ 205 | #define LV_DRAW_SW_COMPLEX 1 206 | 207 | #if LV_DRAW_SW_COMPLEX == 1 208 | /** Allow buffering some shadow calculation. 209 | * LV_DRAW_SW_SHADOW_CACHE_SIZE is the maximum shadow size to buffer, where shadow size is 210 | * `shadow_width + radius`. Caching has LV_DRAW_SW_SHADOW_CACHE_SIZE^2 RAM cost. */ 211 | #define LV_DRAW_SW_SHADOW_CACHE_SIZE 0 212 | 213 | /** Set number of maximally-cached circle data. 214 | * The circumference of 1/4 circle are saved for anti-aliasing. 215 | * `radius * 4` bytes are used per circle (the most often used radiuses are saved). 216 | * - 0: disables caching */ 217 | #define LV_DRAW_SW_CIRCLE_CACHE_SIZE 4 218 | #endif 219 | 220 | #define LV_USE_DRAW_SW_ASM LV_DRAW_SW_ASM_NONE 221 | 222 | #if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_CUSTOM 223 | #define LV_DRAW_SW_ASM_CUSTOM_INCLUDE "" 224 | #endif 225 | 226 | /** Enable drawing complex gradients in software: linear at an angle, radial or conical */ 227 | #define LV_USE_DRAW_SW_COMPLEX_GRADIENTS 1 228 | 229 | #endif 230 | 231 | /*Use TSi's aka (Think Silicon) NemaGFX */ 232 | #define LV_USE_NEMA_GFX 0 233 | 234 | #if LV_USE_NEMA_GFX 235 | /** Select which NemaGFX HAL to use. Possible options: 236 | * - LV_NEMA_HAL_CUSTOM 237 | * - LV_NEMA_HAL_STM32 */ 238 | #define LV_USE_NEMA_HAL LV_NEMA_HAL_CUSTOM 239 | #if LV_USE_NEMA_HAL == LV_NEMA_HAL_STM32 240 | #define LV_NEMA_STM32_HAL_INCLUDE 241 | #endif 242 | 243 | /*Enable Vector Graphics Operations. Available only if NemaVG library is present*/ 244 | #define LV_USE_NEMA_VG 0 245 | #if LV_USE_NEMA_VG 246 | /*Define application's resolution used for VG related buffer allocation */ 247 | #define LV_NEMA_GFX_MAX_RESX 800 248 | #define LV_NEMA_GFX_MAX_RESY 600 249 | #endif 250 | #endif 251 | 252 | /** Use NXP's VG-Lite GPU on iMX RTxxx platforms. */ 253 | #define LV_USE_DRAW_VGLITE 0 254 | 255 | #if LV_USE_DRAW_VGLITE 256 | /** Enable blit quality degradation workaround recommended for screen's dimension > 352 pixels. */ 257 | #define LV_USE_VGLITE_BLIT_SPLIT 0 258 | 259 | #if LV_USE_OS 260 | /** Use additional draw thread for VG-Lite processing. */ 261 | #define LV_USE_VGLITE_DRAW_THREAD 1 262 | 263 | #if LV_USE_VGLITE_DRAW_THREAD 264 | /** Enable VGLite draw async. Queue multiple tasks and flash them once to the GPU. */ 265 | #define LV_USE_VGLITE_DRAW_ASYNC 1 266 | #endif 267 | #endif 268 | 269 | /** Enable VGLite asserts. */ 270 | #define LV_USE_VGLITE_ASSERT 0 271 | 272 | /** Enable VGLite error checks. */ 273 | #define LV_USE_VGLITE_CHECK_ERROR 0 274 | #endif 275 | 276 | /** Use NXP's PXP on iMX RTxxx platforms. */ 277 | #define LV_USE_PXP 0 278 | 279 | #if LV_USE_PXP 280 | /** Use PXP for drawing.*/ 281 | #define LV_USE_DRAW_PXP 1 282 | 283 | /** Use PXP to rotate display.*/ 284 | #define LV_USE_ROTATE_PXP 0 285 | 286 | #if LV_USE_DRAW_PXP && LV_USE_OS 287 | /** Use additional draw thread for PXP processing.*/ 288 | #define LV_USE_PXP_DRAW_THREAD 1 289 | #endif 290 | 291 | /** Enable PXP asserts. */ 292 | #define LV_USE_PXP_ASSERT 0 293 | #endif 294 | 295 | /** Use NXP's G2D on MPU platforms. */ 296 | #define LV_USE_DRAW_G2D 0 297 | 298 | #if LV_USE_DRAW_G2D 299 | /** Maximum number of buffers that can be stored for G2D draw unit. 300 | * Includes the frame buffers and assets. */ 301 | #define LV_G2D_HASH_TABLE_SIZE 50 302 | 303 | #if LV_USE_OS 304 | /** Use additional draw thread for G2D processing.*/ 305 | #define LV_USE_G2D_DRAW_THREAD 1 306 | #endif 307 | 308 | /** Enable G2D asserts. */ 309 | #define LV_USE_G2D_ASSERT 0 310 | #endif 311 | 312 | /** Use Renesas Dave2D on RA platforms. */ 313 | #define LV_USE_DRAW_DAVE2D 0 314 | 315 | /** Draw using cached SDL textures*/ 316 | #define LV_USE_DRAW_SDL 0 317 | 318 | /** Use VG-Lite GPU. */ 319 | #define LV_USE_DRAW_VG_LITE 0 320 | 321 | #if LV_USE_DRAW_VG_LITE 322 | /** Enable VG-Lite custom external 'gpu_init()' function */ 323 | #define LV_VG_LITE_USE_GPU_INIT 0 324 | 325 | /** Enable VG-Lite assert. */ 326 | #define LV_VG_LITE_USE_ASSERT 0 327 | 328 | /** VG-Lite flush commit trigger threshold. GPU will try to batch these many draw tasks. */ 329 | #define LV_VG_LITE_FLUSH_MAX_COUNT 8 330 | 331 | /** Enable border to simulate shadow. 332 | * NOTE: which usually improves performance, 333 | * but does not guarantee the same rendering quality as the software. */ 334 | #define LV_VG_LITE_USE_BOX_SHADOW 1 335 | 336 | /** VG-Lite gradient maximum cache number. 337 | * @note The memory usage of a single gradient image is 4K bytes. */ 338 | #define LV_VG_LITE_GRAD_CACHE_CNT 32 339 | 340 | /** VG-Lite stroke maximum cache number. */ 341 | #define LV_VG_LITE_STROKE_CACHE_CNT 32 342 | #endif 343 | 344 | /** Accelerate blends, fills, etc. with STM32 DMA2D */ 345 | #define LV_USE_DRAW_DMA2D 0 346 | 347 | #if LV_USE_DRAW_DMA2D 348 | #define LV_DRAW_DMA2D_HAL_INCLUDE "stm32h7xx_hal.h" 349 | 350 | /* if enabled, the user is required to call `lv_draw_dma2d_transfer_complete_interrupt_handler` 351 | * upon receiving the DMA2D global interrupt 352 | */ 353 | #define LV_USE_DRAW_DMA2D_INTERRUPT 0 354 | #endif 355 | 356 | /** Draw using cached OpenGLES textures */ 357 | #define LV_USE_DRAW_OPENGLES 0 358 | 359 | /*======================= 360 | * FEATURE CONFIGURATION 361 | *=======================*/ 362 | 363 | /*------------- 364 | * Logging 365 | *-----------*/ 366 | 367 | /** Enable log module */ 368 | #define LV_USE_LOG 1 369 | #if LV_USE_LOG 370 | /** Set value to one of the following levels of logging detail: 371 | * - LV_LOG_LEVEL_TRACE Log detailed information. 372 | * - LV_LOG_LEVEL_INFO Log important events. 373 | * - LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem. 374 | * - LV_LOG_LEVEL_ERROR Log only critical issues, when system may fail. 375 | * - LV_LOG_LEVEL_USER Log only custom log messages added by the user. 376 | * - LV_LOG_LEVEL_NONE Do not log anything. */ 377 | #define LV_LOG_LEVEL LV_LOG_LEVEL_WARN 378 | 379 | /** - 1: Print log with 'printf'; 380 | * - 0: User needs to register a callback with `lv_log_register_print_cb()`. */ 381 | #define LV_LOG_PRINTF 1 382 | 383 | /** Set callback to print logs. 384 | * E.g `my_print`. The prototype should be `void my_print(lv_log_level_t level, const char * buf)`. 385 | * Can be overwritten by `lv_log_register_print_cb`. */ 386 | //#define LV_LOG_PRINT_CB 387 | 388 | /** - 1: Enable printing timestamp; 389 | * - 0: Disable printing timestamp. */ 390 | #define LV_LOG_USE_TIMESTAMP 1 391 | 392 | /** - 1: Print file and line number of the log; 393 | * - 0: Do not print file and line number of the log. */ 394 | #define LV_LOG_USE_FILE_LINE 1 395 | 396 | /* Enable/disable LV_LOG_TRACE in modules that produces a huge number of logs. */ 397 | #define LV_LOG_TRACE_MEM 1 /**< Enable/disable trace logs in memory operations. */ 398 | #define LV_LOG_TRACE_TIMER 1 /**< Enable/disable trace logs in timer operations. */ 399 | #define LV_LOG_TRACE_INDEV 1 /**< Enable/disable trace logs in input device operations. */ 400 | #define LV_LOG_TRACE_DISP_REFR 1 /**< Enable/disable trace logs in display re-draw operations. */ 401 | #define LV_LOG_TRACE_EVENT 1 /**< Enable/disable trace logs in event dispatch logic. */ 402 | #define LV_LOG_TRACE_OBJ_CREATE 1 /**< Enable/disable trace logs in object creation (core `obj` creation plus every widget). */ 403 | #define LV_LOG_TRACE_LAYOUT 1 /**< Enable/disable trace logs in flex- and grid-layout operations. */ 404 | #define LV_LOG_TRACE_ANIM 1 /**< Enable/disable trace logs in animation logic. */ 405 | #define LV_LOG_TRACE_CACHE 1 /**< Enable/disable trace logs in cache operations. */ 406 | #endif /*LV_USE_LOG*/ 407 | 408 | /*------------- 409 | * Asserts 410 | *-----------*/ 411 | 412 | /* Enable assertion failures if an operation fails or invalid data is found. 413 | * If LV_USE_LOG is enabled, an error message will be printed on failure. */ 414 | #define LV_USE_ASSERT_NULL 1 /**< Check if the parameter is NULL. (Very fast, recommended) */ 415 | #define LV_USE_ASSERT_MALLOC 1 /**< Checks is the memory is successfully allocated or no. (Very fast, recommended) */ 416 | #define LV_USE_ASSERT_STYLE 1 417 | #define LV_USE_ASSERT_MEM_INTEGRITY 1 418 | #define LV_USE_ASSERT_OBJ 1 419 | 420 | /** Add a custom handler when assert happens e.g. to restart MCU. */ 421 | #define LV_ASSERT_HANDLER_INCLUDE 422 | #define LV_ASSERT_HANDLER while(1); /**< Halt by default */ 423 | 424 | /*------------- 425 | * Debug 426 | *-----------*/ 427 | 428 | /** 1: Draw random colored rectangles over the redrawn areas. */ 429 | #define LV_USE_REFR_DEBUG 0 430 | 431 | /** 1: Draw a red overlay for ARGB layers and a green overlay for RGB layers*/ 432 | #define LV_USE_LAYER_DEBUG 0 433 | 434 | /** 1: Adds the following behaviors for debugging: 435 | * - Draw overlays with different colors for each draw_unit's tasks. 436 | * - Draw index number of draw unit on white background. 437 | * - For layers, draws index number of draw unit on black background. */ 438 | #define LV_USE_PARALLEL_DRAW_DEBUG 0 439 | 440 | /*------------- 441 | * Others 442 | *-----------*/ 443 | 444 | #define LV_ENABLE_GLOBAL_CUSTOM 0 445 | #if LV_ENABLE_GLOBAL_CUSTOM 446 | /** Header to include for custom 'lv_global' function" */ 447 | #define LV_GLOBAL_CUSTOM_INCLUDE 448 | #endif 449 | 450 | /** Default cache size in bytes. 451 | * Used by image decoders such as `lv_lodepng` to keep the decoded image in memory. 452 | * If size is not set to 0, the decoder will fail to decode when the cache is full. 453 | * If size is 0, the cache function is not enabled and the decoded memory will be 454 | * released immediately after use. */ 455 | #define LV_CACHE_DEF_SIZE 0 456 | 457 | /** Default number of image header cache entries. The cache is used to store the headers of images 458 | * The main logic is like `LV_CACHE_DEF_SIZE` but for image headers. */ 459 | #define LV_IMAGE_HEADER_CACHE_DEF_CNT 0 460 | 461 | /** Number of stops allowed per gradient. Increase this to allow more stops. 462 | * This adds (sizeof(lv_color_t) + 1) bytes per additional stop. */ 463 | #define LV_GRADIENT_MAX_STOPS 2 464 | 465 | /** Adjust color mix functions rounding. GPUs might calculate color mix (blending) differently. 466 | * - 0: round down, 467 | * - 64: round up from x.75, 468 | * - 128: round up from half, 469 | * - 192: round up from x.25, 470 | * - 254: round up */ 471 | #define LV_COLOR_MIX_ROUND_OFS 0 472 | 473 | /** Add 2 x 32-bit variables to each `lv_obj_t` to speed up getting style properties */ 474 | #define LV_OBJ_STYLE_CACHE 1 475 | 476 | /** Add `id` field to `lv_obj_t` */ 477 | #define LV_USE_OBJ_ID 0 478 | 479 | /** Enable support widget names*/ 480 | #define LV_USE_OBJ_NAME 0 481 | 482 | /** Automatically assign an ID when obj is created */ 483 | #define LV_OBJ_ID_AUTO_ASSIGN LV_USE_OBJ_ID 484 | 485 | /** Use builtin obj ID handler functions: 486 | * - lv_obj_assign_id: Called when a widget is created. Use a separate counter for each widget class as an ID. 487 | * - lv_obj_id_compare: Compare the ID to decide if it matches with a requested value. 488 | * - lv_obj_stringify_id: Return string-ified identifier, e.g. "button3". 489 | * - lv_obj_free_id: Does nothing, as there is no memory allocation for the ID. 490 | * When disabled these functions needs to be implemented by the user.*/ 491 | #define LV_USE_OBJ_ID_BUILTIN 1 492 | 493 | /** Use obj property set/get API. */ 494 | #define LV_USE_OBJ_PROPERTY 0 495 | 496 | /** Enable property name support. */ 497 | #define LV_USE_OBJ_PROPERTY_NAME 1 498 | 499 | /* Use VG-Lite Simulator. 500 | * - Requires: LV_USE_THORVG_INTERNAL or LV_USE_THORVG_EXTERNAL */ 501 | #define LV_USE_VG_LITE_THORVG 0 502 | 503 | #if LV_USE_VG_LITE_THORVG 504 | /** Enable LVGL's blend mode support */ 505 | #define LV_VG_LITE_THORVG_LVGL_BLEND_SUPPORT 0 506 | 507 | /** Enable YUV color format support */ 508 | #define LV_VG_LITE_THORVG_YUV_SUPPORT 0 509 | 510 | /** Enable Linear gradient extension support */ 511 | #define LV_VG_LITE_THORVG_LINEAR_GRADIENT_EXT_SUPPORT 0 512 | 513 | /** Enable alignment on 16 pixels */ 514 | #define LV_VG_LITE_THORVG_16PIXELS_ALIGN 1 515 | 516 | /** Buffer address alignment */ 517 | #define LV_VG_LITE_THORVG_BUF_ADDR_ALIGN 64 518 | 519 | /** Enable multi-thread render */ 520 | #define LV_VG_LITE_THORVG_THREAD_RENDER 0 521 | #endif 522 | 523 | /* Enable the multi-touch gesture recognition feature */ 524 | /* Gesture recognition requires the use of floats */ 525 | #define LV_USE_GESTURE_RECOGNITION 0 526 | 527 | /*===================== 528 | * COMPILER SETTINGS 529 | *====================*/ 530 | 531 | /** For big endian systems set to 1 */ 532 | #define LV_BIG_ENDIAN_SYSTEM 0 533 | 534 | /** Define a custom attribute for `lv_tick_inc` function */ 535 | #define LV_ATTRIBUTE_TICK_INC 536 | 537 | /** Define a custom attribute for `lv_timer_handler` function */ 538 | #define LV_ATTRIBUTE_TIMER_HANDLER 539 | 540 | /** Define a custom attribute for `lv_display_flush_ready` function */ 541 | #define LV_ATTRIBUTE_FLUSH_READY 542 | 543 | /** Align VG_LITE buffers on this number of bytes. 544 | * @note vglite_src_buf_aligned() uses this value to validate alignment of passed buffer pointers. */ 545 | #define LV_ATTRIBUTE_MEM_ALIGN_SIZE 1 546 | 547 | /** Will be added where memory needs to be aligned (with -Os data might not be aligned to boundary by default). 548 | * E.g. __attribute__((aligned(4)))*/ 549 | #define LV_ATTRIBUTE_MEM_ALIGN 550 | 551 | /** Attribute to mark large constant arrays, for example for font bitmaps */ 552 | #define LV_ATTRIBUTE_LARGE_CONST 553 | 554 | /** Compiler prefix for a large array declaration in RAM */ 555 | #define LV_ATTRIBUTE_LARGE_RAM_ARRAY 556 | 557 | /** Place performance critical functions into a faster memory (e.g RAM) */ 558 | #define LV_ATTRIBUTE_FAST_MEM 559 | 560 | /** Export integer constant to binding. This macro is used with constants in the form of LV_ that 561 | * should also appear on LVGL binding API such as MicroPython. */ 562 | #define LV_EXPORT_CONST_INT(int_value) struct _silence_gcc_warning /**< The default value just prevents GCC warning */ 563 | 564 | /** Prefix all global extern data with this */ 565 | #define LV_ATTRIBUTE_EXTERN_DATA 566 | 567 | /** Use `float` as `lv_value_precise_t` */ 568 | #define LV_USE_FLOAT 1 569 | 570 | /** Enable matrix support 571 | * - Requires `LV_USE_FLOAT = 1` */ 572 | #define LV_USE_MATRIX 1 573 | 574 | /** Include `lvgl_private.h` in `lvgl.h` to access internal data and functions by default */ 575 | #ifndef LV_USE_PRIVATE_API 576 | #define LV_USE_PRIVATE_API 0 577 | #endif 578 | 579 | /*================== 580 | * FONT USAGE 581 | *===================*/ 582 | 583 | /* Montserrat fonts with ASCII range and some symbols using bpp = 4 584 | * https://fonts.google.com/specimen/Montserrat */ 585 | #define LV_FONT_MONTSERRAT_8 0 586 | #define LV_FONT_MONTSERRAT_10 0 587 | #define LV_FONT_MONTSERRAT_12 1 588 | #define LV_FONT_MONTSERRAT_14 1 589 | #define LV_FONT_MONTSERRAT_16 1 590 | #define LV_FONT_MONTSERRAT_18 1 591 | #define LV_FONT_MONTSERRAT_20 1 592 | #define LV_FONT_MONTSERRAT_22 1 593 | #define LV_FONT_MONTSERRAT_24 1 594 | #define LV_FONT_MONTSERRAT_26 1 595 | #define LV_FONT_MONTSERRAT_28 1 596 | #define LV_FONT_MONTSERRAT_30 1 597 | #define LV_FONT_MONTSERRAT_32 1 598 | #define LV_FONT_MONTSERRAT_34 1 599 | #define LV_FONT_MONTSERRAT_36 1 600 | #define LV_FONT_MONTSERRAT_38 1 601 | #define LV_FONT_MONTSERRAT_40 1 602 | #define LV_FONT_MONTSERRAT_42 1 603 | #define LV_FONT_MONTSERRAT_44 1 604 | #define LV_FONT_MONTSERRAT_46 1 605 | #define LV_FONT_MONTSERRAT_48 1 606 | 607 | /* Demonstrate special features */ 608 | #define LV_FONT_MONTSERRAT_28_COMPRESSED 1 609 | #define LV_FONT_DEJAVU_16_PERSIAN_HEBREW 1 610 | #define LV_FONT_SIMSUN_14_CJK 0 /**< 1000 most common CJK radicals */ 611 | #define LV_FONT_SIMSUN_16_CJK 1 612 | #define LV_FONT_SOURCE_HAN_SANS_SC_14_CJK 0 /**< 1338 most common CJK radicals */ 613 | #define LV_FONT_SOURCE_HAN_SANS_SC_16_CJK 0 /**< 1338 most common CJK radicals */ 614 | 615 | /** Pixel perfect monospaced fonts */ 616 | #define LV_FONT_UNSCII_8 1 617 | #define LV_FONT_UNSCII_16 0 618 | 619 | /** Optionally declare custom fonts here. 620 | * 621 | * You can use any of these fonts as the default font too and they will be available 622 | * globally. Example: 623 | * 624 | * @code 625 | * #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(my_font_1) LV_FONT_DECLARE(my_font_2) 626 | * @endcode 627 | */ 628 | #define LV_FONT_CUSTOM_DECLARE 629 | 630 | /** Always set a default font */ 631 | #define LV_FONT_DEFAULT &lv_font_montserrat_14 632 | 633 | /** Enable handling large font and/or fonts with a lot of characters. 634 | * The limit depends on the font size, font face and bpp. 635 | * A compiler error will be triggered if a font needs it. */ 636 | #define LV_FONT_FMT_TXT_LARGE 0 637 | 638 | /** Enables/disables support for compressed fonts. */ 639 | #define LV_USE_FONT_COMPRESSED 0 640 | 641 | /** Enable drawing placeholders when glyph dsc is not found. */ 642 | #define LV_USE_FONT_PLACEHOLDER 1 643 | 644 | /*================= 645 | * TEXT SETTINGS 646 | *=================*/ 647 | 648 | /** 649 | * Select a character encoding for strings. 650 | * Your IDE or editor should have the same character encoding. 651 | * - LV_TXT_ENC_UTF8 652 | * - LV_TXT_ENC_ASCII 653 | */ 654 | #define LV_TXT_ENC LV_TXT_ENC_UTF8 655 | 656 | /** While rendering text strings, break (wrap) text on these chars. */ 657 | #define LV_TXT_BREAK_CHARS " ,.;:-_)]}" 658 | 659 | /** If a word is at least this long, will break wherever "prettiest". 660 | * To disable, set to a value <= 0. */ 661 | #define LV_TXT_LINE_BREAK_LONG_LEN 0 662 | 663 | /** Minimum number of characters in a long word to put on a line before a break. 664 | * Depends on LV_TXT_LINE_BREAK_LONG_LEN. */ 665 | #define LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN 3 666 | 667 | /** Minimum number of characters in a long word to put on a line after a break. 668 | * Depends on LV_TXT_LINE_BREAK_LONG_LEN. */ 669 | #define LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN 3 670 | 671 | /** Support bidirectional text. Allows mixing Left-to-Right and Right-to-Left text. 672 | * The direction will be processed according to the Unicode Bidirectional Algorithm: 673 | * https://www.w3.org/International/articles/inline-bidi-markup/uba-basics */ 674 | #define LV_USE_BIDI 0 675 | #if LV_USE_BIDI 676 | /*Set the default direction. Supported values: 677 | *`LV_BASE_DIR_LTR` Left-to-Right 678 | *`LV_BASE_DIR_RTL` Right-to-Left 679 | *`LV_BASE_DIR_AUTO` detect text base direction*/ 680 | #define LV_BIDI_BASE_DIR_DEF LV_BASE_DIR_AUTO 681 | #endif 682 | 683 | /** Enable Arabic/Persian processing 684 | * In these languages characters should be replaced with another form based on their position in the text */ 685 | #define LV_USE_ARABIC_PERSIAN_CHARS 0 686 | 687 | /*The control character to use for signaling text recoloring*/ 688 | #define LV_TXT_COLOR_CMD "#" 689 | 690 | /*================== 691 | * WIDGETS 692 | *================*/ 693 | /* Documentation for widgets can be found here: https://docs.lvgl.io/master/details/widgets/index.html . */ 694 | 695 | /** 1: Causes these widgets to be given default values at creation time. 696 | * - lv_buttonmatrix_t: Get default maps: {"Btn1", "Btn2", "Btn3", "\n", "Btn4", "Btn5", ""}, else map not set. 697 | * - lv_checkbox_t : String label set to "Check box", else set to empty string. 698 | * - lv_dropdown_t : Options set to "Option 1", "Option 2", "Option 3", else no values are set. 699 | * - lv_roller_t : Options set to "Option 1", "Option 2", "Option 3", "Option 4", "Option 5", else no values are set. 700 | * - lv_label_t : Text set to "Text", else empty string. 701 | * */ 702 | #define LV_WIDGETS_HAS_DEFAULT_VALUE 1 703 | 704 | #define LV_USE_ANIMIMG 1 705 | 706 | #define LV_USE_ARC 1 707 | 708 | #define LV_USE_BAR 1 709 | 710 | #define LV_USE_BUTTON 1 711 | 712 | #define LV_USE_BUTTONMATRIX 1 713 | 714 | #define LV_USE_CALENDAR 1 715 | #if LV_USE_CALENDAR 716 | #define LV_CALENDAR_WEEK_STARTS_MONDAY 0 717 | #if LV_CALENDAR_WEEK_STARTS_MONDAY 718 | #define LV_CALENDAR_DEFAULT_DAY_NAMES {"Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"} 719 | #else 720 | #define LV_CALENDAR_DEFAULT_DAY_NAMES {"Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"} 721 | #endif 722 | 723 | #define LV_CALENDAR_DEFAULT_MONTH_NAMES {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"} 724 | #define LV_USE_CALENDAR_HEADER_ARROW 1 725 | #define LV_USE_CALENDAR_HEADER_DROPDOWN 1 726 | #define LV_USE_CALENDAR_CHINESE 0 727 | #endif /*LV_USE_CALENDAR*/ 728 | 729 | #define LV_USE_CANVAS 1 730 | 731 | #define LV_USE_CHART 1 732 | 733 | #define LV_USE_CHECKBOX 1 734 | 735 | #define LV_USE_DROPDOWN 1 /**< Requires: lv_label */ 736 | 737 | #define LV_USE_IMAGE 1 /**< Requires: lv_label */ 738 | 739 | #define LV_USE_IMAGEBUTTON 1 740 | 741 | #define LV_USE_KEYBOARD 1 742 | 743 | #define LV_USE_LABEL 1 744 | #if LV_USE_LABEL 745 | #define LV_LABEL_TEXT_SELECTION 1 /**< Enable selecting text of the label */ 746 | #define LV_LABEL_LONG_TXT_HINT 1 /**< Store some extra info in labels to speed up drawing of very long text */ 747 | #define LV_LABEL_WAIT_CHAR_COUNT 3 /**< The count of wait chart */ 748 | #endif 749 | 750 | #define LV_USE_LED 1 751 | 752 | #define LV_USE_LINE 1 753 | 754 | #define LV_USE_LIST 1 755 | 756 | #define LV_USE_LOTTIE 1 757 | 758 | #define LV_USE_MENU 1 759 | 760 | #define LV_USE_MSGBOX 1 761 | 762 | #define LV_USE_ROLLER 1 /**< Requires: lv_label */ 763 | 764 | #define LV_USE_SCALE 1 765 | 766 | #define LV_USE_SLIDER 1 /**< Requires: lv_bar */ 767 | 768 | #define LV_USE_SPAN 1 769 | #if LV_USE_SPAN 770 | /** A line of text can contain this maximum number of span descriptors. */ 771 | #define LV_SPAN_SNIPPET_STACK_SIZE 64 772 | #endif 773 | 774 | #define LV_USE_SPINBOX 1 775 | 776 | #define LV_USE_SPINNER 1 777 | 778 | #define LV_USE_SWITCH 1 779 | 780 | #define LV_USE_TABLE 1 781 | 782 | #define LV_USE_TABVIEW 1 783 | 784 | #define LV_USE_TEXTAREA 1 /**< Requires: lv_label */ 785 | #if LV_USE_TEXTAREA != 0 786 | #define LV_TEXTAREA_DEF_PWD_SHOW_TIME 1500 /**< [ms] */ 787 | #endif 788 | 789 | #define LV_USE_TILEVIEW 1 790 | 791 | #define LV_USE_WIN 1 792 | 793 | #define LV_USE_3DTEXTURE 0 794 | 795 | /*================== 796 | * THEMES 797 | *==================*/ 798 | /* Documentation for themes can be found here: https://docs.lvgl.io/master/details/common-widget-features/styles/style.html#themes . */ 799 | 800 | /** A simple, impressive and very complete theme */ 801 | #define LV_USE_THEME_DEFAULT 1 802 | #if LV_USE_THEME_DEFAULT 803 | /** 0: Light mode; 1: Dark mode */ 804 | #define LV_THEME_DEFAULT_DARK 0 805 | 806 | /** 1: Enable grow on press */ 807 | #define LV_THEME_DEFAULT_GROW 1 808 | 809 | /** Default transition time in ms. */ 810 | #define LV_THEME_DEFAULT_TRANSITION_TIME 80 811 | #endif /*LV_USE_THEME_DEFAULT*/ 812 | 813 | /** A very simple theme that is a good starting point for a custom theme */ 814 | #define LV_USE_THEME_SIMPLE 1 815 | 816 | /** A theme designed for monochrome displays */ 817 | #define LV_USE_THEME_MONO 1 818 | 819 | /*================== 820 | * LAYOUTS 821 | *==================*/ 822 | /* Documentation for layouts can be found here: https://docs.lvgl.io/master/details/common-widget-features/layouts/index.html . */ 823 | 824 | /** A layout similar to Flexbox in CSS. */ 825 | #define LV_USE_FLEX 1 826 | 827 | /** A layout similar to Grid in CSS. */ 828 | #define LV_USE_GRID 1 829 | 830 | /*==================== 831 | * 3RD PARTS LIBRARIES 832 | *====================*/ 833 | /* Documentation for libraries can be found here: https://docs.lvgl.io/master/details/libs/index.html . */ 834 | 835 | /* File system interfaces for common APIs */ 836 | 837 | /** Setting a default driver letter allows skipping the driver prefix in filepaths. 838 | * Documentation about how to use the below driver-identifier letters can be found at 839 | * https://docs.lvgl.io/master/details/main-modules/fs.html#lv-fs-identifier-letters . */ 840 | #define LV_FS_DEFAULT_DRIVER_LETTER '\0' 841 | 842 | /** API for fopen, fread, etc. */ 843 | #define LV_USE_FS_STDIO 1 844 | #if LV_USE_FS_STDIO 845 | #define LV_FS_STDIO_LETTER 'A' 846 | #define LV_FS_STDIO_PATH "" /**< Set the working directory. File/directory paths will be appended to it. */ 847 | #define LV_FS_STDIO_CACHE_SIZE 0 /**< >0 to cache this number of bytes in lv_fs_read() */ 848 | #endif 849 | 850 | /** API for open, read, etc. */ 851 | #define LV_USE_FS_POSIX 0 852 | #if LV_USE_FS_POSIX 853 | #define LV_FS_POSIX_LETTER '\0' /**< Set an upper-case driver-identifier letter for this driver (e.g. 'A'). */ 854 | #define LV_FS_POSIX_PATH "" /**< Set the working directory. File/directory paths will be appended to it. */ 855 | #define LV_FS_POSIX_CACHE_SIZE 0 /**< >0 to cache this number of bytes in lv_fs_read() */ 856 | #endif 857 | 858 | /** API for CreateFile, ReadFile, etc. */ 859 | #define LV_USE_FS_WIN32 0 860 | #if LV_USE_FS_WIN32 861 | #define LV_FS_WIN32_LETTER '\0' /**< Set an upper-case driver-identifier letter for this driver (e.g. 'A'). */ 862 | #define LV_FS_WIN32_PATH "" /**< Set the working directory. File/directory paths will be appended to it. */ 863 | #define LV_FS_WIN32_CACHE_SIZE 0 /**< >0 to cache this number of bytes in lv_fs_read() */ 864 | #endif 865 | 866 | /** API for FATFS (needs to be added separately). Uses f_open, f_read, etc. */ 867 | #define LV_USE_FS_FATFS 0 868 | #if LV_USE_FS_FATFS 869 | #define LV_FS_FATFS_LETTER '\0' /**< Set an upper-case driver-identifier letter for this driver (e.g. 'A'). */ 870 | #define LV_FS_FATFS_PATH "" /**< Set the working directory. File/directory paths will be appended to it. */ 871 | #define LV_FS_FATFS_CACHE_SIZE 0 /**< >0 to cache this number of bytes in lv_fs_read() */ 872 | #endif 873 | 874 | /** API for memory-mapped file access. */ 875 | #define LV_USE_FS_MEMFS 0 876 | #if LV_USE_FS_MEMFS 877 | #define LV_FS_MEMFS_LETTER '\0' /**< Set an upper-case driver-identifier letter for this driver (e.g. 'A'). */ 878 | #endif 879 | 880 | /** API for LittleFs. */ 881 | #define LV_USE_FS_LITTLEFS 0 882 | #if LV_USE_FS_LITTLEFS 883 | #define LV_FS_LITTLEFS_LETTER '\0' /**< Set an upper-case driver-identifier letter for this driver (e.g. 'A'). */ 884 | #define LV_FS_LITTLEFS_PATH "" /**< Set the working directory. File/directory paths will be appended to it. */ 885 | #endif 886 | 887 | /** API for Arduino LittleFs. */ 888 | #define LV_USE_FS_ARDUINO_ESP_LITTLEFS 0 889 | #if LV_USE_FS_ARDUINO_ESP_LITTLEFS 890 | #define LV_FS_ARDUINO_ESP_LITTLEFS_LETTER '\0' /**< Set an upper-case driver-identifier letter for this driver (e.g. 'A'). */ 891 | #define LV_FS_ARDUINO_ESP_LITTLEFS_PATH "" /**< Set the working directory. File/directory paths will be appended to it. */ 892 | #endif 893 | 894 | /** API for Arduino Sd. */ 895 | #define LV_USE_FS_ARDUINO_SD 0 896 | #if LV_USE_FS_ARDUINO_SD 897 | #define LV_FS_ARDUINO_SD_LETTER '\0' /**< Set an upper-case driver-identifier letter for this driver (e.g. 'A'). */ 898 | #define LV_FS_ARDUINO_SD_PATH "" /**< Set the working directory. File/directory paths will be appended to it. */ 899 | #endif 900 | 901 | /** API for UEFI */ 902 | #define LV_USE_FS_UEFI 0 903 | #if LV_USE_FS_UEFI 904 | #define LV_FS_UEFI_LETTER '\0' /**< Set an upper-case driver-identifier letter for this driver (e.g. 'A'). */ 905 | #endif 906 | 907 | /** LODEPNG decoder library */ 908 | #define LV_USE_LODEPNG 1 909 | 910 | /** PNG decoder(libpng) library */ 911 | #define LV_USE_LIBPNG 0 912 | 913 | /** BMP decoder library */ 914 | #define LV_USE_BMP 1 915 | 916 | /** JPG + split JPG decoder library. 917 | * Split JPG is a custom format optimized for embedded systems. */ 918 | #define LV_USE_TJPGD 1 919 | 920 | /** libjpeg-turbo decoder library. 921 | * - Supports complete JPEG specifications and high-performance JPEG decoding. */ 922 | #define LV_USE_LIBJPEG_TURBO 0 923 | 924 | /** GIF decoder library */ 925 | #define LV_USE_GIF 0 926 | #if LV_USE_GIF 927 | /** GIF decoder accelerate */ 928 | #define LV_GIF_CACHE_DECODE_DATA 0 929 | #endif 930 | 931 | 932 | /** Decode bin images to RAM */ 933 | #define LV_BIN_DECODER_RAM_LOAD 1 934 | 935 | /** RLE decompress library */ 936 | #define LV_USE_RLE 1 937 | 938 | /** QR code library */ 939 | #define LV_USE_QRCODE 1 940 | 941 | /** Barcode code library */ 942 | #define LV_USE_BARCODE 1 943 | 944 | /** FreeType library */ 945 | #define LV_USE_FREETYPE 0 946 | #if LV_USE_FREETYPE 947 | /** Let FreeType use LVGL memory and file porting */ 948 | #define LV_FREETYPE_USE_LVGL_PORT 0 949 | 950 | /** Cache count of glyphs in FreeType, i.e. number of glyphs that can be cached. 951 | * The higher the value, the more memory will be used. */ 952 | #define LV_FREETYPE_CACHE_FT_GLYPH_CNT 256 953 | #endif 954 | 955 | /** Built-in TTF decoder */ 956 | #define LV_USE_TINY_TTF 1 957 | #if LV_USE_TINY_TTF 958 | /* Enable loading TTF data from files */ 959 | #define LV_TINY_TTF_FILE_SUPPORT 0 960 | #define LV_TINY_TTF_CACHE_GLYPH_CNT 256 961 | #endif 962 | 963 | /** Rlottie library */ 964 | #define LV_USE_RLOTTIE 0 965 | 966 | /** Enable Vector Graphic APIs 967 | * - Requires `LV_USE_MATRIX = 1` */ 968 | #define LV_USE_VECTOR_GRAPHIC 1 969 | 970 | /** Enable ThorVG (vector graphics library) from the src/libs folder */ 971 | #define LV_USE_THORVG_INTERNAL 1 972 | 973 | /** Enable ThorVG by assuming that its installed and linked to the project */ 974 | #define LV_USE_THORVG_EXTERNAL 0 975 | 976 | /** Use lvgl built-in LZ4 lib */ 977 | #define LV_USE_LZ4_INTERNAL 1 978 | 979 | /** Use external LZ4 library */ 980 | #define LV_USE_LZ4_EXTERNAL 0 981 | 982 | /*SVG library 983 | * - Requires `LV_USE_VECTOR_GRAPHIC = 1` */ 984 | #define LV_USE_SVG 0 985 | #define LV_USE_SVG_ANIMATION 0 986 | #define LV_USE_SVG_DEBUG 0 987 | 988 | /** FFmpeg library for image decoding and playing videos. 989 | * Supports all major image formats so do not enable other image decoder with it. */ 990 | #define LV_USE_FFMPEG 0 991 | #if LV_USE_FFMPEG 992 | /** Dump input information to stderr */ 993 | #define LV_FFMPEG_DUMP_FORMAT 0 994 | /** Use lvgl file path in FFmpeg Player widget 995 | * You won't be able to open URLs after enabling this feature. 996 | * Note that FFmpeg image decoder will always use lvgl file system. */ 997 | #define LV_FFMPEG_PLAYER_USE_LV_FS 0 998 | #endif 999 | 1000 | /*================== 1001 | * OTHERS 1002 | *==================*/ 1003 | /* Documentation for several of the below items can be found here: https://docs.lvgl.io/master/details/auxiliary-modules/index.html . */ 1004 | 1005 | /** 1: Enable API to take snapshot for object */ 1006 | #define LV_USE_SNAPSHOT 0 1007 | 1008 | /** 1: Enable system monitor component */ 1009 | #define LV_USE_SYSMON 1 1010 | #if LV_USE_SYSMON 1011 | /** Get the idle percentage. E.g. uint32_t my_get_idle(void); */ 1012 | #define LV_SYSMON_GET_IDLE lv_os_get_idle_percent 1013 | 1014 | /** 1: Show CPU usage and FPS count. 1015 | * - Requires `LV_USE_SYSMON = 1` */ 1016 | #define LV_USE_PERF_MONITOR 0 1017 | #if LV_USE_PERF_MONITOR 1018 | #define LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT 1019 | 1020 | /** 0: Displays performance data on the screen; 1: Prints performance data using log. */ 1021 | #define LV_USE_PERF_MONITOR_LOG_MODE 0 1022 | #endif 1023 | 1024 | /** 1: Show used memory and memory fragmentation. 1025 | * - Requires `LV_USE_STDLIB_MALLOC = LV_STDLIB_BUILTIN` 1026 | * - Requires `LV_USE_SYSMON = 1`*/ 1027 | #define LV_USE_MEM_MONITOR 0 1028 | #if LV_USE_MEM_MONITOR 1029 | #define LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_LEFT 1030 | #endif 1031 | #endif /*LV_USE_SYSMON*/ 1032 | 1033 | /** 1: Enable runtime performance profiler */ 1034 | #define LV_USE_PROFILER 0 1035 | #if LV_USE_PROFILER 1036 | /** 1: Enable the built-in profiler */ 1037 | #define LV_USE_PROFILER_BUILTIN 1 1038 | #if LV_USE_PROFILER_BUILTIN 1039 | /** Default profiler trace buffer size */ 1040 | #define LV_PROFILER_BUILTIN_BUF_SIZE (16 * 1024) /**< [bytes] */ 1041 | #define LV_PROFILER_BUILTIN_DEFAULT_ENABLE 1 1042 | #endif 1043 | 1044 | /** Header to include for profiler */ 1045 | #define LV_PROFILER_INCLUDE "lvgl/src/misc/lv_profiler_builtin.h" 1046 | 1047 | /** Profiler start point function */ 1048 | #define LV_PROFILER_BEGIN LV_PROFILER_BUILTIN_BEGIN 1049 | 1050 | /** Profiler end point function */ 1051 | #define LV_PROFILER_END LV_PROFILER_BUILTIN_END 1052 | 1053 | /** Profiler start point function with custom tag */ 1054 | #define LV_PROFILER_BEGIN_TAG LV_PROFILER_BUILTIN_BEGIN_TAG 1055 | 1056 | /** Profiler end point function with custom tag */ 1057 | #define LV_PROFILER_END_TAG LV_PROFILER_BUILTIN_END_TAG 1058 | 1059 | /*Enable layout profiler*/ 1060 | #define LV_PROFILER_LAYOUT 1 1061 | 1062 | /*Enable disp refr profiler*/ 1063 | #define LV_PROFILER_REFR 1 1064 | 1065 | /*Enable draw profiler*/ 1066 | #define LV_PROFILER_DRAW 1 1067 | 1068 | /*Enable indev profiler*/ 1069 | #define LV_PROFILER_INDEV 1 1070 | 1071 | /*Enable decoder profiler*/ 1072 | #define LV_PROFILER_DECODER 1 1073 | 1074 | /*Enable font profiler*/ 1075 | #define LV_PROFILER_FONT 1 1076 | 1077 | /*Enable fs profiler*/ 1078 | #define LV_PROFILER_FS 1 1079 | 1080 | /*Enable style profiler*/ 1081 | #define LV_PROFILER_STYLE 0 1082 | 1083 | /*Enable timer profiler*/ 1084 | #define LV_PROFILER_TIMER 1 1085 | 1086 | /*Enable cache profiler*/ 1087 | #define LV_PROFILER_CACHE 1 1088 | 1089 | /*Enable event profiler*/ 1090 | #define LV_PROFILER_EVENT 1 1091 | #endif 1092 | 1093 | /** 1: Enable Monkey test */ 1094 | #define LV_USE_MONKEY 0 1095 | 1096 | /** 1: Enable grid navigation */ 1097 | #define LV_USE_GRIDNAV 0 1098 | 1099 | /** 1: Enable `lv_obj` fragment logic */ 1100 | #define LV_USE_FRAGMENT 0 1101 | 1102 | /** 1: Support using images as font in label or span widgets */ 1103 | #define LV_USE_IMGFONT 1 1104 | 1105 | /** 1: Enable an observer pattern implementation */ 1106 | #define LV_USE_OBSERVER 1 1107 | 1108 | /** 1: Enable Pinyin input method 1109 | * - Requires: lv_keyboard */ 1110 | #define LV_USE_IME_PINYIN 0 1111 | #if LV_USE_IME_PINYIN 1112 | /** 1: Use default thesaurus. 1113 | * @note If you do not use the default thesaurus, be sure to use `lv_ime_pinyin` after setting the thesaurus. */ 1114 | #define LV_IME_PINYIN_USE_DEFAULT_DICT 1 1115 | /** Set maximum number of candidate panels that can be displayed. 1116 | * @note This needs to be adjusted according to size of screen. */ 1117 | #define LV_IME_PINYIN_CAND_TEXT_NUM 6 1118 | 1119 | /** Use 9-key input (k9). */ 1120 | #define LV_IME_PINYIN_USE_K9_MODE 1 1121 | #if LV_IME_PINYIN_USE_K9_MODE == 1 1122 | #define LV_IME_PINYIN_K9_CAND_TEXT_NUM 3 1123 | #endif /*LV_IME_PINYIN_USE_K9_MODE*/ 1124 | #endif 1125 | 1126 | /** 1: Enable file explorer. 1127 | * - Requires: lv_table */ 1128 | #define LV_USE_FILE_EXPLORER 0 1129 | #if LV_USE_FILE_EXPLORER 1130 | /** Maximum length of path */ 1131 | #define LV_FILE_EXPLORER_PATH_MAX_LEN (128) 1132 | /** Quick access bar, 1:use, 0:do not use. 1133 | * - Requires: lv_list */ 1134 | #define LV_FILE_EXPLORER_QUICK_ACCESS 1 1135 | #endif 1136 | 1137 | /** 1: Enable Font manager */ 1138 | #define LV_USE_FONT_MANAGER 0 1139 | #if LV_USE_FONT_MANAGER 1140 | 1141 | /**Font manager name max length*/ 1142 | #define LV_FONT_MANAGER_NAME_MAX_LEN 32 1143 | 1144 | #endif 1145 | 1146 | /** Enable emulated input devices, time emulation, and screenshot compares. */ 1147 | #define LV_USE_TEST 0 1148 | #if LV_USE_TEST 1149 | 1150 | /** Enable `lv_test_screenshot_compare`. 1151 | * Requires libpng and a few MB of extra RAM. */ 1152 | #define LV_USE_TEST_SCREENSHOT_COMPARE 0 1153 | #endif /*LV_USE_TEST*/ 1154 | 1155 | /** Enable loading XML UIs runtime */ 1156 | #define LV_USE_XML 0 1157 | 1158 | /*1: Enable color filter style*/ 1159 | #define LV_USE_COLOR_FILTER 0 1160 | /*================== 1161 | * DEVICES 1162 | *==================*/ 1163 | 1164 | /** Use SDL to open window on PC and handle mouse and keyboard. */ 1165 | #define LV_USE_SDL 1 1166 | #if LV_USE_SDL 1167 | #define LV_SDL_INCLUDE_PATH 1168 | #define LV_SDL_RENDER_MODE LV_DISPLAY_RENDER_MODE_DIRECT /**< LV_DISPLAY_RENDER_MODE_DIRECT is recommended for best performance */ 1169 | #define LV_SDL_BUF_COUNT 1 /**< 1 or 2 */ 1170 | #define LV_SDL_ACCELERATED 1 /**< 1: Use hardware acceleration*/ 1171 | #define LV_SDL_FULLSCREEN 0 /**< 1: Make the window full screen by default */ 1172 | #define LV_SDL_DIRECT_EXIT 1 /**< 1: Exit the application when all SDL windows are closed */ 1173 | #define LV_SDL_MOUSEWHEEL_MODE LV_SDL_MOUSEWHEEL_MODE_ENCODER /*LV_SDL_MOUSEWHEEL_MODE_ENCODER/CROWN*/ 1174 | #endif 1175 | 1176 | /** Use X11 to open window on Linux desktop and handle mouse and keyboard */ 1177 | #define LV_USE_X11 0 1178 | #if LV_USE_X11 1179 | #define LV_X11_DIRECT_EXIT 1 /**< Exit application when all X11 windows have been closed */ 1180 | #define LV_X11_DOUBLE_BUFFER 1 /**< Use double buffers for rendering */ 1181 | /* Select only 1 of the following render modes (LV_X11_RENDER_MODE_PARTIAL preferred!). */ 1182 | #define LV_X11_RENDER_MODE_PARTIAL 1 /**< Partial render mode (preferred) */ 1183 | #define LV_X11_RENDER_MODE_DIRECT 0 /**< Direct render mode */ 1184 | #define LV_X11_RENDER_MODE_FULL 0 /**< Full render mode */ 1185 | #endif 1186 | 1187 | /** Use Wayland to open a window and handle input on Linux or BSD desktops */ 1188 | #define LV_USE_WAYLAND 0 1189 | #if LV_USE_WAYLAND 1190 | #define LV_WAYLAND_WINDOW_DECORATIONS 0 /**< Draw client side window decorations only necessary on Mutter/GNOME */ 1191 | #define LV_WAYLAND_WL_SHELL 0 /**< Use the legacy wl_shell protocol instead of the default XDG shell */ 1192 | #endif 1193 | 1194 | /** Driver for /dev/fb */ 1195 | #define LV_USE_LINUX_FBDEV 0 1196 | #if LV_USE_LINUX_FBDEV 1197 | #define LV_LINUX_FBDEV_BSD 0 1198 | #define LV_LINUX_FBDEV_RENDER_MODE LV_DISPLAY_RENDER_MODE_PARTIAL 1199 | #define LV_LINUX_FBDEV_BUFFER_COUNT 0 1200 | #define LV_LINUX_FBDEV_BUFFER_SIZE 60 1201 | #define LV_LINUX_FBDEV_MMAP 1 1202 | #endif 1203 | 1204 | /** Use Nuttx to open window and handle touchscreen */ 1205 | #define LV_USE_NUTTX 0 1206 | 1207 | #if LV_USE_NUTTX 1208 | #define LV_USE_NUTTX_INDEPENDENT_IMAGE_HEAP 0 1209 | 1210 | /** Use independent image heap for default draw buffer */ 1211 | #define LV_NUTTX_DEFAULT_DRAW_BUF_USE_INDEPENDENT_IMAGE_HEAP 0 1212 | 1213 | #define LV_USE_NUTTX_LIBUV 0 1214 | 1215 | /** Use Nuttx custom init API to open window and handle touchscreen */ 1216 | #define LV_USE_NUTTX_CUSTOM_INIT 0 1217 | 1218 | /** Driver for /dev/lcd */ 1219 | #define LV_USE_NUTTX_LCD 0 1220 | #if LV_USE_NUTTX_LCD 1221 | #define LV_NUTTX_LCD_BUFFER_COUNT 0 1222 | #define LV_NUTTX_LCD_BUFFER_SIZE 60 1223 | #endif 1224 | 1225 | /** Driver for /dev/input */ 1226 | #define LV_USE_NUTTX_TOUCHSCREEN 0 1227 | 1228 | /*Touchscreen cursor size in pixels(<=0: disable cursor)*/ 1229 | #define LV_NUTTX_TOUCHSCREEN_CURSOR_SIZE 0 1230 | #endif 1231 | 1232 | /** Driver for /dev/dri/card */ 1233 | #define LV_USE_LINUX_DRM 0 1234 | 1235 | #if LV_USE_LINUX_DRM 1236 | 1237 | /* Use the MESA GBM library to allocate DMA buffers that can be 1238 | * shared across sub-systems and libraries using the Linux DMA-BUF API. 1239 | * The GBM library aims to provide a platform independent memory management system 1240 | * it supports the major GPU vendors - This option requires linking with libgbm */ 1241 | #define LV_LINUX_DRM_GBM_BUFFERS 0 1242 | #endif 1243 | 1244 | /** Interface for TFT_eSPI */ 1245 | #define LV_USE_TFT_ESPI 0 1246 | 1247 | /** Driver for evdev input devices */ 1248 | #define LV_USE_EVDEV 0 1249 | 1250 | /** Driver for libinput input devices */ 1251 | #define LV_USE_LIBINPUT 0 1252 | 1253 | #if LV_USE_LIBINPUT 1254 | #define LV_LIBINPUT_BSD 0 1255 | 1256 | /** Full keyboard support */ 1257 | #define LV_LIBINPUT_XKB 0 1258 | #if LV_LIBINPUT_XKB 1259 | /** "setxkbmap -query" can help find the right values for your keyboard */ 1260 | #define LV_LIBINPUT_XKB_KEY_MAP { .rules = NULL, .model = "pc101", .layout = "us", .variant = NULL, .options = NULL } 1261 | #endif 1262 | #endif 1263 | 1264 | /* Drivers for LCD devices connected via SPI/parallel port */ 1265 | #define LV_USE_ST7735 0 1266 | #define LV_USE_ST7789 0 1267 | #define LV_USE_ST7796 0 1268 | #define LV_USE_ILI9341 0 1269 | #define LV_USE_FT81X 0 1270 | 1271 | #if (LV_USE_ST7735 | LV_USE_ST7789 | LV_USE_ST7796 | LV_USE_ILI9341) 1272 | #define LV_USE_GENERIC_MIPI 1 1273 | #else 1274 | #define LV_USE_GENERIC_MIPI 0 1275 | #endif 1276 | 1277 | /** Driver for Renesas GLCD */ 1278 | #define LV_USE_RENESAS_GLCDC 0 1279 | 1280 | /** Driver for ST LTDC */ 1281 | #define LV_USE_ST_LTDC 0 1282 | #if LV_USE_ST_LTDC 1283 | /* Only used for partial. */ 1284 | #define LV_ST_LTDC_USE_DMA2D_FLUSH 0 1285 | #endif 1286 | 1287 | /** LVGL Windows backend */ 1288 | #define LV_USE_WINDOWS 0 1289 | 1290 | /** LVGL UEFI backend */ 1291 | #define LV_USE_UEFI 0 1292 | #if LV_USE_UEFI 1293 | #define LV_USE_UEFI_INCLUDE "myefi.h" /**< Header that hides the actual framework (EDK2, gnu-efi, ...) */ 1294 | #define LV_UEFI_USE_MEMORY_SERVICES 0 /**< Use the memory functions from the boot services table */ 1295 | #endif 1296 | 1297 | /** Use OpenGL to open window on PC and handle mouse and keyboard */ 1298 | #define LV_USE_OPENGLES 0 1299 | #if LV_USE_OPENGLES 1300 | #define LV_USE_OPENGLES_DEBUG 1 /**< Enable or disable debug for opengles */ 1301 | #endif 1302 | 1303 | /** QNX Screen display and input drivers */ 1304 | #define LV_USE_QNX 0 1305 | #if LV_USE_QNX 1306 | #define LV_QNX_BUF_COUNT 1 /**< 1 or 2 */ 1307 | #endif 1308 | 1309 | /*===================== 1310 | * BUILD OPTIONS 1311 | *======================*/ 1312 | 1313 | /** Enable examples to be built with the library. */ 1314 | #define LV_BUILD_EXAMPLES 1 1315 | 1316 | /** Build the demos */ 1317 | #define LV_BUILD_DEMOS 1 1318 | 1319 | /*=================== 1320 | * DEMO USAGE 1321 | ====================*/ 1322 | 1323 | #if LV_BUILD_DEMOS 1324 | /** Show some widgets. This might be required to increase `LV_MEM_SIZE`. */ 1325 | #define LV_USE_DEMO_WIDGETS 1 1326 | 1327 | /** Demonstrate usage of encoder and keyboard. */ 1328 | #define LV_USE_DEMO_KEYPAD_AND_ENCODER 1 1329 | 1330 | /** Benchmark your system */ 1331 | #define LV_USE_DEMO_BENCHMARK 1 1332 | 1333 | #if LV_USE_DEMO_BENCHMARK 1334 | /** Use fonts where bitmaps are aligned 16 byte and has Nx16 byte stride */ 1335 | #define LV_DEMO_BENCHMARK_ALIGNED_FONTS 0 1336 | #endif 1337 | 1338 | /** Render test for each primitive. 1339 | * - Requires at least 480x272 display. */ 1340 | #define LV_USE_DEMO_RENDER 1 1341 | 1342 | /** Stress test for LVGL */ 1343 | #define LV_USE_DEMO_STRESS 1 1344 | 1345 | /** Music player demo */ 1346 | #define LV_USE_DEMO_MUSIC 1 1347 | #if LV_USE_DEMO_MUSIC 1348 | #define LV_DEMO_MUSIC_SQUARE 0 1349 | #define LV_DEMO_MUSIC_LANDSCAPE 0 1350 | #define LV_DEMO_MUSIC_ROUND 0 1351 | #define LV_DEMO_MUSIC_LARGE 0 1352 | #define LV_DEMO_MUSIC_AUTO_PLAY 0 1353 | #endif 1354 | 1355 | /** Vector graphic demo */ 1356 | #define LV_USE_DEMO_VECTOR_GRAPHIC 0 1357 | 1358 | /*--------------------------- 1359 | * Demos from lvgl/lv_demos 1360 | ---------------------------*/ 1361 | 1362 | /** Flex layout demo */ 1363 | #define LV_USE_DEMO_FLEX_LAYOUT 1 1364 | 1365 | /** Smart-phone like multi-language demo */ 1366 | #define LV_USE_DEMO_MULTILANG 1 1367 | 1368 | /** Widget transformation demo */ 1369 | #define LV_USE_DEMO_TRANSFORM 1 1370 | 1371 | /** Demonstrate scroll settings */ 1372 | #define LV_USE_DEMO_SCROLL 1 1373 | 1374 | /*E-bike demo with Lottie animations (if LV_USE_LOTTIE is enabled)*/ 1375 | #define LV_USE_DEMO_EBIKE 0 1376 | #if LV_USE_DEMO_EBIKE 1377 | #define LV_DEMO_EBIKE_PORTRAIT 0 /*0: for 480x270..480x320, 1: for 480x800..720x1280*/ 1378 | #endif 1379 | 1380 | /** High-resolution demo */ 1381 | #define LV_USE_DEMO_HIGH_RES 0 1382 | 1383 | /* Smart watch demo */ 1384 | #define LV_USE_DEMO_SMARTWATCH 0 1385 | #endif /* LV_BUILD_DEMOS */ 1386 | 1387 | /*--END OF LV_CONF_H--*/ 1388 | 1389 | #endif /*LV_CONF_H*/ 1390 | 1391 | #endif /*End of "Content enable"*/ 1392 | -------------------------------------------------------------------------------- /main.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file main 3 | * 4 | */ 5 | 6 | /********************* 7 | * INCLUDES 8 | *********************/ 9 | #include "lvgl/lvgl.h" 10 | #include "lvgl/examples/lv_examples.h" 11 | #include "lvgl/demos/lv_demos.h" 12 | 13 | /********************* 14 | * DEFINES 15 | *********************/ 16 | 17 | /********************** 18 | * TYPEDEFS 19 | **********************/ 20 | 21 | /********************** 22 | * STATIC PROTOTYPES 23 | **********************/ 24 | static lv_display_t * hal_init(int32_t w, int32_t h); 25 | 26 | /********************** 27 | * STATIC VARIABLES 28 | **********************/ 29 | 30 | /********************** 31 | * MACROS 32 | **********************/ 33 | 34 | /********************** 35 | * GLOBAL FUNCTIONS 36 | **********************/ 37 | 38 | /********************* 39 | * DEFINES 40 | *********************/ 41 | 42 | /********************** 43 | * TYPEDEFS 44 | **********************/ 45 | 46 | /********************** 47 | * VARIABLES 48 | **********************/ 49 | 50 | /********************** 51 | * STATIC PROTOTYPES 52 | **********************/ 53 | 54 | /********************** 55 | * GLOBAL FUNCTIONS 56 | **********************/ 57 | 58 | int main(int argc, char **argv) 59 | { 60 | /*Initialize LVGL*/ 61 | lv_init(); 62 | 63 | /*Initialize the display, and the input devices*/ 64 | hal_init(480, 320); 65 | 66 | /*Open a demo or an example*/ 67 | if (argc <= 1) { 68 | /*If not argument if provided just a open a demo or an example.*/ 69 | lv_demo_widgets(); 70 | // lv_example_chart_1(); 71 | } else { 72 | /*Process the command line arguments and open the related demo*/ 73 | if (!lv_demos_create(&argv[1], argc - 1)) { 74 | lv_demos_show_help(); 75 | goto demo_end; 76 | } 77 | } 78 | 79 | /*To hide the memory and performance indicators in the corners 80 | *disable `LV_USE_MEM_MONITOR` and `LV_USE_PERF_MONITOR` in `lv_conf.h`*/ 81 | 82 | while(1) { 83 | /* Periodically call the lv_timer_handler. */ 84 | uint32_t time_until_next = lv_timer_handler(); 85 | 86 | if (time_until_next == LV_NO_TIMER_READY) { 87 | /* Simply sleep for a while. */ 88 | time_until_next = LV_DEF_REFR_PERIOD; 89 | } 90 | 91 | lv_delay_ms(time_until_next); 92 | } 93 | 94 | demo_end: 95 | lv_deinit(); 96 | return 0; 97 | } 98 | 99 | /********************** 100 | * STATIC FUNCTIONS 101 | **********************/ 102 | 103 | /** 104 | * Initialize the Hardware Abstraction Layer (HAL) for the LVGL graphics 105 | * library 106 | */ 107 | static lv_display_t * hal_init(int32_t w, int32_t h) 108 | { 109 | lv_group_set_default(lv_group_create()); 110 | 111 | lv_display_t * disp = lv_sdl_window_create(w, h); 112 | 113 | lv_indev_t * mouse = lv_sdl_mouse_create(); 114 | lv_indev_set_group(mouse, lv_group_get_default()); 115 | lv_indev_set_display(mouse, disp); 116 | lv_display_set_default(disp); 117 | 118 | LV_IMAGE_DECLARE(mouse_cursor_icon); /*Declare the image file.*/ 119 | lv_obj_t * cursor_obj; 120 | cursor_obj = lv_image_create(lv_screen_active()); /*Create an image object for the cursor */ 121 | lv_image_set_src(cursor_obj, &mouse_cursor_icon); /*Set the image source*/ 122 | lv_indev_set_cursor(mouse, cursor_obj); /*Connect the image object to the driver*/ 123 | 124 | lv_indev_t * mousewheel = lv_sdl_mousewheel_create(); 125 | lv_indev_set_display(mousewheel, disp); 126 | 127 | lv_indev_t * keyboard = lv_sdl_keyboard_create(); 128 | lv_indev_set_display(keyboard, disp); 129 | lv_indev_set_group(keyboard, lv_group_get_default()); 130 | 131 | return disp; 132 | } 133 | -------------------------------------------------------------------------------- /manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Eclipse Simulator with SDL", 3 | "maintainer": "LVGL", 4 | "hostOperatingsystem": [ 5 | "Linux", 6 | "Windows", 7 | "MacOS" 8 | ], 9 | "environment": [ 10 | "Eclipse", 11 | "SDL" 12 | ], 13 | "description": "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. The PC simulator is cross platform. Windows, Linux and OSX are supported, however on Windows it's easier to get started with a another simulator project. This project uses Eclipse CDT (as an IDE) and SDL =a low level driver library to open a window, and handle mouse, keyboard etc.)", 14 | "shortDescription": "Eclipse-based project to run LVGL on PC.", 15 | "urlToClone": "https://github.com/lvgl/lv_port_pc_eclipse", 16 | "logos": [ 17 | "https://raw.githubusercontent.com/lvgl/project-creator/master/meta/images/eclipse/logo.svg" 18 | ], 19 | "image": "https://raw.githubusercontent.com/lvgl/project-creator/master/meta/images/eclipse/logo.svg", 20 | "branches": [ 21 | "release/v9.2" 22 | ], 23 | "tags": [ 24 | "master", 25 | "v9.2.2" 26 | ], 27 | "settings": [ 28 | { 29 | "type": "dropdown", 30 | "label": "Color Depth", 31 | "options": [ 32 | { 33 | "name": "16 (RGB565)", 34 | "value": "16" 35 | }, 36 | { 37 | "name": "24 (RGB565)", 38 | "value": "24" 39 | }, 40 | { 41 | "name": "32 (RGB565)", 42 | "value": "32" 43 | } 44 | ], 45 | "actions": [ 46 | { 47 | "toReplace": "#define LV_COLOR_DEPTH \\d+", 48 | "newContent": "#define LV_COLOR_DEPTH {value}", 49 | "filePath": "lv_conf.h" 50 | } 51 | ] 52 | }, 53 | { 54 | "type": "dropdown", 55 | "label": "Show performance monitor", 56 | "options": [ 57 | { 58 | "name": "Yes", 59 | "value": "1" 60 | }, 61 | { 62 | "name": "No", 63 | "value": "0", 64 | "default": "true" 65 | } 66 | ], 67 | "actions": [ 68 | { 69 | "toReplace": " *#define LV_USE_PERF_MONITOR .*", 70 | "newContent": " #define LV_USE_PERF_MONITOR {value}", 71 | "filePath": "lv_conf.h" 72 | } 73 | ] 74 | } 75 | ] 76 | } 77 | -------------------------------------------------------------------------------- /mouse_cursor_icon.c: -------------------------------------------------------------------------------- 1 | #ifdef __has_include 2 | #if __has_include("lvgl.h") 3 | #ifndef LV_LVGL_H_INCLUDE_SIMPLE 4 | #define LV_LVGL_H_INCLUDE_SIMPLE 5 | #endif 6 | #endif 7 | #endif 8 | 9 | #if defined(LV_LVGL_H_INCLUDE_SIMPLE) 10 | #include "lvgl.h" 11 | #else 12 | #include "lvgl/lvgl.h" 13 | #endif 14 | 15 | 16 | #ifndef LV_ATTRIBUTE_MEM_ALIGN 17 | #define LV_ATTRIBUTE_MEM_ALIGN 18 | #endif 19 | 20 | #ifndef LV_ATTRIBUTE_IMAGE_MOUSE_CURSOR_ICON 21 | #define LV_ATTRIBUTE_IMAGE_MOUSE_CURSOR_ICON 22 | #endif 23 | 24 | const LV_ATTRIBUTE_MEM_ALIGN LV_ATTRIBUTE_LARGE_CONST LV_ATTRIBUTE_IMAGE_MOUSE_CURSOR_ICON uint8_t mouse_cursor_icon_map[] = { 25 | 0x78, 0x78, 0x78, 0xff, 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, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 26 | 0x00, 0x00, 0x00, 0xff, 0x69, 0x69, 0x69, 0xff, 0xed, 0xed, 0xed, 0x54, 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, 0x00, 0x00, 0x00, 0x00, 27 | 0x00, 0x00, 0x00, 0xff, 0x1b, 0x1b, 0x1b, 0xff, 0x6c, 0x6c, 0x6c, 0xff, 0xec, 0xec, 0xec, 0x35, 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, 28 | 0x00, 0x00, 0x00, 0xff, 0xdc, 0xdc, 0xdc, 0xff, 0x16, 0x16, 0x16, 0xff, 0x75, 0x75, 0x75, 0xff, 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, 29 | 0x00, 0x00, 0x00, 0xff, 0xfe, 0xfe, 0xfe, 0xff, 0xd6, 0xd6, 0xd6, 0xff, 0x13, 0x13, 0x13, 0xff, 0x7f, 0x7f, 0x7f, 0xff, 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, 30 | 0x00, 0x00, 0x00, 0xff, 0xfb, 0xfb, 0xfb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xd0, 0xd0, 0xd0, 0xff, 0x11, 0x11, 0x11, 0xff, 0x87, 0x87, 0x87, 0xff, 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, 31 | 0x00, 0x00, 0x00, 0xff, 0xf7, 0xf7, 0xf7, 0xff, 0xfe, 0xfe, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc9, 0xc9, 0xc9, 0xff, 0x0f, 0x0f, 0x0f, 0xff, 0x8f, 0x8f, 0x8f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 32 | 0x00, 0x00, 0x00, 0xff, 0xf4, 0xf4, 0xf4, 0xff, 0xfb, 0xfb, 0xfb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, 0xc3, 0xc3, 0xff, 0x0f, 0x0f, 0x0f, 0xff, 0x97, 0x97, 0x97, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 33 | 0x00, 0x00, 0x00, 0xff, 0xf0, 0xf0, 0xf0, 0xff, 0xf8, 0xf8, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xbb, 0xbb, 0xbb, 0xff, 0x0f, 0x0f, 0x0f, 0xff, 0x9f, 0x9f, 0x9f, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 34 | 0x00, 0x00, 0x00, 0xff, 0xed, 0xed, 0xed, 0xff, 0xf4, 0xf4, 0xf4, 0xff, 0xfb, 0xfb, 0xfb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb4, 0xb4, 0xb4, 0xff, 0x10, 0x10, 0x10, 0xff, 0xa6, 0xa6, 0xa6, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 35 | 0x00, 0x00, 0x00, 0xff, 0xe9, 0xe9, 0xe9, 0xff, 0xf1, 0xf1, 0xf1, 0xff, 0xf8, 0xf8, 0xf8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xaa, 0xaa, 0xaa, 0xff, 0x11, 0x11, 0x11, 0xff, 0xae, 0xae, 0xae, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 36 | 0x00, 0x00, 0x00, 0xff, 0xe6, 0xe6, 0xe6, 0xff, 0xed, 0xed, 0xed, 0xff, 0xf4, 0xf4, 0xf4, 0xff, 0xfb, 0xfb, 0xfb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xa3, 0xa3, 0xa3, 0xff, 0x13, 0x13, 0x13, 0xff, 0xb4, 0xb4, 0xb4, 0xff, 0x00, 0x00, 0x00, 0x00, 37 | 0x00, 0x00, 0x00, 0xff, 0xe3, 0xe3, 0xe3, 0xff, 0xea, 0xea, 0xea, 0xff, 0xf1, 0xf1, 0xf1, 0xff, 0xf8, 0xf8, 0xf8, 0xff, 0xfd, 0xfd, 0xfd, 0xff, 0x2d, 0x2d, 0x2d, 0xff, 0x0b, 0x0b, 0x0b, 0xff, 0x0b, 0x0b, 0x0b, 0xff, 0x0b, 0x0b, 0x0b, 0xff, 0x01, 0x01, 0x01, 0xff, 0x13, 0x13, 0x13, 0xff, 0xc5, 0xc5, 0xc5, 0xff, 38 | 0x00, 0x00, 0x00, 0xff, 0xdf, 0xdf, 0xdf, 0xff, 0xe6, 0xe6, 0xe6, 0xff, 0xd7, 0xd7, 0xd7, 0xff, 0x9c, 0x9c, 0x9c, 0xff, 0xfc, 0xfc, 0xfc, 0xff, 0x91, 0x91, 0x91, 0xff, 0x2a, 0x2a, 0x2a, 0xff, 0x94, 0x94, 0x94, 0xff, 0xa3, 0xa3, 0xa3, 0xff, 0xa6, 0xa6, 0xa6, 0xff, 0xac, 0xac, 0xac, 0xff, 0xce, 0xce, 0xce, 0xff, 39 | 0x00, 0x00, 0x00, 0xff, 0xdc, 0xdc, 0xdc, 0xff, 0xcb, 0xcb, 0xcb, 0xff, 0x1f, 0x1f, 0x1f, 0xff, 0x0f, 0x0f, 0x0f, 0xff, 0xeb, 0xeb, 0xeb, 0xff, 0xf5, 0xf5, 0xf5, 0xff, 0x13, 0x13, 0x13, 0xff, 0x98, 0x98, 0x98, 0xff, 0xe5, 0xe5, 0xe5, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 40 | 0x00, 0x00, 0x00, 0xff, 0xc0, 0xc0, 0xc0, 0xff, 0x1b, 0x1b, 0x1b, 0xff, 0x4e, 0x4e, 0x4e, 0xff, 0x38, 0x38, 0x38, 0xff, 0x80, 0x80, 0x80, 0xff, 0xfc, 0xfc, 0xfc, 0xff, 0x81, 0x81, 0x81, 0xff, 0x40, 0x40, 0x40, 0xff, 0xe4, 0xe4, 0xe4, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 41 | 0x00, 0x00, 0x00, 0xff, 0x19, 0x19, 0x19, 0xff, 0x54, 0x54, 0x54, 0xff, 0xba, 0xba, 0xba, 0xff, 0xb1, 0xb1, 0xb1, 0xff, 0x12, 0x12, 0x12, 0xff, 0xed, 0xed, 0xed, 0xff, 0xef, 0xef, 0xef, 0xff, 0x0f, 0x0f, 0x0f, 0xff, 0xb2, 0xb2, 0xb2, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 42 | 0x01, 0x01, 0x01, 0xff, 0x5d, 0x5d, 0x5d, 0xff, 0xbe, 0xbe, 0xbe, 0xff, 0xed, 0xed, 0xed, 0x54, 0x00, 0x00, 0x00, 0x00, 0x44, 0x44, 0x44, 0xff, 0x83, 0x83, 0x83, 0xff, 0xfc, 0xfc, 0xfc, 0xff, 0x40, 0x40, 0x40, 0xff, 0x76, 0x76, 0x76, 0xff, 0xec, 0xec, 0xec, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 43 | 0x81, 0x81, 0x81, 0xff, 0xca, 0xca, 0xca, 0xff, 0xec, 0xec, 0xec, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xbd, 0xbd, 0xbd, 0xff, 0x0f, 0x0f, 0x0f, 0xff, 0x45, 0x45, 0x45, 0xff, 0x14, 0x14, 0x14, 0xff, 0x91, 0x91, 0x91, 0xff, 0xf3, 0xf3, 0xf3, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 44 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb3, 0xb3, 0xb3, 0xff, 0x6f, 0x6f, 0x6f, 0xff, 0x9a, 0x9a, 0x9a, 0xff, 0xd7, 0xd7, 0xd7, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 45 | 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, 0xec, 0xec, 0xec, 0x35, 0xf3, 0xf3, 0xf3, 0x16, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 46 | }; 47 | 48 | const lv_img_dsc_t mouse_cursor_icon = { 49 | .header.cf = LV_COLOR_FORMAT_ARGB8888, 50 | .header.w = 13, 51 | .header.h = 21, 52 | .data_size = 273 * 4, 53 | .data = mouse_cursor_icon_map, 54 | }; 55 | -------------------------------------------------------------------------------- /mouse_cursor_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lvgl/lv_port_pc_eclipse/b188326ac93487bf26dd8e3c9794c6b252cc24c4/mouse_cursor_icon.png -------------------------------------------------------------------------------- /pc_simulator.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | --------------------------------------------------------------------------------