• Home
  • Annotate
  • current directory
Name Date Size #Lines LOC

..22-Aug-2025-

boards/22-Aug-2025-

src/22-Aug-2025-

CMakeLists.txt A D22-Aug-2025196 85

README.rst A D22-Aug-20252.1 KiB6045

dummy_dc.overlay A D22-Aug-2025261 1815

prj.conf A D22-Aug-202565 43

sample.yaml A D22-Aug-20254.4 KiB117116

README.rst

1.. zephyr:code-sample:: display
2   :name: Display
3   :relevant-api: display_interface
4
5   Draw basic rectangles on a display device.
6
7Overview
8********
9
10This sample will draw some basic rectangles onto the display.
11The rectangle colors and positions are chosen so that you can check the
12orientation of the LCD and correct RGB bit order. The rectangles are drawn
13in clockwise order, from top left corner: red, green, blue, grey. The shade of
14grey changes from black through to white. If the grey looks too green or red
15at any point or the order of the corners is not as described above then the LCD
16may be endian swapped.
17
18On displays with the :c:enumerator:`SCREEN_INFO_X_ALIGNMENT_WIDTH` capability,
19such as those using the :dtcompatible:`sharp,ls0xx` driver, it is only possible
20to draw full lines at a time. On these displays, the rectangles described above
21will be replaced with bars that take up the entire width of the display. Only
22the green and grey bar will be visible.
23
24On monochrome displays, the rectangles (or bars) will all be some shade of grey.
25
26On displays with 1 bit per pixel, the greyscale animation of the bottom
27rectangle (or bar) will appear as flickering between black and white.
28
29Building and Running
30********************
31
32As this is a generic sample it should work with any display supported by Zephyr.
33
34Below is an example on how to build for a :zephyr:board:`nrf52840dk` board with a
35:ref:`adafruit_2_8_tft_touch_v2`.
36
37.. zephyr-app-commands::
38   :zephyr-app: samples/drivers/display
39   :board: nrf52840dk/nrf52840
40   :goals: build
41   :shield: adafruit_2_8_tft_touch_v2
42   :compact:
43
44For testing purpose without the need of any hardware, the :ref:`native_sim <native_sim>`
45board is also supported and can be built as follows;
46
47.. zephyr-app-commands::
48   :zephyr-app: samples/drivers/display
49   :board: native_sim
50   :goals: build
51   :compact:
52
53List of Arduino-based display shields
54*************************************
55
56- :ref:`adafruit_2_8_tft_touch_v2`
57- :ref:`ssd1306_128_shield`
58- :ref:`st7789v_generic`
59- :ref:`waveshare_epaper`
60