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
70 changes: 70 additions & 0 deletions boards/shields/st7789v_generic/doc/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
.. _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) |
+-----------------------+---------------+----------------------------+

Current supported displays
==========================

+----------------------+------------------------------+
| Display | Shield Designation |
| | |
+======================+==============================+
| TL019FQV01 | st7789v_tl019fqv01 |
| | |
+----------------------+------------------------------+
| Waveshare 240x240 | st7789v_waveshare_240x240 |
| 1.3inch IPS LCD | |
+----------------------+------------------------------+

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_tl019fqv01`` when you invoke ``west build``. For example:

.. zephyr-app-commands::
:zephyr-app: samples/gui/lvgl
:board: nrf52840_pca10056
:shield: st7789v_tl019fqv01
: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_tl019fqv01.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"
38 changes: 38 additions & 0 deletions boards/shields/st7789v_generic/st7789v_tl019fqv01.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* 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>;
x-offset = <0>;
y-offset = <35>;
vcom = <0x2b>;
gctrl = <0x35>;
vrhs = <0x0f>;
vdvs = <0x20>;
mdac = <0x20>;
gamma = <0x01>;
colmod = <0x66>;
lcm = <0x2c>;
porch-param = [0c 0c 00 33 33];
cmd2en-param = [5a 69 02 01];
pwctrl1-param = [52 a1];
pvgam-param = [D0 00 02 07 0B 1A 31 54 40 29 12 12 12 17];
nvgam-param = [D0 00 02 07 05 15 2D 44 44 1C 18 16 1C 1D];
ram-param = [00 F0];
rgb-param = [CD 08 14];
};
};
10 changes: 10 additions & 0 deletions boards/shields/st7789v_generic/st7789v_waveshare_240x240.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_RGB565=y
CONFIG_LVGL_BITS_PER_PIXEL=16
CONFIG_LVGL_HOR_RES=240
CONFIG_LVGL_VER_RES=240

CONFIG_LVGL_DISPLAY_DEV_NAME="ST7789V"
39 changes: 39 additions & 0 deletions boards/shields/st7789v_generic/st7789v_waveshare_240x240.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
* Copyright (c) 2019 Jan Van Winkel <[email protected]>
* Copyright (c) 2019 PHYTEC Messtechnik GmbH
*
* 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 = <240>;
height = <240>;
x-offset = <0>;
y-offset = <0>;
vcom = <0x19>;
gctrl = <0x35>;
vrhs = <0x12>;
vdvs = <0x20>;
mdac = <0x00>;
gamma = <0x01>;
colmod = <0x05>;
lcm = <0x2c>;
porch-param = [0c 0c 00 33 33];
cmd2en-param = [5a 69 02 01];
pwctrl1-param = [a4 a1];
pvgam-param = [D0 04 0D 11 13 2B 3F 54 4C 18 0D 0B 1F 23];
nvgam-param = [D0 04 0C 11 13 2C 3F 44 51 2F 1F 1F 20 23];
ram-param = [00 F0];
rgb-param = [CD 08 14];
};
};
4 changes: 0 additions & 4 deletions drivers/display/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,3 @@ zephyr_sources_ifdef(CONFIG_ILI9340_LCD_ADAFRUIT_1480
zephyr_sources_ifdef(CONFIG_ILI9340_LCD_SEEED_TFTV2
display_ili9340_seeed_tftv2.c
)

zephyr_sources_ifdef(CONFIG_ST7789V_LCD_TL019FQV01
display_st7789v_tl019fqv01.c
)
37 changes: 0 additions & 37 deletions drivers/display/Kconfig.st7789v
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,6 @@ menuconfig ST7789V

if ST7789V

choice
prompt "LCD"
help
Specify the type of LCD connected to the ST7789V display controller.

config ST7789V_LCD_TL019FQV01
bool "TDO TL019FQV01"

endchoice

choice
prompt "Color pixel format"
default ST7789V_RGB565
Expand All @@ -35,31 +25,4 @@ config ST7789V_RGB565

endchoice

if ST7789V_RGB565
config ST7789V_SWAP_PIXEL_LCD_ENDIANNESS
bool "Swap pixel endianness at LCD"
help
Pixel data bytes are swapped when being blitted to the LCD.
Note that this isn't just a swap of RGB <--> BGR, (if the endianness is
swapped then the 3 lowest bits of G are sent first/last).
You may want to enable this if you are using lvgl and your colors
don't look right.

config ST7789V_REVERSE_LCD_RGB_ORDER
bool "Reverse draw order of controller ram to LCD"
help
This reverses the order that the controller draws RGB to the LCD.

config ST7789V_REVERSE_X
bool "Reverse X axis"
help
Address pixels from right to left.

config ST7789V_REVERSE_Y
bool "Reverse Y axis"
help
Address pixels from bottom to top.

endif # ST7789V_RGB565

endif # ST7789V
Loading