samples/subsys/display/lvgl/README.html · samples/subsys/display/lvgl/README.rst 공식 원문 ↗

Zephyr 3.7.0 · Samples · Display · LVGL

LVGL basic sample

Hello World 화면에서 board input에 따라 widget과 interaction을 확장합니다.

Official pathsamples/subsys/display/lvgl/README.html
Source filesamples/subsys/display/lvgl/README.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

본문 기준: Zephyr 3.7.0 LTS3 · 이후 유지보수 패치는 별도입니다.

Part 1

요약·해설

네 input device 경로, display 요구 조합, nRF52840·native_sim build를 설명합니다.

GUI

LVGL

Inputs

Pointer · Button · Encoder · Keypad

Simulation

native_sim + SDL2

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 FDFFF9072A3BB40B15082B1034C162CCB32F4D6E3C2CF4D8B398349BAFA63DD9
.. 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 :ref:`frdm_k64f`
- :ref:`seeed_xiao_round_display` and :ref:`xiao_ble`

or a board with an integrated display:

- :ref:`esp_wrover_kit`

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

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

or

- :ref:`mimxrt1050_evk`
- `RK043FN02H-CT`_

or

- :ref:`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

Part 3

한국어 전문 번역

개요

이 sample application은 화면 중앙에 Hello World를 표시하고, 아래쪽에는 1초마다 증가하는 counter를 둡니다. 실행 board에 연결된 input device에 따라 widget과 interaction이 추가됩니다.

  • Pointer: board에 touch panel controller zephyr,lvgl-pointer-input가 있으면 중앙에 button widget을 표시하고, 없으면 label widget을 표시합니다.
  • Button: pseudo device zephyr,lvgl-button-input는 press/release 동작을 특정 화면 coordinate에 대응시킵니다. 이 sample에서는 화면 중앙 coordinate를 사용합니다.
  • Encoder: pseudo device zephyr,lvgl-encoder-input로 widget 사이를 이동하고 값을 편집합니다. Encoder가 있는 board에서는 편집할 수 있는 arc widget이 나타납니다.
  • Keypad: pseudo device zephyr,lvgl-keypad-input는 focus를 옮기고 text area 같은 편집 가능한 widget에 문자를 입력합니다. Keypad가 있으면 focus 이동을 보여 주는 button matrix를 화면 아래에 표시합니다.

요구 사항

Display shield와 그 connector 설정을 제공하는 board 조합이 필요합니다. 공식 예시는 adafruit_2_8_tft_touch_v2 또는 buydisplay_2_8_tft_touch_arduino와 nrf52840dk_nrf52840, ssd1306_128_shield와 frdm_k64f, seeed_xiao_round_display와 xiao_ble입니다.

통합 display가 있는 esp_wrover_kit도 사용할 수 있습니다. 실제 hardware 대신 native_sim application과 SDL2로 display를 simulate할 수도 있습니다.

NXP 조합으로는 mimxrt1050_evk 또는 mimxrt1060_evk에 RK043FN02H-CT 4.3-inch LCD panel을 연결할 수 있습니다.

빌드 및 실행

다음은 nRF52840 DK에 Adafruit 2.8-inch TFT touch shield를 지정해 build하고 flash하는 예입니다.

# From the root of the zephyr repository
west build -b nrf52840dk/nrf52840 --shield adafruit_2_8_tft_touch_v2 samples/subsys/display/lvgl
west flash

다음은 SDL2 기반 native_sim target을 build한 뒤 host에서 실행하는 예입니다.

# From the root of the zephyr repository
west build -b native_sim samples/subsys/display/lvgl
west build -t run

64-bit host machine에서 build한다면 앞의 board argument native_sim을 native_sim/native/64로 바꿀 수도 있습니다.

참고 자료

GUI library 자체의 widget·input model은 LVGL Web Page를, host simulation 의존성은 SDL2 문서를 참조하십시오. i.MX RT evaluation kit의 panel 정보는 NXP RK043FN02H-CT product page에서 확인할 수 있습니다.

Source

출처

영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.