Display

Browse source code on GitHub

Overview

This sample uses the display API to draw some basic shapes onto the display.

For most display controllers, the shapes will be rectangles whose colors and positions are chosen so that the orientation of the LCD and correct RGB bit order can be checked. The rectangles are drawn in clockwise order, from top left corner: red, green, blue, grey. The shade of grey changes from black to white.

Tip

If the grey looks too green or red at any point or the order of the corners is not as described above then the LCD may be endian swapped!

Typical RGB output at 320x240: red, green, and blue corners (clockwise from top left); bottom left animates from black to white. Corner sizes scale with resolution on real hardware.

Building and Running

As this is a generic sample it should work with any display supported by Zephyr.

Below is an example on how to build for a nRF52840 DK board with a Adafruit 2.8” TFT Touch Shield v2.

west build -b nrf52840dk/nrf52840 --shield adafruit_2_8_tft_touch_v2 samples/drivers/display

For testing purpose without the need of any hardware, the native_sim board is also supported and can be built as follows;

west build -b native_sim samples/drivers/display

List of Arduino-based display shields

See also

Display