Skip to content

Commit

Permalink
shields: rpi_pico_lcd: add Spotpear Pico LCD 1.54
Browse files Browse the repository at this point in the history
The new part of the Raspberry Pi Pico LCD shield by PiMoroni is:

  * Raspberry Pi Pico 1.54inch LCD Rev 2.0 (blue), here in Bridle known as
    SpotpearPico LCD 1.54 (spotpear_pico_lcd_1_54)

supported features:

  * display API (zephyr/samples/drivers/display)
  * LVGL stack (zephyr/samples/subsys/display/lvgl)
  * input API (zephyr/samples/subsys/input/input_dump)

supported platforms:

  * Raspberry Pi Pico (rpi_pico)
  * Raspberry Pi Pico W (rpi_pico_w)
  * Waveshare RP2040 Plus 4MB (waveshare_rp2040_plus)
  * Waveshare RP2040 Plus 16MB (waveshare_rp2040_plus@16mb)

Signed-off-by: Stephan Linz <[email protected]>
  • Loading branch information
rexut committed Jul 2, 2024
1 parent 391bc0f commit 64f3438
Show file tree
Hide file tree
Showing 38 changed files with 1,213 additions and 0 deletions.
5 changes: 5 additions & 0 deletions boards/shields/rpi_pico_lcd/Kconfig.defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ config SHIELD_RPI_PICO_LCD
bool
default y if SHIELD_PIMORONI_PICO_LCD_1_44
default y if SHIELD_PIMORONI_PICO_LCD_2
default y if SHIELD_SPOTPEAR_PICO_LCD_1_54
default y if SHIELD_WAVESHARE_PICO_LCD_0_96
default y if SHIELD_WAVESHARE_PICO_LCD_1_14
default y if SHIELD_WAVESHARE_PICO_LCD_1_3
Expand All @@ -18,6 +19,7 @@ config SHIELD_RPI_PICO_LCD
choice ST7789V_PIXEL_FORMAT
default ST7789V_RGB565 if SHIELD_PIMORONI_PICO_LCD_1_44
default ST7789V_RGB565 if SHIELD_PIMORONI_PICO_LCD_2
default ST7789V_RGB565 if SHIELD_SPOTPEAR_PICO_LCD_1_54
default ST7789V_RGB565 if SHIELD_WAVESHARE_PICO_LCD_1_14
default ST7789V_RGB565 if SHIELD_WAVESHARE_PICO_LCD_1_3
default ST7789V_RGB565 if SHIELD_WAVESHARE_PICO_LCD_2
Expand All @@ -32,6 +34,7 @@ config LV_Z_VDB_SIZE
config LV_Z_BITS_PER_PIXEL
default 16 if SHIELD_PIMORONI_PICO_LCD_1_44
default 16 if SHIELD_PIMORONI_PICO_LCD_2
default 16 if SHIELD_SPOTPEAR_PICO_LCD_1_54
default 16 if SHIELD_WAVESHARE_PICO_LCD_0_96
default 16 if SHIELD_WAVESHARE_PICO_LCD_1_14
default 16 if SHIELD_WAVESHARE_PICO_LCD_1_3
Expand All @@ -45,6 +48,7 @@ config LV_Z_BITS_PER_PIXEL
choice LV_COLOR_DEPTH
default LV_COLOR_DEPTH_16 if SHIELD_PIMORONI_PICO_LCD_1_44
default LV_COLOR_DEPTH_16 if SHIELD_PIMORONI_PICO_LCD_2
default LV_COLOR_DEPTH_16 if SHIELD_SPOTPEAR_PICO_LCD_1_54
default LV_COLOR_DEPTH_16 if SHIELD_WAVESHARE_PICO_LCD_0_96
default LV_COLOR_DEPTH_16 if SHIELD_WAVESHARE_PICO_LCD_1_14
default LV_COLOR_DEPTH_16 if SHIELD_WAVESHARE_PICO_LCD_1_3
Expand All @@ -59,6 +63,7 @@ endchoice
config LV_COLOR_16_SWAP
default y if SHIELD_PIMORONI_PICO_LCD_1_44
default y if SHIELD_PIMORONI_PICO_LCD_2
default y if SHIELD_SPOTPEAR_PICO_LCD_1_54
default y if SHIELD_WAVESHARE_PICO_LCD_0_96
default y if SHIELD_WAVESHARE_PICO_LCD_1_14
default y if SHIELD_WAVESHARE_PICO_LCD_1_3
Expand Down
3 changes: 3 additions & 0 deletions boards/shields/rpi_pico_lcd/Kconfig.shield
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ config SHIELD_PIMORONI_PICO_LCD_1_44
config SHIELD_PIMORONI_PICO_LCD_2
def_bool $(shields_list_contains,pimoroni_pico_lcd_2)

config SHIELD_SPOTPEAR_PICO_LCD_1_54
def_bool $(shields_list_contains,spotpear_pico_lcd_1_54)

config SHIELD_WAVESHARE_PICO_LCD_0_96
def_bool $(shields_list_contains,waveshare_pico_lcd_0_96)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/*
* Copyright (c) 2024 TiaC Systems
* SPDX-License-Identifier: Apache-2.0
*/

#include "rpipico_r3.dtsi"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/*
* Copyright (c) 2024 TiaC Systems
* SPDX-License-Identifier: Apache-2.0
*/

#include "rpipico_r3.dtsi"
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
* Copyright (c) 2024 TiaC Systems
* SPDX-License-Identifier: Apache-2.0
*/

#include <freq.h>

&pico_spi1 {
pinctrl-0 = <&spi1_lcd>;
pinctrl-names = "default";
clock-frequency = <DT_FREQ_M(20)>;
};

rpipico_spi_lcd: &pico_spi1 {};
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/*
* Copyright (c) 2024 TiaC Systems
* SPDX-License-Identifier: Apache-2.0
*/

#include "rpipico_r3-connect.dtsi"

#include "st7789v_240x240ls.dtsi"
#include "st7789v_rgb565.dtsi"

#include <zephyr/dt-bindings/gpio/gpio.h>

&rpipico_spi_lcd {
status = "okay";
cs-gpios = <&rpipico_header 9 GPIO_ACTIVE_LOW>; /* GP9 */
};

&mipi_dbi {
status = "okay";
reset-gpios = <&rpipico_header 12 GPIO_ACTIVE_LOW>; /* GP12 */
dc-gpios = <&rpipico_header 8 GPIO_ACTIVE_HIGH>; /* GP8 */
spi-dev = <&rpipico_spi_lcd>;
#address-cells = <1>;
#size-cells = <0>;
};

&lcd_panel {
status = "okay";
};

&lcd_backlight_en {
status = "okay";
enable-gpios = <&rpipico_header 7 GPIO_ACTIVE_HIGH>; /* GP7 */
};

&button_0 { /* GP2 */
gpios = <&rpipico_header 2 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
};

&button_1 { /* GP3 */
gpios = <&rpipico_header 3 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
};

&button_2 { /* GP4 */
gpios = <&rpipico_header 4 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
};

&button_3 { /* GP6 */
gpios = <&rpipico_header 6 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
};

&button_4 { /* GP13 */
gpios = <&rpipico_header 13 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
};

&button_5 { /* GP14 */
gpios = <&rpipico_header 14 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
};

&button_6 { /* GP16 */
gpios = <&rpipico_header 16 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
};

&button_7 { /* GP17 */
gpios = <&rpipico_header 17 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
};

&button_8 { /* GP26 */
gpios = <&rpipico_header 23 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
};

&button_9 { /* GP27 */
gpios = <&rpipico_header 24 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
};

&button_10 { /* GP18 */
gpios = <&rpipico_header 18 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
};

&button_11 { /* GP1 */
gpios = <&rpipico_header 1 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Copyright (c) 2024 TiaC Systems
* SPDX-License-Identifier: Apache-2.0
*/

#include <freq.h>
#include <zephyr/dt-bindings/mipi_dbi/mipi_dbi.h>

&mipi_dbi {
st7789v_240x240ls: st7789v@0 {
compatible = "sitronix,st7789v";
mipi-max-frequency = <DT_FREQ_M(20)>;
mipi-mode = <MIPI_DBI_MODE_SPI_4WIRE>;
reg = <0>;

status = "disabled";

width = <240>; /* landscape */
height = <240>; /* landscape */
x-offset = <0>; /* landscape */
y-offset = <0>; /* landscape */

vcom = <0x19>;
gctrl = <0x35>;
vrhs = <0x12>;
vdvs = <0x20>;
mdac = <0x60>; /* landscape */
gamma = <0x01>;
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];
};
};

lcd_panel: &st7789v_240x240ls {};
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Copyright (c) 2024 TiaC Systems
* SPDX-License-Identifier: Apache-2.0
*/

&st7789v_240x240ls {
mdac = <0xE0>; /* landscape, mirrored */
x-offset = <80>;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Copyright (c) 2024 TiaC Systems
* SPDX-License-Identifier: Apache-2.0
*/

&st7789v_240x240ls {
mdac = <0xA0>; /* landscape, overhead */
x-offset = <80>;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* Copyright (c) 2024 TiaC Systems
* SPDX-License-Identifier: Apache-2.0
*/

&st7789v_240x240ls {
mdac = <0x20>; /* landscape, upsidedown */
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Copyright (c) 2024 TiaC Systems
* SPDX-License-Identifier: Apache-2.0
*/

#include <freq.h>
#include <zephyr/dt-bindings/mipi_dbi/mipi_dbi.h>

&mipi_dbi {
st7789v_240x240pt: st7789v@0 {
compatible = "sitronix,st7789v";
mipi-max-frequency = <DT_FREQ_M(20)>;
mipi-mode = <MIPI_DBI_MODE_SPI_4WIRE>;
reg = <0>;

status = "disabled";

width = <240>; /* portrait */
height = <240>; /* portrait */
x-offset = <0>; /* portrait */
y-offset = <0>; /* portrait */

vcom = <0x19>;
gctrl = <0x35>;
vrhs = <0x12>;
vdvs = <0x20>;
mdac = <0x00>; /* portrait */
gamma = <0x01>;
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];
};
};

lcd_panel: &st7789v_240x240pt {};
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* Copyright (c) 2024 TiaC Systems
* SPDX-License-Identifier: Apache-2.0
*/

&st7789v_240x240pt {
mdac = <0x40>; /* portrait, mirrored */
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Copyright (c) 2024 TiaC Systems
* SPDX-License-Identifier: Apache-2.0
*/

&st7789v_240x240pt {
mdac = <0xC0>; /* portrait, overhead */
y-offset = <80>;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Copyright (c) 2024 TiaC Systems
* SPDX-License-Identifier: Apache-2.0
*/

&st7789v_240x240pt {
mdac = <0x80>; /* portrait, upsidedown */
y-offset = <80>;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* Copyright (c) 2024 TiaC Systems
* SPDX-License-Identifier: Apache-2.0
*/

&lcd_panel {
inversion-off;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* Copyright (c) 2024 TiaC Systems
* SPDX-License-Identifier: Apache-2.0
*/

&lcd_panel {
colmod = <0x05>; /* 16-bit, RGB565 */
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* Copyright (c) 2024 TiaC Systems
* SPDX-License-Identifier: Apache-2.0
*/

&lcd_panel {
colmod = <0x06>; /* 18-bit, RGB666 */
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
* Copyright (c) 2024 TiaC Systems
* SPDX-License-Identifier: Apache-2.0
*/

&lcd_panel {
colmod = <0x07>; /* 24-bit, RGB888 */
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/*
* Copyright (c) 2024 TiaC Systems
* SPDX-License-Identifier: Apache-2.0
*/

#include "rpipico_r3.dtsi"
Loading

0 comments on commit 64f3438

Please sign in to comment.