README.rst
1.. zephyr:code-sample:: lvgl-demos
2 :name: LVGL demos
3 :relevant-api: display_interface
4
5 Run LVGL built-in demos.
6
7Overview
8********
9
10A sample showcasing upstream LVGL demos.
11
12Music
13 The music player demo shows what kind of modern, smartphone-like user interfaces can be created on LVGL.
14Benchmark
15 The benchmark demo tests the performance in various cases. For example rectangle, border, shadow, text, image blending, image transformation, blending modes, etc.
16Stress
17 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.
18Widgets
19 Shows how the widgets look like out of the box using the built-in material theme.
20Keypad and Encoder
21 Shows how to control widget with a keypad and hardware encoder.
22Render
23 Collection of multiple rendering tests.
24
25More details can be found in `LVGL demos Readme`_.
26
27Requirements
28************
29
30* A board with display, ideally with 480x272 resolution or higher.
31* A pointer input device: touchpad, mouse, or touch screen capable display, compatible with :dtcompatible:`zephyr,lvgl-pointer-input`.
32
33Note that other input devices types are not demonstrated in these demos, namely keyboards, keypads (:dtcompatible:`zephyr,lvgl-keypad-input`), rotary encoders (:dtcompatible:`zephyr,lvgl-encoder-input`) and hardware buttons (:dtcompatible:`zephyr,lvgl-button-input`).
34
35Building and Running
36********************
37
38Example building for :zephyr:board:`mimxrt1060_evk`:
39
40.. zephyr-app-commands::
41 :zephyr-app: samples/modules/lvgl/demos
42 :board: mimxrt1060_evk
43 :goals: build flash
44
45These demos can be built for simulated display environment as follows:
46
47.. zephyr-app-commands::
48 :zephyr-app: samples/modules/lvgl/demos
49 :host-os: unix
50 :board: native_sim
51 :gen-args: -DCONFIG_LV_Z_DEMO_MUSIC=y
52 :goals: run
53 :compact:
54
55.. zephyr-app-commands::
56 :zephyr-app: samples/modules/lvgl/demos
57 :host-os: unix
58 :board: native_sim
59 :gen-args: -DCONFIG_LV_Z_DEMO_BENCHMARK=y
60 :goals: run
61 :compact:
62
63.. zephyr-app-commands::
64 :zephyr-app: samples/modules/lvgl/demos
65 :host-os: unix
66 :board: native_sim
67 :gen-args: -DCONFIG_LV_Z_DEMO_STRESS=y
68 :goals: run
69 :compact:
70
71.. zephyr-app-commands::
72 :zephyr-app: samples/modules/lvgl/demos
73 :host-os: unix
74 :board: native_sim
75 :gen-args: -DCONFIG_LV_Z_DEMO_WIDGETS=y
76 :goals: run
77 :compact:
78
79.. zephyr-app-commands::
80 :zephyr-app: samples/modules/lvgl/demos
81 :host-os: unix
82 :board: native_sim
83 :gen-args: -DCONFIG_LV_Z_DEMO_KEYPAD_AND_ENCODER=y
84 :goals: run
85 :compact:
86
87.. zephyr-app-commands::
88 :zephyr-app: samples/modules/lvgl/demos
89 :host-os: unix
90 :board: native_sim
91 :gen-args: -DCONFIG_LV_Z_DEMO_RENDER=y
92 :goals: run
93 :compact:
94
95Alternatively, if building from a 64-bit host machine, the previous target
96board argument may also be replaced by ``native_sim/native/64``.
97
98References
99**********
100
101.. target-notes::
102
103.. _LVGL demos Readme: https://github.com/zephyrproject-rtos/lvgl/blob/zephyr/demos/README.md
104