zephyr/samples/subsys/display/lvgl
Leon Rinkel b5cd22ea16 boards: adafruit: add initial support esp32s3 feather tft
The Adafruit Feather ESP32S3 is a development board in the Feather
standard layout, sharing peripheral placement with other devices labeled
as Feathers or FeatherWings. The board is equipped with an ESP32-S3 mini
module, a lithium ion battery charger and a USB-C connector. Compared to
the base model, this TFT variant additionally comes with a 240x135 pixel
IPS TFT color display.

Signed-off-by: Leon Rinkel <leon@rinkel.me>
2025-03-14 17:53:13 +01:00
..
boards boards: adafruit: add initial support esp32s3 feather tft 2025-03-14 17:53:13 +01:00
src samples: subsys: display: lvgl: Migrate to v9.2 2025-01-04 14:17:10 +01:00
CMakeLists.txt
Kconfig samples: subsys: display: lvgl: add option to control sw0 2024-12-18 18:15:15 +01:00
prj.conf samples: display: lvgl: increase main stack size to 4k 2025-02-12 23:16:13 +01:00
README.rst boards: adafruit: add initial support esp32s3 feather tft 2025-03-14 17:53:13 +01:00
sample.yaml samples: display: lvgl: test sample with 'seeed_xiao_round_display' 2025-02-12 23:16:13 +01:00

.. zephyr:code-sample:: lvgl
   :name: LVGL basic sample
   :relevant-api: display_interface input_interface

   Display a "Hello World" and react to user input using LVGL.

Overview
********

This sample application displays "Hello World" in the center of the screen
and a counter at the bottom which increments every second.
Based on the available input devices on the board used to run the sample,
additional widgets may be displayed and additional interactions enabled:

* Pointer
      If your board has a touch panel controller
      (:dtcompatible:`zephyr,lvgl-pointer-input`), a button widget is displayed
      in the center of the screen. Otherwise a label widget is displayed.
* Button
      The button pseudo device (:dtcompatible:`zephyr,lvgl-button-input`) maps
      a press/release action to a specific coordinate on screen. In the case
      of this sample, the coordinates are mapped to the center of the screen.
* Encoder
      The encoder pseudo device (:dtcompatible:`zephyr,lvgl-encoder-input`)
      can be used to navigate between widgets and edit their values. If the
      board contains an encoder, an arc widget is displayed, which can be
      edited.
* Keypad
      The keypad pseudo device (:dtcompatible:`zephyr,lvgl-keypad-input`) can
      be used for focus shifting and also entering characters inside editable
      widgets such as text areas. If the board used with this sample has a
      keypad device, a button matrix is displayed at the bottom of the screen
      to showcase the focus shifting capabilities.

Requirements
************

Display shield and a board which provides a configuration
for corresponding connectors, for example:

- :ref:`adafruit_2_8_tft_touch_v2` and :ref:`nrf52840dk_nrf52840`
- :ref:`buydisplay_2_8_tft_touch_arduino` and :ref:`nrf52840dk_nrf52840`
- :ref:`ssd1306_128_shield` and :zephyr:board:`frdm_k64f`
- :ref:`seeed_xiao_round_display` and :zephyr:board:`xiao_ble`

or a board with an integrated display:

- :zephyr:board:`esp_wrover_kit`
- :zephyr:board:`adafruit_feather_esp32s3_tft`

or a simulated display environment in a :ref:`native_sim <native_sim>` application:

- :ref:`native_sim`
- `SDL2`_

or

- :zephyr:board:`mimxrt1050_evk`
- `RK043FN02H-CT`_

or

- :zephyr:board:`mimxrt1060_evk`
- `RK043FN02H-CT`_

Building and Running
********************

Example building for :ref:`nrf52840dk_nrf52840`:

.. zephyr-app-commands::
   :zephyr-app: samples/subsys/display/lvgl
   :board: nrf52840dk/nrf52840
   :shield: adafruit_2_8_tft_touch_v2
   :goals: build flash

Example building for :ref:`native_sim <native_sim>`:

.. zephyr-app-commands::
   :zephyr-app: samples/subsys/display/lvgl
   :board: native_sim
   :goals: build run

Alternatively, if building from a 64-bit host machine, the previous target
board argument may also be replaced by ``native_sim/native/64``.

References
**********

.. target-notes::

.. _LVGL Web Page: https://lvgl.io/
.. _SDL2: https://www.libsdl.org
.. _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