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 :zephyr:board:`nrf52840dk` 42- :ref:`buydisplay_2_8_tft_touch_arduino` and :zephyr:board:`nrf52840dk` 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- :zephyr:board:`adafruit_feather_esp32s3_tft` 50 51or a simulated display environment in a :ref:`native_sim <native_sim>` application: 52 53- :ref:`native_sim` 54- `SDL2`_ 55 56or 57 58- :zephyr:board:`mimxrt1050_evk` 59- `RK043FN02H-CT`_ 60 61or 62 63- :zephyr:board:`mimxrt1060_evk` 64- `RK043FN02H-CT`_ 65 66Building and Running 67******************** 68 69Example building for :zephyr:board:`nrf52840dk`: 70 71.. zephyr-app-commands:: 72 :zephyr-app: samples/subsys/display/lvgl 73 :board: nrf52840dk/nrf52840 74 :shield: adafruit_2_8_tft_touch_v2 75 :goals: build flash 76 77Example building for :ref:`native_sim <native_sim>`: 78 79.. zephyr-app-commands:: 80 :zephyr-app: samples/subsys/display/lvgl 81 :board: native_sim 82 :goals: build run 83 84Alternatively, if building from a 64-bit host machine, the previous target 85board argument may also be replaced by ``native_sim/native/64``. 86 87References 88********** 89 90.. target-notes:: 91 92.. _LVGL Web Page: https://lvgl.io/ 93.. _SDL2: https://www.libsdl.org 94.. _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 95