Skip to content

Commit

Permalink
Upgrade LVGL to v9.1 (#338)
Browse files Browse the repository at this point in the history
  • Loading branch information
PGNetHun committed Mar 20, 2024
1 parent 526656f commit 8aba1e9
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 33 deletions.
113 changes: 81 additions & 32 deletions lv_conf.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @file lv_conf.h
* Configuration file for v9.0.0
* Configuration file for v9.1.0
*/

/*
Expand All @@ -17,6 +17,11 @@
#ifndef LV_CONF_H
#define LV_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
*====================*/
Expand All @@ -39,10 +44,16 @@
#define LV_USE_STDLIB_STRING LV_STDLIB_BUILTIN
#define LV_USE_STDLIB_SPRINTF LV_STDLIB_BUILTIN

#define LV_STDINT_INCLUDE <stdint.h>
#define LV_STDDEF_INCLUDE <stddef.h>
#define LV_STDBOOL_INCLUDE <stdbool.h>
#define LV_INTTYPES_INCLUDE <inttypes.h>
#define LV_LIMITS_INCLUDE <limits.h>
#define LV_STDARG_INCLUDE <stdarg.h>

#if LV_USE_STDLIB_MALLOC == LV_STDLIB_BUILTIN
/*Size of the memory available for `lv_malloc()` in bytes (>= 2kB)*/
#define LV_MEM_SIZE (256 * 1024U) /*[bytes]*/
#define LV_MEM_SIZE (64 * 1024U) /*[bytes]*/

/*Size of the memory expand for `lv_malloc()` in bytes*/
#define LV_MEM_POOL_EXPAND_SIZE 0
Expand All @@ -54,7 +65,7 @@
#undef LV_MEM_POOL_INCLUDE
#undef LV_MEM_POOL_ALLOC
#endif
#endif /*LV_USE_MALLOC == LV_STDLIB_BUILTIN*/
#endif /*LV_USE_STDLIB_MALLOC == LV_STDLIB_BUILTIN*/

/*====================
HAL SETTINGS
Expand Down Expand Up @@ -94,6 +105,14 @@
/*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.
Expand All @@ -104,13 +123,8 @@
/* Use Arm-2D to accelerate the sw render */
#define LV_USE_DRAW_ARM2D_SYNC 0

/* 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_SW_LAYER_SIMPLE_BUF_SIZE (24 * 1024) /*[bytes]*/
/* 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 */
Expand Down Expand Up @@ -176,6 +190,24 @@
/* 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

/*=======================
Expand Down Expand Up @@ -328,6 +360,9 @@ extern void mp_lv_init_gc();
/*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

Expand Down Expand Up @@ -645,6 +680,18 @@ extern void mp_lv_init_gc();
#define LV_FS_MEMFS_LETTER 'M' /*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

/*API for Arduino LittleFs. */
#define LV_USE_FS_ARDUINO_ESP_LITTLEFS 0
#if LV_USE_FS_ARDUINO_ESP_LITTLEFS
#define LV_FS_ARDUINO_ESP_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 1

Expand Down Expand Up @@ -688,16 +735,11 @@ extern void mp_lv_init_gc();
#define LV_USE_FREETYPE 0
#endif
#if LV_USE_FREETYPE
/*Memory used by FreeType to cache characters in kilobytes*/
#define LV_FREETYPE_CACHE_SIZE 768

/*Let FreeType to use LVGL memory and file porting*/
#define LV_FREETYPE_USE_LVGL_PORT 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 8
#define LV_FREETYPE_CACHE_FT_SIZES 8
/*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

Expand Down Expand Up @@ -726,9 +768,6 @@ extern void mp_lv_init_gc();
/* Enable ThorVG by assuming that its installed and linked to the project */
#define LV_USE_THORVG_EXTERNAL 0

/*Enable LZ4 compress/decompress lib*/
#define LV_USE_LZ4 0

/*Use lvgl built-in LZ4 lib*/
#define LV_USE_LZ4_INTERNAL 0

Expand Down Expand Up @@ -756,7 +795,6 @@ extern void mp_lv_init_gc();

/*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
Expand All @@ -772,7 +810,7 @@ extern void mp_lv_init_gc();
#endif

/*1: Show the used memory and the memory fragmentation
* Requires `LV_USE_BUILTIN_MALLOC = 1`
* Requires `LV_USE_STDLIB_MALLOC = LV_STDLIB_BUILTIN`
* Requires `LV_USE_SYSMON = 1`*/
#define LV_USE_MEM_MONITOR 0
#if LV_USE_MEM_MONITOR
Expand Down Expand Up @@ -851,10 +889,10 @@ extern void mp_lv_init_gc();
#endif
#if LV_USE_FILE_EXPLORER
/*Maximum length of path*/
#define LV_FILE_EXPLORER_PATH_MAX_LEN (128)
#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
#define LV_FILE_EXPLORER_QUICK_ACCESS 1
#endif

/*==================
Expand All @@ -868,11 +906,12 @@ extern void mp_lv_init_gc();
#define LV_USE_SDL 0
#endif
#if LV_USE_SDL
#define LV_SDL_INCLUDE_PATH <SDL2/SDL.h>
#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_INCLUDE_PATH <SDL2/SDL.h>
#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*/
Expand Down Expand Up @@ -928,6 +967,19 @@ extern void mp_lv_init_gc();
/*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
Expand All @@ -954,9 +1006,6 @@ extern void mp_lv_init_gc();

/*Show some widget. It might be required to increase `LV_MEM_SIZE` */
#define LV_USE_DEMO_WIDGETS 0
#if LV_USE_DEMO_WIDGETS
#define LV_DEMO_WIDGETS_SLIDESHOW 0
#endif

/*Demonstrate the usage of encoder and keyboard*/
#define LV_USE_DEMO_KEYPAD_AND_ENCODER 0
Expand Down
2 changes: 1 addition & 1 deletion lvgl
Submodule lvgl updated 782 files

0 comments on commit 8aba1e9

Please sign in to comment.