Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@
/samples/boards/intel_s1000_crb/ @sathishkuttan @dcpleung @nashif
/samples/display/ @vanwinkeljan
/samples/drivers/CAN/ @alexanderwachter
/samples/drivers/display/ @vanwinkeljan
/samples/drivers/ht16k33/ @henrikbrixandersen
/samples/drivers/lora/ @Mani-Sadhasivam
/samples/gui/ @vanwinkeljan
Expand Down
7 changes: 7 additions & 0 deletions samples/drivers/display/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.13.1)
include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)
project(display)

target_sources(app PRIVATE src/main.c)
47 changes: 47 additions & 0 deletions samples/drivers/display/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
.. _display-sample:

Display Sample
##############

Overview
********

This sample will draw some basic rectangles onto the display.
The rectangle colors and positions are chosen so that you can check the
orientation of the LCD and correct RGB bit order. The rectangles are drawn
in clockwise order, from top left corner: red, green, blue, grey. The shade of
grey changes from black through to white. 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.

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 :ref:`nrf52840_pca10056` board with a
:ref:`adafruit_2_8_tft_touch_v2`.

.. zephyr-app-commands::
:zephyr-app: samples/drivers/display_shield
:board: nrf52840_pca10056
:goals: build
:shield: adafruit_2_8_tft_touch_v2
:compact:

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

.. zephyr-app-commands::
:zephyr-app: samples/drivers/display_shield
:board: native_posix
:goals: build
:compact:

List of Arduino-based display shields
*************************************

- :ref:`adafruit_2_8_tft_touch_v2`
- :ref:`ssd1306_128_shield`
- :ref:`st7789v_generic`
- :ref:`waveshare_e_paper_raw_panel_shield`
34 changes: 34 additions & 0 deletions samples/drivers/display/dts_fixup.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/*
* Copyright (c) 2019 Jan Van Winkel <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

#ifdef DT_INST_0_ILITEK_ILI9340_LABEL
#define DISPLAY_DEV_NAME DT_INST_0_ILITEK_ILI9340_LABEL
#endif

#ifdef DT_INST_0_SOLOMON_SSD1306FB_LABEL
#define DISPLAY_DEV_NAME DT_INST_0_SOLOMON_SSD1306FB_LABEL
#endif

#ifdef DT_INST_0_GOODDISPLAY_GDEH0213B1_LABEL
#define DISPLAY_DEV_NAME DT_INST_0_GOODDISPLAY_GDEH0213B1_LABEL
#endif

#ifdef DT_INST_0_SITRONIX_ST7789V_LABEL
#define DISPLAY_DEV_NAME DT_INST_0_SITRONIX_ST7789V_LABEL
#endif

#ifdef DT_INST_0_FSL_IMX6SX_LCDIF_LABEL
#define DISPLAY_DEV_NAME DT_INST_0_FSL_IMX6SX_LCDIF_LABEL
#endif

#ifdef CONFIG_SDL_DISPLAY_DEV_NAME
#define DISPLAY_DEV_NAME CONFIG_SDL_DISPLAY_DEV_NAME
#endif

#ifdef CONFIG_DUMMY_DISPLAY_DEV_NAME
#define DISPLAY_DEV_NAME CONFIG_DUMMY_DISPLAY_DEV_NAME
#endif

3 changes: 3 additions & 0 deletions samples/drivers/display/prj.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CONFIG_HEAP_MEM_POOL_SIZE=16384
CONFIG_LOG=y
CONFIG_DISPLAY=y
41 changes: 41 additions & 0 deletions samples/drivers/display/sample.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
sample:
description: Sample application for displays
name: display_sample
tests:
sample.display.shield.adafruit_2_8_tft_touch_v2:
platform_whitelist: nrf52840_pca10056
extra_args: SHIELD=adafruit_2_8_tft_touch_v2
tags: display shield
sample.display.shield.ssd1306_128x32:
platform_whitelist: nrf52840_pca10056
extra_args: SHIELD=ssd1306_128x32
tags: display shield
sample.display.shield.ssd1306_128x64:
platform_whitelist: nrf52840_pca10056
extra_args: SHIELD=ssd1306_128x64
tags: display shield
sample.display.shield.waveshare_epaper_gdeh0213b1:
platform_whitelist: nrf52840_pca10056
extra_args: SHIELD=waveshare_epaper_gdeh0213b1
sample.display.st7789v_tl019fqv01:
platform_whitelist: nrf52_pca10040
extra_args: SHIELD=st7789v_tl019fqv01
tags: display shield
sample.display.st7789v_waveshare_240x240:
platform_whitelist: nrf52_pca10040
extra_args: SHIELD=st7789v_waveshare_240x240
tags: display shield
sample.display.mcux_elcdif:
platform_whitelist: mimxrt1050_evk
tags: display
sample.display.sdl:
build_only: true
platform_whitelist: native_posix_64
tags: display
sample.display.dummy:
platform_whitelist: native_posix
extra_configs:
- CONFIG_DUMMY_DISPLAY=y
- CONFIG_SDL_DISPLAY=n
- CONFIG_TEST=y
tags: display
Loading