Skip to content

Commit

Permalink
shields: display: Added generic shield for ST7789V
Browse files Browse the repository at this point in the history
Added a generic display shield for boards based on the ST7789V
display controller.

Signed-off-by: Jan Van Winkel <[email protected]>
  • Loading branch information
vanwinkeljan authored and nashif committed Jan 2, 2020
1 parent cad30e8 commit 7a633a5
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 0 deletions.
56 changes: 56 additions & 0 deletions boards/shields/st7789v_generic/doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
.. _st7789v_generic:

Generic ST7789V Display Shield
##############################

Overview
********

This is a generic shield for display shields based on ST7789V display
controller. More information about the controller can be found in
`ST7789V Datasheet`_.

Pins Assignment of the Generic ST7789V Display Shield
=====================================================

+-----------------------+--------------------------------------------+
| Arduino Connector Pin | Function |
+=======================+===============+============================+
| D8 | ST7789V Reset | |
+-----------------------+---------------+----------------------------+
| D9 | ST7789V DC | (Data/Command) |
+-----------------------+---------------+----------------------------+
| D10 | SPI SS | (Serial Slave Select) |
+-----------------------+---------------+----------------------------+
| D11 | SPI MOSI | (Serial Data Input) |
+-----------------------+---------------+----------------------------+
| D12 | SPI MISO | (Serial Data Out) |
+-----------------------+---------------+----------------------------+
| D13 | SPI SCK | (Serial Clock Input) |
+-----------------------+---------------+----------------------------+

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

This shield can only be used with a board that provides a configuration
for Arduino connectors and defines node aliases for SPI and GPIO interfaces
(see :ref:`shields` for more details).

Programming
***********

Set ``-DSHIELD=st7789v_generic`` when you invoke ``west build``. For example:

.. zephyr-app-commands::
:zephyr-app: samples/gui/lvgl
:board: nrf52840_pca10056
:shield: st7789v_generic
:goals: build

References
**********

.. target-notes::

.. _ST7789V Datasheet:
https://www.newhavendisplay.com/appnotes/datasheets/LCDs/ST7789V.pdf
10 changes: 10 additions & 0 deletions boards/shields/st7789v_generic/st7789v_generic.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
CONFIG_SPI=y
CONFIG_DISPLAY=y
CONFIG_ST7789V=y

CONFIG_ST7789V_RGB888=y
CONFIG_LVGL_BITS_PER_PIXEL=24
CONFIG_LVGL_HOR_RES=320
CONFIG_LVGL_VER_RES=170

CONFIG_LVGL_DISPLAY_DEV_NAME="ST7789V"
22 changes: 22 additions & 0 deletions boards/shields/st7789v_generic/st7789v_generic.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright (c) 2019 Jan Van Winkel <[email protected]>
*
* SPDX-License-Identifier: Apache-2.0
*/

&arduino_spi {
status = "okay";
cs-gpios = <&arduino_header 16 0>; /* D10 */

st7789v@0 {
compatible = "sitronix,st7789v";
label = "ST7789V";
spi-max-frequency = <20000000>;
reg = <0>;
cmd-data-gpios = <&arduino_header 15 0>; /* D9 */
reset-gpios = <&arduino_header 14 0>; /* D8 */
width = <320>;
height = <170>;
y-offset = <35>;
};
};

0 comments on commit 7a633a5

Please sign in to comment.