77 Commits

Author SHA1 Message Date
Fabian Blatz
3658dbd489 manifest: Update LVGL to 9.4.X
Update the west yaml to point to the new LVGL version.
Update CMakeLists and samples accordingly.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2026-01-20 20:05:25 -05:00
Alain Volmat
b13d9a0510 display: rename current BGR_565 format into RGB_565X
The format currently expected by devices and sample display
application for BGR_565 is actually RGB_565 format with bytes
swapped (not B / R swapped). That is:

PIXEL_FORMAT_RGB_565:
         * @code{.unparsed}
         *   7......0 15.....8
         * | gggBbbbb RrrrrGgg | ...
         * @endcode

current PIXEL_FORMAT_BGR_565:
         * @code{.unparsed}
         *   7......0 15.....8
         * | RrrrrGgg gggBbbbb | ...
         * @endcode

This is explained in both st7796s display driver but also is
what is generated by the sample display application. As a video
format (ex: V4L2), such format is not mentioned as BGR (for
which R and B are swapped) but RGB_565X.

Within the whole Zephyr tree, rename the curremt BGR_565 format
into RGB_565X in order to emphasis that this is a byte swapped
format rather than a B/G component swapped format.

This also correct the description of the format in display.h
file, which wasn't correct based on what was being used by
display driver or sample display app.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2026-01-19 16:04:04 +00:00
Matthias Alleman
78b5ecff1e lvgl: input: lvgl_pointer_input: fix NULL pointer dereferencing
Fixes the dereferencing of a NULL pointer when interrupts of an
input device happen early in the application.

Signed-off-by: Matthias Alleman <matthias.alleman@basalte.be>
2025-12-03 10:39:23 -05:00
Fabian Blatz
25d96b2589 modules: lvgl: Prevent false pointer input events
Fixes an issue where input events which have the sync flag set but are
neither X/Y coordiante updates nor press/release updates triggers a false
reporting of input to LVGL.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2025-12-02 18:41:42 -05:00
Fabian Blatz
36c673f5f9 modules: lvgl: Add LV_Z_POINTER_FROM_CHOSEN_TOUCH option
Adds a Kconfig option LV_Z_POINTER_FROM_CHOSEN_TOUCH which automatically
creates a lvgl input pointer device from the chosen zephyr,touch node.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2025-12-02 11:31:07 +01:00
Fabian Blatz
0ec9fc42a4 modules: lvgl: Fix thread deletion in OSAL
Do not delete the thread from within the thread callback function,
secure thread_delete against trying to delete a terminated thread.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2025-11-23 05:31:29 -05:00
Fabian Blatz
871103d072 manifest: Update LVGL to v9.4
Update the west yaml to point to the new LVGL version.
Update CMakeLists and samples accordingly.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2025-11-23 05:31:29 -05:00
Jiafei Pan
8ea7b114a6 modules: lvgl: fix build warning for print format
Fix the following building warning:
modules/lvgl/lvgl_shell.c:62:41: warning: format '%u' expects argument
of type 'unsigned int', but argument 3 has type 'size_t' {aka 'long
unsigned int'} [-Wformat=]

Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
2025-10-24 20:19:17 -04:00
Yehuda Eisenberg
b4cd1a258f modules: lvgl: include lv_arclabel.c in Zephyr build
Add the lv_arclabel.c source file to modules/lvgl/CMakeLists.txt
so that the Arclabel widget is compiled and available in Zephyr projects.

Previously, the arclabel widget was not included, making it unusable.

Signed-off-by: Yehuda Eisenberg <yehuda@yehudae.net>
2025-10-14 18:55:36 +02:00
Alain Volmat
c2fe44ee98 modules: lvgl: allow usage of zephyr memory-region for mem / vdb
Allow selection of a custom section for memory-poll and / or VDB
based on zephyr memory-regions.
This takes advantages that zephyr,memory-region automatically have
sections being created, hence allowing to easily indicate into which
memory-region to store data.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
2025-09-30 15:27:56 +03:00
Quentin LACOMBE
a974785131 lvgl: Fix monochrome display color inversion
Fix issue that cause color inversion with monochrome display by replace
PIXEL_FORMAT_MONO10 by PIXEL_FORMAT01 to have the expected behavior.

Signed-off-by: Quentin LACOMBE <quentlace2g@gmail.com>
2025-09-25 14:18:37 -04:00
Martin Stumpf
7472a7994c lvgl: Add support for AL_88 color
While both LVGL and Zephyr support AL_88 color, the glue to connect them
was still missing. Now AL_88 should be fully supported by Zephyr+LVGL.

Signed-off-by: Martin Stumpf <finomnis@gmail.com>
2025-08-14 22:38:38 -04:00
Pieter De Gendt
b5883d3a37 modules: lvgl: Provide API mutex (un)locking
Add helper functions that can be used to lock/unlock the LVGL's internal
mutex before calling API funcions.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-08-11 12:49:36 +03:00
Pieter De Gendt
af529f4c40 modules: lvgl: include: Generate doxygen for LVGL workqueue getter
When building API documentation, generate the lvgl_get_workqueue brief.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-08-11 12:49:36 +03:00
Fabian Blatz
076994f492 modules: lvgl: Fix stdlib usage
LVGL already provides an implementation wrapping a C standard library into
its own lv_* functions. Add them to the CMakeLists and set the appropriate
defines for them.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2025-08-06 17:12:00 +03:00
Pieter De Gendt
96eee3bc5e modules: lvgl: Add a name to the work queue thread
Make it easier to debug/diagnose issues by explicitly naming the LVGL
thread.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-07-29 11:27:38 +01:00
Pieter De Gendt
65e21f066f modules: lvgl: Optional BGR888 to RGB888
Some display controllers allow to work with BGR888 directly, a significant
reduction in CPU load is gained this way.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
2025-07-25 17:04:07 +01:00
Felipe Neves
744ee2082e modules: lvgl: expose the lvgl workqueue to the user application
allowing user to submit their own work intems to it.

Signed-off-by: Felipe Neves <ryukokki.felipe@gmail.com>
2025-07-21 21:26:27 -04:00
Felipe Neves
e82b8d277b modules: lvgl: add automatic lv_timer_handler call
inside of its own thread when user enable it on
the LVGL Zephyr options menu, using this option makes
the calling of the lv_timer_handler driven by an internal
timer and thread. Options like priority and stack size
for this thread are exposed making it configurable by the
application.

Signed-off-by: Felipe Neves <ryukokki.felipe@gmail.com>

modules: lvgl: put LVGL core into a dedicated workqueue

Replacing the initial approach based on timers and semaphore

Signed-off-by: Felipe Neves <ryukokki.felipe@gmail.com>
2025-07-21 21:26:27 -04:00
Fabian Blatz
47c4e3d813 modules: lvgl: Use Zephyr builtins instead of LVGL stdlib/string impls
Previously LVGL added its own version of several stdlib functions. Replace
them with the Zephyr provided functions instead.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2025-07-19 13:51:44 -04:00
Kate Wang
52e08918ff modules: lvgl: support the frame buffer address and stride alignment
Add support for the frame buffer address and stride alignment.
If user set the CONFIG_LV_DRAW_BUF_ALIGN to not be 4, the buffers
shall be allocated aoocrdingly.
If user set the CONFIG_LV_DRAW_BUF_STRIDE_ALIGN to not be 1, the
methods of flushing the display shall set the pitch accordingly.

Signed-off-by: Kate Wang <yumeng.wang@nxp.com>
2025-06-27 08:49:44 -10:00
Benjamin Cabé
4f6077f369 modules: lvgl: don't try to open file in read mode with create flag set
Current code would have systematically tried to add the FS_O_CREATE flag
when opening a file in read mode. This effectively made it impossible to
open files to read them on read-only file systems.

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-06-20 13:22:15 -04:00
Benjamin Cabé
5aacf59f6a lvgl: adopt SHELL_HELP
Adopt SHELL_HELP macro for lvgl_shell

Signed-off-by: Benjamin Cabé <benjamin@zephyrproject.org>
2025-06-13 10:11:56 -07:00
Matthias Alleman
0ce57ab68e modules: lvgl: fix of too few arguments of cpu_load_get
Fixes building an lvgl sample with CONFIG_CPU_LOAD enabled.
cpu_load_get function requires 1 argument.

Signed-off-by: Matthias Alleman <matthias.alleman@basalte.be>
2025-06-12 09:39:27 -07:00
Fabian Blatz
768e43ae98 modules: lvgl: Add lv_os_get_idle_percent to OSAL
Adds an implementation of lv_os_get_idle_percent to the zephyr OSAL.
This is needed for usage of the system monitor.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2025-06-11 08:20:09 +02:00
Fabian Blatz
0b0fd7d674 modules: lvgl: Update CMakeLists to v9.3
Add new/moved files introduced in v9.3 into the CMakeLists.
Also for using the system monitor the osal is required to have a method to
measure the CPU idle time so the lvgl_zephyr_osal file needs to be always
added.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2025-06-11 08:20:09 +02:00
Fabian Blatz
5cffb8e5a6 modules: lvgl: Register print callback after lv_init
Move initialization of the print callback handler after calling lv_init, as
the latter zeroes the global callback structure.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2025-05-30 16:37:57 +02:00
Abderrahmane JARMOUNI
abdb1ef3bc modules: lvgl: input: fix indev binding to display
When no 'display' property is present in LVGL input dev node in DT,
we should default to LVGL Default Display to preserve the old behavior
and not break LV Input on setups with only one display.

Signed-off-by: Abderrahmane JARMOUNI <git@jarmouni.me>
2025-05-13 22:21:50 -04:00
Abderrahmane JARMOUNI
4a75a930b9 modules: lvgl: add multi-display input support
Add support for binding LV input devs to multiple displays

Signed-off-by: Abderrahmane JARMOUNI <git@jarmouni.me>
2025-05-08 12:24:21 +02:00
Abderrahmane JARMOUNI
0be94452a9 modules: lvgl: add multi-display support in Zephyr
Add multi-display support in Zephyr ontop of LVGL which already supports
it.

This change allows for creating buffers and structures for each display
statically and automatically from deviceTree info, and call LV init
routines for each display

Signed-off-by: Abderrahmane JARMOUNI <git@jarmouni.me>
2025-05-08 12:24:21 +02:00
Robin-Charles Guihéneuf
b0715dd3f2 lvgl: Add config to disable monochrome pixel software inversion
In some cases, pixel inversion is managed by the display hardware
and software inversion is not required.

Signed-off-by: Robin-Charles Guihéneuf <robin-charles@hotmail.fr>
2025-04-28 12:55:51 -05:00
Camille BAUD
60914ac654 modules: lvgl: Introduce Greyscale support
This introduces support glue for L8 greyscale

Signed-off-by: Camille BAUD <mail@massdriver.space>
2025-03-12 14:05:14 +00:00
Fabian Blatz
ff2cf4be16 modules: lvgl: Update OSAL implementation
The LVGL OSAL also tries to set the name of threads. Adjust the function
signature accordingly. Also deal with the fact that the type
`lv_thread_prio_t` is not part of the private api and requires a
LV_USE_PRIVATE_API symbol to be enabled.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2025-02-07 02:22:52 +01:00
Johan Lafon
6043af638d modules: lvgl: fix buffer overflow when using monochrome displays
In lvgl_transform_buffer() the pixel map buffer start address is
modified to skip the library color palette header but the memcpy size
argument was not modified accordingly thus causing writes beyond buffer
reserved space.

Signed-off-by: Johan Lafon <johan.lafon@syslinbit.com>
2025-01-16 22:56:28 +01:00
Haiyue Wang
f9bff7f32f modules: lvgl: Rename the VDB custom section Kconfig name
There are 4 Kconfig names about the "Draw Buffer". Rename 'VBD' to 'VDB'
in Kconfig option 'LV_Z_*VBD*_CUSTOM_SECTION' to make name consistent.

config LV_Z_VDB_ALIGN
	int "Rending buffer alignment"

config LV_Z_VBD_CUSTOM_SECTION
	bool "Link rendering buffers to custom section"

config LV_Z_DOUBLE_VDB
	bool "Use two rendering buffers"

config LV_Z_VDB_SIZE
	int "Rendering buffer size"
	default 100 if LV_Z_FULL_REFRESH

And the draw buffer definition is now:

	static uint8_t buf0[BUFFER_SIZE]
	#ifdef CONFIG_LV_Z_VDB_CUSTOM_SECTION
		Z_GENERIC_SECTION(.lvgl_buf)
	#endif
			__aligned(CONFIG_LV_Z_VDB_ALIGN);

Signed-off-by: Haiyue Wang <haiyuewa@163.com>
2025-01-06 17:13:29 +00:00
Fabian Blatz
d2cebade85 modules: lvgl: Add support for NXP PXP engine
Adds support for the NXP PXP engine. LVGL changed
the Kconfig symbol from LV_USE_GPU_NXP_PXP to
LV_USE_PXP, but hal_nxp still relies on
LV_USE_GPU_NXP_PXP, so add a temporary symbol for it.
Additionally the drawing engines need to invalidate
ranges in the dcache, the method needs to be provided
via a lvgl_support.h file.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2025-01-04 14:17:10 +01:00
Fabian Blatz
9a4ae67f7b modules: lvgl: Add zephyr OSAL implementation
This patch adds the OSAL implementation of dynamic thread creation, mutex
and thread syncronization primitive (semaphore) enabling the use of the
parallel rendering architecture provided with LVGL 9.0. To use it, set
`CONFIG_LV_Z_USE_OSAL` and your preferred dynamic thread stack allocation
method (pool or heap).

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2025-01-04 14:17:10 +01:00
Fabian Blatz
23431193ef modules: lvgl: Update gluecode to v9.2
This patch updates the module gluecode to be compatible with LVGL version
9.2. This includes changes done to display and input driver initialization
  and draw buffer handling.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2025-01-04 14:17:10 +01:00
Fabian Blatz
feb4683293 samples: modules: lvgl: Update CMakeLists
Update the CMakeLists for LVGL to reflect the changes done in v9.2.0.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2025-01-04 14:17:10 +01:00
Daniel DeGrasse
c071e27e2d boards: fix dependency for LV_COLOR_SWAP_16 to use configdefault
Use configdefault when enabling LV_COLOR_SWAP_16 within boards and
shield definitions, to avoid OR'ing the dependencies for the Kconfig
symbol. Otherwise, a user manually selecting LV_COLOR_DEPTH will
encounter build errors as LV_COLOR_SWAP_16 may be enabled when
LV_COLOR_DEPTH_16 is not selected

Fixes #81546

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-11-21 09:19:19 +01:00
Martin Stumpf
50509c34cc lvgl: Flush thread can have preemptive priority
The LVGL flush thread was hard-coded to be cooperative.
For long-running actions like data transfer to the display,
this is problematic as it might block high-frequency actions like
USB or input events.

Hence, make it configurable to be preemptive, and rename it to match the
similar Kconfig values like CONFIG_SDL_THREAD_PRIORITY.

Signed-off-by: Martin Stumpf <finomnis@gmail.com>
2024-11-20 15:57:21 -05:00
Martin Stumpf
05bb8d9504 lvgl: add frame_incomplete information to display_write
In frames with multiple writes (officially supported through
`CONFIG_LV_Z_VDB_SIZE`) the display needs to be signalled that the
current frame is over and the content should be displayed.
This allows displays to present the UI without tearing artifacts.

Signed-off-by: Martin Stumpf <finomnis@gmail.com>
2024-11-16 13:35:17 -05:00
Gero Schwäricke
5bcb5242ed modules: lvgl: fix multiple LVGL inputs
The LVGL input callback does not use an instance specific name, so we
can only ever have one instance of this type. This issue was evident by
a build error, e.g., when using "zephyr,lvgl-keypad-input" nodes twice:

  error: redefinition of '_input_callback__lvgl_keypad_process_event'

Signed-off-by: Gero Schwäricke <gero.schwaericke@posteo.de>
2024-09-30 12:10:29 +01:00
Daniel DeGrasse
c8161dc53d modules: lvgl: provide alignment definition
For some systems, the display peripheral or GPU requires that buffers be
aligned on a boundary for optimal performance. We already align display
buffers using CONFIG_LV_ATTRIBUTE_MEM_ALIGN_SIZE, but some applications
will rely on the definition of LV_ATTRIBUTE_MEM_ALIGN. Provide this
definition so those buffers will be aligned as well.

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-09-10 21:52:35 -04:00
Fabio Baltieri
716fa268f4 input: add a user_data pointer to the callback
Add a void *user_data pointer to the input callback structure. This is
useful for driver to get back the driver data structure and avoid
defining wrapper functions.

Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com>
2024-07-31 12:55:11 +02:00
Stephan Linz
e823cc5fb4 modules: lvgl: fix initialization macro syntax
Adding a semicolon after the do-while loop in the LV_DEV_INIT()
macro also supports multiple instantiation.

Signed-off-by: Stephan Linz <linz@li-pro.net>
2024-07-08 15:53:46 +02:00
Fabian Blatz
b7b1a56124 modules: lvgl: support linking memory pool to custom section
This patch adds a kconfig option `LV_Z_MEMORY_POOL_CUSTOM_SECTION`
which allows to place the buffer the memory pool is backed by into a
section with the label ".lvgl_heap".

Resolves issue: #66494.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2024-06-22 05:39:41 -04:00
Fabian Blatz
5a62c1137c modules: lvgl: Remove LVGL pointer kscan
Removes the wrapper code of the kscan based pointer input device. It was
implemented during the transitioning phase until all intree drivers were
converted to the input subsystem.

Signed-off-by: Fabian Blatz <fabianblatz@gmail.com>
2024-06-21 11:54:11 -04:00
Yong Cong Sin
19e4cb8f89 libc: cleanup deprecated heap-related Kconfigs
The following heap-related Kconfigs shared by the picolibc &
minimal libc have been deprecated for more than 2 releases,
remove them and update the Kconfigs accordingly:

- `CONFIG_MINIMAL_LIBC_MALLOC_ARENA_SIZE`
- `CONFIG_MINIMAL_LIBC_REALLOCARRAY`

Cleanup the handling to support the deprecated malloc arena
size configuration values.

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
2024-06-18 14:33:58 -04:00
Lorenz Clijnen
d7e5451799 modules: lvgl: input: Fix invalid encoder readout
When the encoder button was pressed, it would send a LV_KEY_LEFT/RIGHT
instead of a LV_KEY_ENTER event.
This clears the enc_diff field, and set the key field to LV_KEY_ENTER
for button events.

Fixes #73529

Signed-off-by: Lorenz Clijnen <lorenz_reclame@outlook.be>
2024-06-06 15:46:20 +01:00