README.rst
1.. zephyr:code-sample:: lvgl
2 :name: LVGL basic sample
3 :relevant-api: display_interface input_interface
4
5 Display a "Hello World" and react to user input using LVGL.
6
7Overview
8********
9
10This sample application displays "Hello World" in the center of the screen
11and a counter at the bottom which increments every second.
12Based on the available input devices on the board used to run the sample,
13additional widgets may be displayed and additional interactions enabled:
14
15* Pointer
16 If your board has a touch panel controller
17 (:dtcompatible:`zephyr,lvgl-pointer-input`), a button widget is displayed
18 in the center of the screen. Otherwise a label widget is displayed.
19* Button
20 The button pseudo device (:dtcompatible:`zephyr,lvgl-button-input`) maps
21 a press/release action to a specific coordinate on screen. In the case
22 of this sample, the coordinates are mapped to the center of the screen.
23* Encoder
24 The encoder pseudo device (:dtcompatible:`zephyr,lvgl-encoder-input`)
25 can be used to navigate between widgets and edit their values. If the
26 board contains an encoder, an arc widget is displayed, which can be
27 edited.
28* Keypad
29 The keypad pseudo device (:dtcompatible:`zephyr,lvgl-keypad-input`) can
30 be used for focus shifting and also entering characters inside editable
31 widgets such as text areas. If the board used with this sample has a
32 keypad device, a button matrix is displayed at the bottom of the screen
33 to showcase the focus shifting capabilities.
34
35Requirements
36************
37
38Display shield and a board which provides a configuration
39for corresponding connectors, for example:
40
41- :ref:`adafruit_2_8_tft_touch_v2` and :ref:`nrf52840dk_nrf52840`
42- :ref:`buydisplay_2_8_tft_touch_arduino` and :ref:`nrf52840dk_nrf52840`
43- :ref:`ssd1306_128_shield` and :zephyr:board:`frdm_k64f`
44- :ref:`seeed_xiao_round_display` and :zephyr:board:`xiao_ble`
45
46or a board with an integrated display:
47
48- :zephyr:board:`esp_wrover_kit`
49
50or a simulated display environment in a :ref:`native_sim <native_sim>` application:
51
52- :ref:`native_sim`
53- `SDL2`_
54
55or
56
57- :zephyr:board:`mimxrt1050_evk`
58- `RK043FN02H-CT`_
59
60or
61
62- :zephyr:board:`mimxrt1060_evk`
63- `RK043FN02H-CT`_
64
65Building and Running
66********************
67
68Example building for :ref:`nrf52840dk_nrf52840`:
69
70.. zephyr-app-commands::
71 :zephyr-app: samples/subsys/display/lvgl
72 :board: nrf52840dk/nrf52840
73 :shield: adafruit_2_8_tft_touch_v2
74 :goals: build flash
75
76Example building for :ref:`native_sim <native_sim>`:
77
78.. zephyr-app-commands::
79 :zephyr-app: samples/subsys/display/lvgl
80 :board: native_sim
81 :goals: build run
82
83Alternatively, if building from a 64-bit host machine, the previous target
84board argument may also be replaced by ``native_sim/native/64``.
85
86References
87**********
88
89.. target-notes::
90
91.. _LVGL Web Page: https://lvgl.io/
92.. _SDL2: https://www.libsdl.org
93.. _RK043FN02H-CT: https://www.nxp.com/products/processors-and-microcontrollers/arm-based-processors-and-mcus/i.mx-applications-processors/i.mx-rt-series/4.3-lcd-panel:RK043FN02H-CT
94