samples: display: Use ST7789V generic shield
Use the ST7789V generic shield in ST7789V display sample Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
This commit is contained in:
parent
7a633a5737
commit
3e63d6a088
5 changed files with 24 additions and 56 deletions
|
@ -18,25 +18,26 @@ controller orientation.
|
|||
|
||||
Building and Running
|
||||
********************
|
||||
The sample has a board overlay for a nrf52832 based board with the following
|
||||
pin assignments:
|
||||
|
||||
+-------------+-------------+
|
||||
| | nRF52832 | | LCD module|
|
||||
| | Pin | | signal |
|
||||
+=============+=============+
|
||||
| P0.03 | SPI_SCK |
|
||||
+-------------+-------------+
|
||||
| P0.05 | SPI_MOSI |
|
||||
+-------------+-------------+
|
||||
| P0.26 | SPI_MISO |
|
||||
+-------------+-------------+
|
||||
| P0.27 | CS |
|
||||
+-------------+-------------+
|
||||
| P0.25 | DATA/CMD |
|
||||
+-------------+-------------+
|
||||
| P0.02 | RESET |
|
||||
+-------------+-------------+
|
||||
The sample uses the :ref:`st7789v_generic` and the pin assignments on a
|
||||
:ref:`nrf52_pca10040` are as follows:
|
||||
|
||||
+-------------------+-------------+
|
||||
| | NRF52 PCA10040 | | LCD module|
|
||||
| | Pin | | signal |
|
||||
+===================+=============+
|
||||
| P1.15 (D13) | SPI_SCK |
|
||||
+-------------------+-------------+
|
||||
| P1.14 (D12) | SPI_MISO |
|
||||
+-------------------+-------------+
|
||||
| P1.13 (D11) | SPI_MOSI |
|
||||
+-------------------+-------------+
|
||||
| P1.12 (D10) | CS |
|
||||
+-------------------+-------------+
|
||||
| P1.11 (D9) | DATA/CMD |
|
||||
+-------------------+-------------+
|
||||
| P1.10 (D8) | RESET |
|
||||
+-------------------+-------------+
|
||||
|
||||
You might need to alter these according to your specific board/LCD configuration.
|
||||
|
||||
|
@ -45,6 +46,7 @@ For :ref:`nrf52_pca10040`, build this sample application with the following comm
|
|||
.. zephyr-app-commands::
|
||||
:zephyr-app: samples/display/st7789v
|
||||
:board: nrf52_pca10040
|
||||
:shield: st7789v_generic
|
||||
:goals: build
|
||||
:compact:
|
||||
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2019 Creative Product Design
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
&spi0 {
|
||||
status = "okay";
|
||||
sck-pin = <3>;
|
||||
mosi-pin = <5>;
|
||||
miso-pin = <26>;
|
||||
cs-gpios = <&gpio0 27 0>;
|
||||
|
||||
st7789v@0 {
|
||||
compatible = "sitronix,st7789v";
|
||||
label = "DISPLAY";
|
||||
spi-max-frequency = <20000000>;
|
||||
reg = <0>;
|
||||
cmd-data-gpios = <&gpio0 25 0>;
|
||||
reset-gpios = <&gpio0 2 0>;
|
||||
width = <320>;
|
||||
height = <170>;
|
||||
y-offset = <35>;
|
||||
};
|
||||
};
|
|
@ -1,15 +1,4 @@
|
|||
CONFIG_PRINTK=y
|
||||
|
||||
CONFIG_HEAP_MEM_POOL_SIZE=16384
|
||||
|
||||
CONFIG_GPIO=y
|
||||
CONFIG_SPI=y
|
||||
|
||||
CONFIG_DISPLAY=y
|
||||
CONFIG_ST7789V=y
|
||||
CONFIG_ST7789V_LCD_TL019FQV01=y
|
||||
CONFIG_ST7789V_RGB565=y
|
||||
|
||||
CONFIG_DISPLAY_LOG_LEVEL_DBG=y
|
||||
|
||||
CONFIG_LOG=y
|
||||
CONFIG_DISPLAY_LOG_LEVEL_DBG=y
|
||||
|
|
|
@ -5,4 +5,5 @@ tests:
|
|||
sample.display.st7789v:
|
||||
build_only: true
|
||||
platform_whitelist: nrf52_pca10040
|
||||
tags: display
|
||||
extra_args: SHIELD=st7789v_generic
|
||||
tags: display shield
|
||||
|
|
|
@ -121,6 +121,7 @@ void main(void)
|
|||
*(buf + idx + 1) = (color_rgb >> 0) & 0xFFU;
|
||||
}
|
||||
#else
|
||||
int color = cnt % 4;
|
||||
u32_t color_rgb;
|
||||
u32_t c = grey_count & 0xff;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue