Loading...
Searching...
No Matches
LVGL - Open-Source Embedded GUI Library

LVGL package for RIOT. More...

Detailed Description

LVGL package for RIOT.

See also
https://github.com/LVGL/lvgl

Configuration options

The package can be configured with using several variables. These variables can either be configured using CFLAGS or using Kconfig (via make menuconfig). LVGL_TASK_THREAD_PRIO cannot be configured via Kconfig.

Engine settings

Example of command line for changing the max activity period to 5s:

CFLAGS=-DCONFIG_LVGL_ACTIVITY_PERIOD=5000 make -C tests/pkg/lvgl

SDL Usage

See LVGL Drivers.

Files

file  lvgl_riot.h
 Definition for the LVGL engine initialization.
 
file  lvgl_riot_conf.h
 Definitions specific to RIOT for the LVGL engine.
 
#define LV_CONF_H   1
 LVGL configuration macros.
 
#define LV_COLOR_DEPTH   16
 Color depth.
 
#define LV_COLOR_16_SWAP   0
 Swap the 2 bytes of RGB565 color.
 
#define LV_COLOR_16_SWAP   0
 Swap the 2 bytes of RGB565 color.
 
#define LV_COLOR_SCREEN_TRANSP   0
 Enable more complex drawing routines to manage screen transparency.
 
#define LV_COLOR_CHROMA_KEY   lv_color_hex(0x00ff00)
 Image pixels with this color will not be drawn if they are chroma keyed.
 
#define LV_MEM_CUSTOM   0
 Memory allocation functions.
 
#define LV_MEM_SIZE   (5U * 1024U)
 Size of the memory available for lv_mem_alloc() in bytes (>= 2kB)
 
#define LV_MEM_ADR   0 /* 0: unused */
 Set an address for the memory pool instead of allocating it as a normal array.
 
#define LV_MEM_BUF_MAX_NUM   16
 Number of the intermediate memory buffers.
 
#define LV_MEMCPY_MEMSET_STD   1
 Use the standard memcpy and memset instead of LVGL's own functions.
 
#define LV_DISP_DEF_REFR_PERIOD   30 /* [ms] */
 Default display refresh period.
 
#define LV_INDEV_DEF_READ_PERIOD   30 /* [ms] */
 Input device read period in milliseconds.
 
#define LV_DPI_DEF   130 /* [px/inch] */
 Default Dot Per Inch.
 
#define LV_DRAW_COMPLEX   1
 Enable complex draw engine.
 
#define LV_IMG_CACHE_DEF_SIZE   0
 Default image cache size.
 
#define LV_GRADIENT_MAX_STOPS   2
 Number of stops allowed per gradient.
 
#define LV_GRAD_CACHE_DEF_SIZE   0
 Default gradient buffer size.
 
#define LV_DISP_ROT_MAX_BUF   (10*1024)
 Maximum buffer size to allocate for rotation.
 
#define LV_USE_GPU_STM32_DMA2D   0
 Use STM32's DMA2D (aka Chrom Art) GPU.
 
#define LV_USE_GPU_NXP_PXP   0
 Use NXP's PXP GPU iMX RTxxx platforms.
 
#define LV_USE_GPU_NXP_VG_LITE   0
 Use NXP's VG-Lite GPU iMX RTxxx platforms.
 
#define LV_USE_LOG   0
 Enable the log module.
 
#define LV_USE_ASSERT_NULL   0
 Enable asserts if an operation is failed or an invalid data is found.
 
#define LV_USE_ASSERT_MALLOC   0
 Checks is the memory is successfully allocated or no.
 
#define LV_USE_ASSERT_STYLE   0
 Check if the styles are properly initialized.
 
#define LV_USE_ASSERT_MEM_INTEGRITY   0
 Check the integrity of lv_mem after critical operations.
 
#define LV_USE_ASSERT_OBJ   0
 Check the object's type and existence (e.g.
 
#define LV_ASSERT_HANDLER_INCLUDE   <stdint.h>
 Add a custom handler when assert happens e.g.
 
#define LV_ASSERT_HANDLER   while (1) {};
 Halt by default.
 
#define LV_USE_PERF_MONITOR   0
 1: Show CPU usage and FPS count in the right bottom corner
 
#define LV_USE_MEM_MONITOR   0
 1: Show the used memory and the memory fragmentation in the left bottom corner Requires LV_MEM_CUSTOM = 0
 
#define LV_USE_REFR_DEBUG   0
 1: Draw random colored rectangles over the redrawn areas
 
#define LV_SPRINTF_CUSTOM   0
 Change the built in (v)snprintf functions.
 
#define LV_SPRINTF_USE_FLOAT   0
 Don't use float with sprintf.
 
#define LV_USE_USER_DATA   1
 enable custom user data in LVGL data field
 
#define LV_ENABLE_GC   0
 Garbage Collector settings.
 
#define LV_BIG_ENDIAN_SYSTEM   0
 For big endian systems set to 1.
 
#define LV_ATTRIBUTE_TICK_INC
 Define a custom attribute to the lv_tick_inc() function.
 
#define LV_ATTRIBUTE_TIMER_HANDLER
 Define a custom attribute to the lv_timer_handler() function.
 
#define LV_ATTRIBUTE_FLUSH_READY
 Define a custom attribute to the lv_disp_flush_ready() function.
 
#define LV_ATTRIBUTE_MEM_ALIGN_SIZE   1
 Required alignment size for buffers.
 
#define LV_ATTRIBUTE_LARGE_CONST
 Attribute to mark large constant arrays for example font's bitmaps.
 
#define LV_ATTRIBUTE_LARGE_RAM_ARRAY
 Compiler prefix for a big array declaration in RAM.
 
#define LV_ATTRIBUTE_FAST_MEM
 Place performance critical functions into a faster memory (e.g RAM)
 
#define LV_ATTRIBUTE_DMA
 Prefix variables used in GPU accelerated operations.
 
#define LV_EXPORT_CONST_INT(int_value)
 Export integer constant to binding.
 
#define LV_USE_LARGE_COORD   0
 Extend the default -32k..32k coordinate range to -4M..4M by using int32_t for coordinates instead of int16_t.
 

Macro Definition Documentation

◆ LV_ASSERT_HANDLER

#define LV_ASSERT_HANDLER   while (1) {};

Halt by default.

Definition at line 292 of file lv_conf.h.

◆ LV_ASSERT_HANDLER_INCLUDE

#define LV_ASSERT_HANDLER_INCLUDE   <stdint.h>

Add a custom handler when assert happens e.g.

to restart the MCU

Definition at line 291 of file lv_conf.h.

◆ LV_ATTRIBUTE_DMA

#define LV_ATTRIBUTE_DMA

Prefix variables used in GPU accelerated operations.

These often these need to be placed in RAM sections that are DMA accessible.

Definition at line 362 of file lv_conf.h.

◆ LV_ATTRIBUTE_FAST_MEM

#define LV_ATTRIBUTE_FAST_MEM

Place performance critical functions into a faster memory (e.g RAM)

Definition at line 356 of file lv_conf.h.

◆ LV_ATTRIBUTE_FLUSH_READY

#define LV_ATTRIBUTE_FLUSH_READY

Define a custom attribute to the lv_disp_flush_ready() function.

Definition at line 344 of file lv_conf.h.

◆ LV_ATTRIBUTE_LARGE_CONST

#define LV_ATTRIBUTE_LARGE_CONST

Attribute to mark large constant arrays for example font's bitmaps.

Definition at line 350 of file lv_conf.h.

◆ LV_ATTRIBUTE_LARGE_RAM_ARRAY

#define LV_ATTRIBUTE_LARGE_RAM_ARRAY

Compiler prefix for a big array declaration in RAM.

Definition at line 353 of file lv_conf.h.

◆ LV_ATTRIBUTE_MEM_ALIGN_SIZE

#define LV_ATTRIBUTE_MEM_ALIGN_SIZE   1

Required alignment size for buffers.

Definition at line 347 of file lv_conf.h.

◆ LV_ATTRIBUTE_TICK_INC

#define LV_ATTRIBUTE_TICK_INC

Define a custom attribute to the lv_tick_inc() function.

Definition at line 338 of file lv_conf.h.

◆ LV_ATTRIBUTE_TIMER_HANDLER

#define LV_ATTRIBUTE_TIMER_HANDLER

Define a custom attribute to the lv_timer_handler() function.

Definition at line 341 of file lv_conf.h.

◆ LV_BIG_ENDIAN_SYSTEM

#define LV_BIG_ENDIAN_SYSTEM   0

For big endian systems set to 1.

Definition at line 335 of file lv_conf.h.

◆ LV_COLOR_16_SWAP [1/2]

#define LV_COLOR_16_SWAP   0

Swap the 2 bytes of RGB565 color.

Useful if the display has an 8 bit interface (e.g. SPI).

Definition at line 54 of file lv_conf.h.

◆ LV_COLOR_16_SWAP [2/2]

#define LV_COLOR_16_SWAP   0

Swap the 2 bytes of RGB565 color.

Useful if the display has an 8 bit interface (e.g. SPI).

Definition at line 54 of file lv_conf.h.

◆ LV_COLOR_CHROMA_KEY

#define LV_COLOR_CHROMA_KEY   lv_color_hex(0x00ff00)

Image pixels with this color will not be drawn if they are chroma keyed.

Default: pure green

Definition at line 75 of file lv_conf.h.

◆ LV_COLOR_DEPTH

#define LV_COLOR_DEPTH   16

Color depth.

  • 1: 1 bit per pixel
  • 8: RGB233
  • 16: RGB565
  • 32: ARGB8888

Definition at line 42 of file lv_conf.h.

◆ LV_COLOR_SCREEN_TRANSP

#define LV_COLOR_SCREEN_TRANSP   0

Enable more complex drawing routines to manage screen transparency.

Can be used if the UI is above another layer, e.g. an OSD menu or s video player. Requires LV_COLOR_DEPTH = 32 colors and the screen's bg_opa should be set to a non LV_OPA_COVER value.

Definition at line 69 of file lv_conf.h.

◆ LV_CONF_H

#define LV_CONF_H   1

LVGL configuration macros.

Author
Alexandre Abadie alexa.nosp@m.ndre.nosp@m..abad.nosp@m.ie@i.nosp@m.nria..nosp@m.fr LVGL package requires this definition to confirm that the configuration has been included.

Definition at line 25 of file lv_conf.h.

◆ LV_DISP_DEF_REFR_PERIOD

#define LV_DISP_DEF_REFR_PERIOD   30 /* [ms] */

Default display refresh period.

LVGL will redraw changed ares with this period time

Definition at line 133 of file lv_conf.h.

◆ LV_DISP_ROT_MAX_BUF

#define LV_DISP_ROT_MAX_BUF   (10*1024)

Maximum buffer size to allocate for rotation.

Only used if software rotation is enabled in the display driver.

Definition at line 198 of file lv_conf.h.

◆ LV_DPI_DEF

#define LV_DPI_DEF   130 /* [px/inch] */

Default Dot Per Inch.

Used to initialize default sizes such as widget size, style paddings. (Not very important, you can adjust it to modify default sizes and spaces.)

Definition at line 141 of file lv_conf.h.

◆ LV_DRAW_COMPLEX

#define LV_DRAW_COMPLEX   1

Enable complex draw engine.

Required to draw shadow, gradient, rounded corners, circles, arc, skew lines, image transformations or any masks.

Definition at line 156 of file lv_conf.h.

◆ LV_ENABLE_GC

#define LV_ENABLE_GC   0

Garbage Collector settings.

Used if LVGL is bound to a higher level language and the memory is managed by that language.

Definition at line 325 of file lv_conf.h.

◆ LV_EXPORT_CONST_INT

#define LV_EXPORT_CONST_INT ( int_value)
Value:
struct _silence_gcc_warning

Export integer constant to binding.

This macro is used with constants in the form of LV_<CONST> that should also appear on LVGL binding API such as Micropython. The default value just prevents the GCC warning.

Definition at line 370 of file lv_conf.h.

◆ LV_GRAD_CACHE_DEF_SIZE

#define LV_GRAD_CACHE_DEF_SIZE   0

Default gradient buffer size.

When LVGL calculates the gradient "maps" it can save them into a cache to avoid calculating them again. LV_GRAD_CACHE_DEF_SIZE sets the size of this cache in bytes. If the cache is too small the map will be allocated only while it's required for the drawing. Set to 0 to disable caching.

Definition at line 192 of file lv_conf.h.

◆ LV_GRADIENT_MAX_STOPS

#define LV_GRADIENT_MAX_STOPS   2

Number of stops allowed per gradient.

Increase this to allow more stops. This adds sizeof(lv_color_t) + 1 bytes per additional stop.

Definition at line 184 of file lv_conf.h.

◆ LV_IMG_CACHE_DEF_SIZE

#define LV_IMG_CACHE_DEF_SIZE   0

Default image cache size.

Image caching keeps the images opened. If only the built-in image formats are used there is no real advantage of caching (i.e. if no new image decoder is added). With complex image decoders (e.g. PNG or JPG) caching can save the continuous open/decode of images. However the opened images might consume additional RAM.

Set to 0 to disable caching.

Definition at line 177 of file lv_conf.h.

◆ LV_INDEV_DEF_READ_PERIOD

#define LV_INDEV_DEF_READ_PERIOD   30 /* [ms] */

Input device read period in milliseconds.

Definition at line 136 of file lv_conf.h.

◆ LV_MEM_ADR

#define LV_MEM_ADR   0 /* 0: unused */

Set an address for the memory pool instead of allocating it as a normal array.

Can be in external SRAM too.

Definition at line 109 of file lv_conf.h.

◆ LV_MEM_BUF_MAX_NUM

#define LV_MEM_BUF_MAX_NUM   16

Number of the intermediate memory buffers.

These are used during rendering and other internal processing mechanisms. You will see an error log message if there weren't enough buffers.

Definition at line 121 of file lv_conf.h.

◆ LV_MEM_CUSTOM

#define LV_MEM_CUSTOM   0

Memory allocation functions.

  • 1: use custom malloc/free
  • 0: use the built-in lv_mem_alloc() and lv_mem_free()

Definition at line 86 of file lv_conf.h.

◆ LV_MEM_SIZE

#define LV_MEM_SIZE   (5U * 1024U)

Size of the memory available for lv_mem_alloc() in bytes (>= 2kB)

Definition at line 101 of file lv_conf.h.

◆ LV_MEMCPY_MEMSET_STD

#define LV_MEMCPY_MEMSET_STD   1

Use the standard memcpy and memset instead of LVGL's own functions.

(Might or might not be faster).

Definition at line 126 of file lv_conf.h.

◆ LV_SPRINTF_CUSTOM

#define LV_SPRINTF_CUSTOM   0

Change the built in (v)snprintf functions.

Definition at line 310 of file lv_conf.h.

◆ LV_SPRINTF_USE_FLOAT

#define LV_SPRINTF_USE_FLOAT   0

Don't use float with sprintf.

Definition at line 316 of file lv_conf.h.

◆ LV_USE_ASSERT_MALLOC

#define LV_USE_ASSERT_MALLOC   0

Checks is the memory is successfully allocated or no.

(Very fast, recommended)

Definition at line 279 of file lv_conf.h.

◆ LV_USE_ASSERT_MEM_INTEGRITY

#define LV_USE_ASSERT_MEM_INTEGRITY   0

Check the integrity of lv_mem after critical operations.

(Slow)

Definition at line 285 of file lv_conf.h.

◆ LV_USE_ASSERT_NULL

#define LV_USE_ASSERT_NULL   0

Enable asserts if an operation is failed or an invalid data is found.

If LV_USE_LOG is enabled an error message will be printed on failure. Check if the parameter is NULL. (Very fast, recommended)

Definition at line 276 of file lv_conf.h.

◆ LV_USE_ASSERT_OBJ

#define LV_USE_ASSERT_OBJ   0

Check the object's type and existence (e.g.

not deleted). (Slow)

Definition at line 288 of file lv_conf.h.

◆ LV_USE_ASSERT_STYLE

#define LV_USE_ASSERT_STYLE   0

Check if the styles are properly initialized.

(Very fast, recommended)

Definition at line 282 of file lv_conf.h.

◆ LV_USE_GPU_NXP_PXP

#define LV_USE_GPU_NXP_PXP   0

Use NXP's PXP GPU iMX RTxxx platforms.

Definition at line 213 of file lv_conf.h.

◆ LV_USE_GPU_NXP_VG_LITE

#define LV_USE_GPU_NXP_VG_LITE   0

Use NXP's VG-Lite GPU iMX RTxxx platforms.

Definition at line 227 of file lv_conf.h.

◆ LV_USE_GPU_STM32_DMA2D

#define LV_USE_GPU_STM32_DMA2D   0

Use STM32's DMA2D (aka Chrom Art) GPU.

Definition at line 204 of file lv_conf.h.

◆ LV_USE_LARGE_COORD

#define LV_USE_LARGE_COORD   0

Extend the default -32k..32k coordinate range to -4M..4M by using int32_t for coordinates instead of int16_t.

Definition at line 375 of file lv_conf.h.

◆ LV_USE_LOG

#define LV_USE_LOG   0

Enable the log module.

Definition at line 234 of file lv_conf.h.

◆ LV_USE_MEM_MONITOR

#define LV_USE_MEM_MONITOR   0

1: Show the used memory and the memory fragmentation in the left bottom corner Requires LV_MEM_CUSTOM = 0

Definition at line 304 of file lv_conf.h.

◆ LV_USE_PERF_MONITOR

#define LV_USE_PERF_MONITOR   0

1: Show CPU usage and FPS count in the right bottom corner

Definition at line 299 of file lv_conf.h.

◆ LV_USE_REFR_DEBUG

#define LV_USE_REFR_DEBUG   0

1: Draw random colored rectangles over the redrawn areas

Definition at line 307 of file lv_conf.h.

◆ LV_USE_USER_DATA

#define LV_USE_USER_DATA   1

enable custom user data in LVGL data field

Definition at line 319 of file lv_conf.h.