Skip to content

Commit 429e3a9

Browse files
soburikartben
authored andcommitted
shields: display: Add Waveshare Pico OLED 1.3
Added Waveshare 1.3inch OLED module for RaspberryPi Pico. Signed-off-by: TOKITA Hiroshi <[email protected]>
1 parent 6a7765c commit 429e3a9

11 files changed

+226
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright (c) 2025 TOKITA Hiroshi
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if SHIELD_WAVESHARE_PICO_OLED_1_3
5+
6+
if DISPLAY
7+
8+
if LVGL
9+
10+
config LV_DPI_DEF
11+
default 110
12+
13+
config LV_Z_BITS_PER_PIXEL
14+
default 1
15+
16+
choice LV_COLOR_DEPTH
17+
default LV_COLOR_DEPTH_1
18+
endchoice
19+
20+
endif # LVGL
21+
22+
endif # DISPLAY
23+
24+
endif # SHIELD_WAVESHARE_PICO_OLED_1_3
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright (c) 2025 TOKITA Hiroshi
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config SHIELD_WAVESHARE_PICO_OLED_1_3
5+
def_bool $(shields_list_contains,waveshare_pico_oled_1_3)
6+
7+
config SHIELD_WAVESHARE_PICO_OLED_1_3_DISPLAY
8+
def_bool $(shields_list_contains,waveshare_pico_oled_1_3_display)
9+
10+
config SHIELD_WAVESHARE_PICO_OLED_1_3_BUTTONS
11+
def_bool $(shields_list_contains,waveshare_pico_oled_1_3_buttons)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/*
2+
* Copyright (c) 2025 TOKITA Hiroshi
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/* pico_plus2 can use with the rpi_pico configuration. */
8+
#include "rpi_pico.overlay"
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
* Copyright (c) 2025 TOKITA Hiroshi
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
&pinctrl {
8+
i2c1_default: i2c1_default {
9+
waveshare_pico_oled_1_3_group1 {
10+
pinmux = <I2C1_SDA_P6>, <I2C1_SCL_P7>;
11+
input-enable;
12+
input-schmitt-enable;
13+
};
14+
};
15+
};
16+
17+
&i2c1 {
18+
clock-frequency = <I2C_BITRATE_FAST>;
19+
pinctrl-0 = <&i2c1_default>;
20+
pinctrl-names = "default";
21+
status = "okay";
22+
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/*
2+
* Copyright (c) 2025 TOKITA Hiroshi
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/* rpi_pico2 can use with the rpi_pico configuration. */
8+
#include "rpi_pico.overlay"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/*
2+
* Copyright (c) 2025 TOKITA Hiroshi
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/* w5500_evb_pico2 can use with the rpi_pico configuration. */
8+
#include "rpi_pico.overlay"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/*
2+
* Copyright (c) 2025 TOKITA Hiroshi
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/* w5500_evb_pico2 can use with the rpi_pico configuration. */
8+
#include "rpi_pico.overlay"
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
.. _waveshare_pico_oled_1_3:
2+
3+
Waveshare 1.3inch OLED Display Module for Raspberry Pi Pico
4+
###########################################################
5+
6+
Overview
7+
********
8+
9+
The Waveshare 1.3inch OLED Display Module for Raspberry Pi Pico is
10+
a 64x128 vertically long LCD module based on the SinoWealth SH1107 controller.
11+
This module connects via I2C and optionally can use SPI(need soldering).
12+
This display module has two buttons that the user program can use.
13+
It is convenient for implementing user interfaces.
14+
15+
More information about the shield and Arduino adapter can be found at
16+
the `Waveshare Pico OLED 1.3 Module website`_.
17+
18+
Pin Assignments
19+
===============
20+
21+
+-------+-----------+-------------------------------------------+
22+
| Name | Function | Usage |
23+
+=======+===========+===========================================+
24+
| GP6 | I2C_SDA | I2C Data input (I2C1_SDA) |
25+
+-------+-----------+-------------------------------------------+
26+
| GP7 | I2C_SCL | I2C Clock input (I2C1_SCL) |
27+
+-------+-----------+-------------------------------------------+
28+
| GP8 | OLED_DC | Data/Command control pin (optional) |
29+
+-------+-----------+-------------------------------------------+
30+
| GP9 | OLED_CS | SPI Chip Select (SPI1_CSN, optional) |
31+
+-------+-----------+-------------------------------------------+
32+
| GP10 | OLED_CLK | SPI Clock input (SPI1_SCK, optional) |
33+
+-------+-----------+-------------------------------------------+
34+
| GP11 | OLED_DIN | SPI Data input (SPI1_TX, optional) |
35+
+-------+-----------+-------------------------------------------+
36+
| GP12 | OLED_RST | Reset |
37+
+-------+-----------+-------------------------------------------+
38+
| GP15 | GPIO | User Key 0 |
39+
+-------+-----------+-------------------------------------------+
40+
| GP17 | GPIO | User Key 1 |
41+
+-------+-----------+-------------------------------------------+
42+
43+
.. note::
44+
The SPI interface is not available by default.
45+
Switch the J1, J2, and J3 jumper by moving 0-ohm registers
46+
to the SPI side to enable SPI.
47+
48+
Programming
49+
***********
50+
51+
Set ``-DSHIELD=waveshare_pico_oled_1_3`` when you invoke ``west build``. For example:
52+
53+
.. zephyr-app-commands::
54+
:zephyr-app: samples/subsys/display/lvgl
55+
:board: rpi_pico
56+
:shield: waveshare_pico_oled_1_3
57+
:goals: build
58+
59+
References
60+
**********
61+
62+
.. target-notes::
63+
64+
.. _Waveshare Pico OLED 1.3 Module website:
65+
https://www.waveshare.com/wiki/Pico-OLED-1.3
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/*
2+
* Copyright (c) 2025 TOKITA Hiroshi
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include "waveshare_pico_oled_1_3_display.overlay"
8+
#include "waveshare_pico_oled_1_3_buttons.overlay"
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright (c) 2025 TOKITA Hiroshi
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/dt-bindings/gpio/gpio.h>
8+
#include <zephyr/dt-bindings/input/input-event-codes.h>
9+
#include <zephyr/dt-bindings/lvgl/lvgl.h>
10+
11+
/ {
12+
buttons {
13+
compatible = "gpio-keys";
14+
15+
key0: key0 {
16+
label = "User Key 0";
17+
gpios = <&pico_header 15 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
18+
zephyr,code = <INPUT_KEY_0>;
19+
};
20+
21+
key1: key1 {
22+
label = "User Key 1";
23+
gpios = <&pico_header 17 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
24+
zephyr,code = <INPUT_KEY_1>;
25+
};
26+
};
27+
28+
aliases {
29+
sw0 = &key0;
30+
};
31+
};

0 commit comments

Comments
 (0)