shields: display: Add Waveshare Pico LCD 1.14

Added Waveshare 1.14inch LCD module for RaspberryPi Pico.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>
This commit is contained in:
TOKITA Hiroshi 2025-02-22 04:02:18 +09:00 committed by Benjamin Cabé
commit 6a7765cfda
11 changed files with 295 additions and 0 deletions

View file

@ -0,0 +1,31 @@
# Copyright (c) 2025 TOKITA Hiroshi
# SPDX-License-Identifier: Apache-2.0
if SHIELD_WAVESHARE_PICO_LCD_1_14 || SHIELD_WAVESHARE_PICO_LCD_1_14_DISPLAY
if DISPLAY
choice ST7789V_PIXEL_FORMAT
default ST7789V_RGB565
endchoice
if LVGL
config LV_DPI_DEF
default 242
config LV_Z_BITS_PER_PIXEL
default 16
choice LV_COLOR_DEPTH
default LV_COLOR_DEPTH_16
endchoice
configdefault LV_COLOR_16_SWAP
default y
endif # LVGL
endif # DISPLAY
endif # SHIELD_WAVESHARE_PICO_LCD_1_14

View file

@ -0,0 +1,11 @@
# Copyright (c) 2025 TOKITA Hiroshi
# SPDX-License-Identifier: Apache-2.0
config SHIELD_WAVESHARE_PICO_LCD_1_14
def_bool $(shields_list_contains,waveshare_pico_lcd_1_14)
config SHIELD_WAVESHARE_PICO_LCD_1_14_DISPLAY
def_bool $(shields_list_contains,waveshare_pico_lcd_1_14_display)
config SHIELD_WAVESHARE_PICO_LCD_1_14_BUTTONS
def_bool $(shields_list_contains,waveshare_pico_lcd_1_14_buttons)

View file

@ -0,0 +1,8 @@
/*
* Copyright (c) 2025 TOKITA Hiroshi
*
* SPDX-License-Identifier: Apache-2.0
*/
/* pico_plus2 can use with the rpi_pico configuration. */
#include "rpi_pico.overlay"

View file

@ -0,0 +1,20 @@
/*
* Copyright (c) 2025 TOKITA Hiroshi
*
* SPDX-License-Identifier: Apache-2.0
*/
&pinctrl {
spi1_default: spi1_default {
group1 {
pinmux = <SPI1_CSN_P9>, <SPI1_SCK_P10>, <SPI1_TX_P11>;
};
};
};
&spi1 {
pinctrl-0 = < &spi1_default >;
pinctrl-names = "default";
cs-gpios = <&pico_header 9 GPIO_ACTIVE_LOW>;
status = "okay";
};

View file

@ -0,0 +1,8 @@
/*
* Copyright (c) 2025 TOKITA Hiroshi
*
* SPDX-License-Identifier: Apache-2.0
*/
/* rpi_pico2 can use with the rpi_pico configuration. */
#include "rpi_pico.overlay"

View file

@ -0,0 +1,8 @@
/*
* Copyright (c) 2025 TOKITA Hiroshi
*
* SPDX-License-Identifier: Apache-2.0
*/
/* w5500_evb_pico2 can use with the rpi_pico configuration. */
#include "rpi_pico.overlay"

View file

@ -0,0 +1,8 @@
/*
* Copyright (c) 2025 TOKITA Hiroshi
*
* SPDX-License-Identifier: Apache-2.0
*/
/* w5500_evb_pico2 can use with the rpi_pico configuration. */
#include "rpi_pico.overlay"

View file

@ -0,0 +1,66 @@
.. _waveshare_pico_lcd_1_14:
Waveshare 1.14inch LCD Display Module for Raspberry Pi Pico
###########################################################
Overview
********
The Waveshare 1.14inch LCD Display Module for Raspberry Pi Pico is
a 240x135/65K color IPS LCD module based on the ST7789V controller.
This module connects via SPI.
This display module has two buttons and joystick that the user program can use.
It is convenient for implementing user interfaces.
More information about the shield and Arduino adapter can be found at
the `Waveshare Pico-LCD-1.14 Module website`_.
Pin Assignments
===============
+-------+-----------+-------------------------------------------+
| Name | Function | Usage |
+=======+===========+===========================================+
| GP2 | UP | Joystick Up |
+-------+-----------+-------------------------------------------+
| GP3 | CTRL | Joystick Center |
+-------+-----------+-------------------------------------------+
| GP8 | LCD_DC | Data/Command control pin |
+-------+-----------+-------------------------------------------+
| GP9 | LCD_CS | SPI Chip Select (SPI1_CSN) |
+-------+-----------+-------------------------------------------+
| GP10 | LCD_CLK | SPI Clock input (SPI1_SCK) |
+-------+-----------+-------------------------------------------+
| GP11 | LCD_DIN | SPI Data input (SPI1_TX) |
+-------+-----------+-------------------------------------------+
| GP12 | LCD_RST | Reset |
+-------+-----------+-------------------------------------------+
| GP13 | LCD_BL | Backlight |
+-------+-----------+-------------------------------------------+
| GP15 | GPIO | User Key A |
+-------+-----------+-------------------------------------------+
| GP17 | GPIO | User Key 1 |
+-------+-----------+-------------------------------------------+
| GP18 | DOWN | Joystick Down |
+-------+-----------+-------------------------------------------+
| GP20 | RIGHT | Joystick Right |
+-------+-----------+-------------------------------------------+
Programming
***********
Set ``-DSHIELD=waveshare_pico_lcd_1_14`` when you invoke ``west build``. For example:
.. zephyr-app-commands::
:zephyr-app: samples/subsys/display/lvgl
:board: rpi_pico
:shield: waveshare_pico_oled_1_14
:goals: build
References
**********
.. target-notes::
.. _Waveshare Pico-LCD-1.14 Module website:
https://www.waveshare.com/wiki/Pico-LCD-1.14

View file

@ -0,0 +1,8 @@
/*
* Copyright (c) 2025 TOKITA Hiroshi
*
* SPDX-License-Identifier: Apache-2.0
*/
#include "waveshare_pico_lcd_1_14_display.overlay"
#include "waveshare_pico_lcd_1_14_buttons.overlay"

View file

@ -0,0 +1,66 @@
/*
* Copyright (c) 2025 TOKITA Hiroshi
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/dt-bindings/gpio/gpio.h>
#include <zephyr/dt-bindings/input/input-event-codes.h>
#include <zephyr/dt-bindings/lvgl/lvgl.h>
/ {
waveshare_pico_lcd_1_14_buttons: waveshare-pico_lcd_1_14-buttons {
compatible = "gpio-keys";
key_a: key_a {
label = "User key A";
gpios = <&pico_header 15 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
zephyr,code = <INPUT_KEY_A>;
};
key_b: key_b {
label = "User key B";
gpios = <&pico_header 17 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
zephyr,code = <INPUT_KEY_B>;
};
};
waveshare_pico_lcd_1_14_joystick: waveshare-pico_lcd_1_14-joystick {
compatible = "gpio-keys";
joystick_enter: joystick_enter {
label = "User joystick ENTER";
gpios = <&pico_header 3 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
zephyr,code = <INPUT_KEY_ENTER>;
};
joystick_right: joystick_right {
label = "User joystick RIGHT";
gpios = <&pico_header 20 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
zephyr,code = <INPUT_KEY_RIGHT>;
};
joystick_up: joystick_up {
label = "User joystick UP";
gpios = <&pico_header 2 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
zephyr,code = <INPUT_KEY_UP>;
};
joystick_down: joystick_down {
label = "User joystick DOWN";
gpios = <&pico_header 18 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
zephyr,code = <INPUT_KEY_DOWN>;
};
joystick_left: joystick_left {
label = "User joystick LEFT";
gpios = <&pico_header 16 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
zephyr,code = <INPUT_KEY_LEFT>;
};
};
aliases {
sw0 = &key_a;
sw1 = &key_b;
};
};

View file

@ -0,0 +1,61 @@
/*
* Copyright (c) 2025 TOKITA Hiroshi
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/dt-bindings/gpio/gpio.h>
#include <zephyr/dt-bindings/mipi_dbi/mipi_dbi.h>
/ {
chosen {
zephyr,display = &st7789v_waveshare_pico_lcd_1_14;
};
mipi_dbi_waveshare_pico_lcd_1_14 {
compatible = "zephyr,mipi-dbi-spi";
spi-dev = <&spi1>;
dc-gpios = <&pico_header 8 GPIO_ACTIVE_HIGH>;
reset-gpios = <&pico_header 12 GPIO_ACTIVE_LOW>;
write-only;
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
st7789v_waveshare_pico_lcd_1_14: st7789v@0 {
compatible = "sitronix,st7789v";
reg = <0>;
mipi-max-frequency = <20000000>;
width = <240>;
height = <135>;
x-offset = <40>;
y-offset = <53>;
vcom = <0x19>;
gctrl = <0x35>;
vrhs = <0x12>;
vdvs = <0x20>;
mdac = <0x77>;
gamma = <0x00>;
colmod = <0x05>;
lcm = <0x2c>;
porch-param = [0c 0c 00 33 33];
cmd2en-param = [5a 69 02 00];
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 = [40 02 14];
mipi-mode = "MIPI_DBI_MODE_SPI_4WIRE";
status = "okay";
};
};
lcd_backlight_en {
compatible = "regulator-fixed";
regulator-name = "lcd_backlight_enable";
enable-gpios = <&pico_header 13 GPIO_ACTIVE_HIGH>;
regulator-boot-on;
};
};