Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more Raspberry Pi Pico LCD Shields #238

Merged
merged 14 commits into from
Jul 13, 2024
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
24 changes: 23 additions & 1 deletion boards/shields/rpi_pico_lcd/Kconfig.defconfig
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
# Copyright (c) 2023 TiaC Systems
# Copyright (c) 2023-2024 TiaC Systems
# SPDX-License-Identifier: Apache-2.0

config SHIELD_RPI_PICO_LCD
bool
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
default y if SHIELD_WAVESHARE_PICO_LCD_1_44
default y if SHIELD_WAVESHARE_PICO_LCD_1_8
default y if SHIELD_WAVESHARE_PICO_LCD_2
default y if SHIELD_WAVESHARE_PICO_RESTOUCH_LCD_2_8
default y if SHIELD_WAVESHARE_PICO_RESTOUCH_LCD_3_5
default n

choice ST7789V_PIXEL_FORMAT
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
default ST7789V_RGB565 if SHIELD_WAVESHARE_PICO_RESTOUCH_LCD_2_8
depends on SHIELD_RPI_PICO_LCD && DISPLAY
endchoice

Expand All @@ -19,21 +26,36 @@ config LV_Z_VDB_SIZE
depends on SHIELD_RPI_PICO_LCD && DISPLAY && LVGL

config LV_Z_BITS_PER_PIXEL
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
default 16 if SHIELD_WAVESHARE_PICO_LCD_1_44
default 16 if SHIELD_WAVESHARE_PICO_LCD_1_8
default 16 if SHIELD_WAVESHARE_PICO_LCD_2
default 16 if SHIELD_WAVESHARE_PICO_RESTOUCH_LCD_2_8
default 16 if SHIELD_WAVESHARE_PICO_RESTOUCH_LCD_3_5
depends on SHIELD_RPI_PICO_LCD && DISPLAY && LVGL

choice LV_COLOR_DEPTH
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
default LV_COLOR_DEPTH_16 if SHIELD_WAVESHARE_PICO_LCD_1_44
default LV_COLOR_DEPTH_16 if SHIELD_WAVESHARE_PICO_LCD_1_8
default LV_COLOR_DEPTH_16 if SHIELD_WAVESHARE_PICO_LCD_2
default LV_COLOR_DEPTH_16 if SHIELD_WAVESHARE_PICO_RESTOUCH_LCD_2_8
default LV_COLOR_DEPTH_16 if SHIELD_WAVESHARE_PICO_RESTOUCH_LCD_3_5
depends on SHIELD_RPI_PICO_LCD && DISPLAY && LVGL
endchoice

config LV_COLOR_16_SWAP
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
default y if SHIELD_WAVESHARE_PICO_LCD_1_44
default y if SHIELD_WAVESHARE_PICO_LCD_1_8
default y if SHIELD_WAVESHARE_PICO_LCD_2
default y if SHIELD_WAVESHARE_PICO_RESTOUCH_LCD_2_8
default y if SHIELD_WAVESHARE_PICO_RESTOUCH_LCD_3_5
depends on SHIELD_RPI_PICO_LCD && DISPLAY && LVGL

Expand Down
17 changes: 16 additions & 1 deletion boards/shields/rpi_pico_lcd/Kconfig.shield
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
# Copyright (c) 2023 TiaC Systems
# Copyright (c) 2023-2024 TiaC Systems
# SPDX-License-Identifier: Apache-2.0

config SHIELD_WAVESHARE_PICO_LCD_0_96
def_bool $(shields_list_contains,waveshare_pico_lcd_0_96)

config SHIELD_WAVESHARE_PICO_LCD_1_14
def_bool $(shields_list_contains,waveshare_pico_lcd_1_14)

config SHIELD_WAVESHARE_PICO_LCD_1_3
def_bool $(shields_list_contains,waveshare_pico_lcd_1_3)

config SHIELD_WAVESHARE_PICO_LCD_1_44
def_bool $(shields_list_contains,waveshare_pico_lcd_1_44)

config SHIELD_WAVESHARE_PICO_LCD_1_8
def_bool $(shields_list_contains,waveshare_pico_lcd_1_8)

config SHIELD_WAVESHARE_PICO_LCD_2
def_bool $(shields_list_contains,waveshare_pico_lcd_2)

config SHIELD_WAVESHARE_PICO_RESTOUCH_LCD_2_8
def_bool $(shields_list_contains,waveshare_pico_restouch_lcd_2_8)

config SHIELD_WAVESHARE_PICO_RESTOUCH_LCD_3_5
def_bool $(shields_list_contains,waveshare_pico_restouch_lcd_3_5)
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,61 @@
/*
* Copyright (c) 2024 TiaC Systems
* SPDX-License-Identifier: Apache-2.0
*/

#include "st7735s_160x80.dtsi"
#include "st7735s_rgb565.dtsi"

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

&rpipico_spi_lcd {
pinctrl-0 = <&spi1_lcd>;
pinctrl-names = "default";
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 13 GPIO_ACTIVE_HIGH>; /* GP13 */
};

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

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

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

&joystick_right { /* GP20 */
gpios = <&rpipico_header 20 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
};

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

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

&joystick_left { /* GP16 */
gpios = <&rpipico_header 16 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* 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 {
st7735s_160x80: st7735s@0 {
compatible = "sitronix,st7735r";
mipi-max-frequency = <DT_FREQ_M(20)>;
mipi-mode = <MIPI_DBI_MODE_SPI_4WIRE>;
reg = <0>;

status = "disabled";

width = <160>; /* landscape */
height = <80>; /* landscape */
x-offset = <1>; /* landscape */
y-offset = <26>; /* landscape */

inversion-on;
rgb-is-inverted;

pwctr1 = [62 02 04];
pwctr2 = [C0];
pwctr3 = [0D 00];
pwctr4 = [8D 6A];
pwctr5 = [8D EE];
vmctr1 = <0x0E>;
frmctr1 = [05 3A 3A];
frmctr2 = [05 3A 3A];
frmctr3 = [05 3A 3A 05 3A 3A];
invctr = <0x03>;
gamctrp1 = [10 0E 02 03 0E 07 02 07 0A 12 27 37 00 0D 0E 10];
gamctrn1 = [10 0E 03 03 0F 06 02 08 0A 13 26 36 00 0D 0E 10];
madctl = <0xA8>; /* landscape */
caset = [00 01 00 A0];
raset = [00 1A 00 69];
};
};

lcd_panel: &st7735s_160x80 {};
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
*/

&st7735s_160x80 {
madctl = <0x28>; /* landscape, mirrored */
};
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
*/

&st7735s_160x80 {
madctl = <0x68>; /* landscape, overhead */
};
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
*/

&st7735s_160x80 {
madctl = <0xE8>; /* landscape, upsidedown */
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* 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 {
st7735s_80x160: st7735s@0 {
compatible = "sitronix,st7735r";
mipi-max-frequency = <DT_FREQ_M(20)>;
mipi-mode = <MIPI_DBI_MODE_SPI_4WIRE>;
reg = <0>;

status = "disabled";

width = <80>; /* portrait */
height = <160>; /* portrait */
x-offset = <26>; /* portrait */
y-offset = <1>; /* portrait */

inversion-on;
rgb-is-inverted;

pwctr1 = [62 02 04];
pwctr2 = [C0];
pwctr3 = [0D 00];
pwctr4 = [8D 6A];
pwctr5 = [8D EE];
vmctr1 = <0x0E>;
frmctr1 = [05 3A 3A];
frmctr2 = [05 3A 3A];
frmctr3 = [05 3A 3A 05 3A 3A];
invctr = <0x03>;
gamctrp1 = [10 0E 02 03 0E 07 02 07 0A 12 27 37 00 0D 0E 10];
gamctrn1 = [10 0E 03 03 0F 06 02 08 0A 13 26 36 00 0D 0E 10];
madctl = <0xC8>; /* portrait */
caset = [00 01 00 A0];
raset = [00 1A 00 69];
};
};

lcd_panel: &st7735s_80x160 {};
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
*/

&st7735s_80x160 {
madctl = <0x88>; /* portrait, mirrored */
};
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
*/

&st7735s_80x160 {
madctl = <0x08>; /* portrait, overhead */
};
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
*/

&st7735s_80x160 {
madctl = <0x48>; /* portrait, upsidedown */
};
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 {
/delete-property/ inversion-on;
};
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 = <0x03>; /* 12-bit, RGB444 */
};
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"
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 TiaC Systems
* Copyright (c) 2023-2024 TiaC Systems
* SPDX-License-Identifier: Apache-2.0
*/

Expand All @@ -17,7 +17,7 @@
&mipi_dbi {
status = "okay";
reset-gpios = <&rpipico_header 12 GPIO_ACTIVE_LOW>; /* GP12 */
dc-gpios = <&rpipico_header 8 GPIO_ACTIVE_HIGH>; /* GP8 */
dc-gpios = <&rpipico_header 8 GPIO_ACTIVE_HIGH>; /* GP8 */
spi-dev = <&rpipico_spi_lcd>;
#address-cells = <1>;
#size-cells = <0>;
Expand Down
Loading
Loading