LVGL demos
Overview
A sample showcasing upstream LVGL demos.
- Music
The music player demo shows what kind of modern, smartphone-like user interfaces can be created on LVGL.
- Benchmark
The benchmark demo tests the performance in various cases. For example rectangle, border, shadow, text, image blending, image transformation, blending modes, etc.
- Stress
A stress test for LVGL. It contains a lot of object creation, deletion, animations, styles usage, and so on. It can be used if there is any memory corruption during heavy usage or any memory leaks.
- Widgets
Shows how the widgets look like out of the box using the built-in material theme.
- Keypad and Encoder
Shows how to control widget with a keypad and hardware encoder.
- Render
Collection of multiple rendering tests.
More details can be found in LVGL demos Readme [1].
Requirements
A board with display, ideally with 480x272 resolution or higher.
A pointer input device: touchpad, mouse, or touch screen capable display, compatible with
zephyr,lvgl-pointer-input.
Note that other input devices types are not demonstrated in these demos, namely keyboards, keypads (zephyr,lvgl-keypad-input) and hardware buttons (zephyr,lvgl-button-input).
Keypad and Encoder demo on native_sim
On Native simulator - native_sim the Keypad and Encoder demo is driven by a rotary
encoder (zephyr,lvgl-encoder-input) emulated with the SDL mouse:
the mouse wheel rotates the encoder and the middle button (wheel-click) acts as
ENTER. No extra hardware is required.
Since this demo is meant to be navigated with the encoder, the LVGL pointer that
is otherwise derived from the zephyr,touch chosen device is disabled for it,
so that pointer clicks do not short-circuit the encoder navigation. The other
demos keep their pointer.
Building and Running
These demos can be built for simulated display environment as follows. Replace native_sim with
your board name to build for a real board.
west build -b native_sim samples/modules/lvgl/demos -- -DCONFIG_LV_Z_DEMO_MUSIC=y
west build -t run
west build -b native_sim samples/modules/lvgl/demos -- -DCONFIG_LV_Z_DEMO_BENCHMARK=y
west build -t run
west build -b native_sim samples/modules/lvgl/demos -- -DCONFIG_LV_Z_DEMO_STRESS=y
west build -t run
west build -b native_sim samples/modules/lvgl/demos -- -DCONFIG_LV_Z_DEMO_WIDGETS=y
west build -t run
west build -b native_sim samples/modules/lvgl/demos -- -DCONFIG_LV_Z_DEMO_KEYPAD_AND_ENCODER=y
west build -t run
west build -b native_sim samples/modules/lvgl/demos -- -DCONFIG_LV_Z_DEMO_RENDER=y
west build -t run
Alternatively, if building from a 64-bit host machine, the previous target
board argument may also be replaced by native_sim/native/64.