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 Waveshare Pico Clock Green to main branch #211

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

config SHIELD_RPI_PICO_CLOCK
bool
default y if SHIELD_WAVESHARE_PICO_CLOCK_GREEN
default n

config SHIELD_RPI_PICO_CLOCK_HIYOU
bool
default y if SHIELD_WAVESHARE_PICO_CLOCK_GREEN
default n

config SPI
default y if DT_HAS_SIPO_MUX_GP_SPI_ENABLED
depends on SHIELD_RPI_PICO_CLOCK

config GPIO_HOGS
default y if DT_HAS_SIPO_MUX_GPIO_ENABLED
depends on SHIELD_RPI_PICO_CLOCK_HIYOU && GPIO

config GPIO_HOGS_INIT_PRIORITY
default 85 if DT_HAS_SIPO_MUX_GPIO_ENABLED
depends on SHIELD_RPI_PICO_CLOCK_HIYOU && GPIO_HOGS
5 changes: 5 additions & 0 deletions boards/shields/rpi_pico_clock/Kconfig.shield
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2023-2024 TiaC Systems
# SPDX-License-Identifier: Apache-2.0

config SHIELD_WAVESHARE_PICO_CLOCK_GREEN
def_bool $(shields_list_contains,waveshare_pico_clock_green)
5 changes: 5 additions & 0 deletions boards/shields/rpi_pico_clock/boards/rpi_pico.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2023-2024 TiaC Systems
# SPDX-License-Identifier: Apache-2.0

CONFIG_USB_SELF_POWERED=n
CONFIG_USB_MAX_POWER=50
7 changes: 7 additions & 0 deletions boards/shields/rpi_pico_clock/boards/rpi_pico.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* Copyright (c) 2023-2024 TiaC Systems
* SPDX-License-Identifier: Apache-2.0
*/

#include "rpipico_r3-pinctrl.dtsi"
#include "rpipico_r3.dtsi"
5 changes: 5 additions & 0 deletions boards/shields/rpi_pico_clock/boards/rpi_pico_w.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright (c) 2023-2024 TiaC Systems
# SPDX-License-Identifier: Apache-2.0

CONFIG_USB_SELF_POWERED=n
CONFIG_USB_MAX_POWER=50
7 changes: 7 additions & 0 deletions boards/shields/rpi_pico_clock/boards/rpi_pico_w.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* Copyright (c) 2023-2024 TiaC Systems
* SPDX-License-Identifier: Apache-2.0
*/

#include "rpipico_r3-pinctrl.dtsi"
#include "rpipico_r3.dtsi"
22 changes: 22 additions & 0 deletions boards/shields/rpi_pico_clock/boards/rpipico_r3-pinctrl.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright (c) 2023-2024 TiaC Systems
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/dt-bindings/pinctrl/rpi-pico-rp2040-pinctrl.h>

&pinctrl {
spi1_wpcg_leds: spi1-wpcg-leds-pinctrl {
group1011-spi {
pinmux = <SPI1_SCK_P10>, /* GP10: SPI1_SCK */
<SPI1_TX_P11>; /* GP11: SPI1_TX */
};
/* GP9: SPI1_CSN not used for LED access */
/* GP12: SPI1_RX not used for LED access */
};
pwm_wpcg_buzzer: pwm-wpcg-buzzer-pinctrl {
group14-pwm {
pinmux = <PWM_7A_P14>; /* GP14: PWM7A (14) */
};
};
};
33 changes: 33 additions & 0 deletions boards/shields/rpi_pico_clock/boards/rpipico_r3.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Copyright (c) 2023-2024 TiaC Systems
* SPDX-License-Identifier: Apache-2.0
*/

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

&rpipico_i2c1 {
status = "okay";
clock-frequency = <I2C_BITRATE_STANDARD>;
};

rpipico_i2c_rtc: &rpipico_i2c1 {};

&spi1 {
status = "okay";
clock-frequency = <DT_FREQ_M(30)>;
};

rpipico_spi_leds: &spi1 {};

&pwm {
status = "okay";
};

rpipico_pwm_buzzers: &pwm {};

&gpio0 {
status = "okay";
};

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

&clock_i2c_rtc {
ds3231_mfd: ds3231-mfd@68 {
compatible = "maxim,ds3231-mfd";
reg = <0x68>;

status = "disabled";

ds3231_rtc: ds3231-rtc {
compatible = "maxim,ds3231-rtc";
status = "disabled";
};

ds3231_dts: ds3231-dts {
compatible = "maxim,ds3231-temp";
status = "disabled";
};
};
};

clock_mfd: &ds3231_mfd {};
clock_rtc: &ds3231_rtc {};
clock_dts: &ds3231_dts {};
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
/*
* Copyright (c) 2023-2024 TiaC Systems
* SPDX-License-Identifier: Apache-2.0
*/

&clock_gpio_1 {
boot-hogs-framing {
gpio-hog;
gpios = <2 GPIO_ACTIVE_HIGH>, <3 GPIO_ACTIVE_HIGH>,
<4 GPIO_ACTIVE_HIGH>, <5 GPIO_ACTIVE_HIGH>,
<6 GPIO_ACTIVE_HIGH>, <7 GPIO_ACTIVE_HIGH>,
<8 GPIO_ACTIVE_HIGH>, <9 GPIO_ACTIVE_HIGH>,
<10 GPIO_ACTIVE_HIGH>, <11 GPIO_ACTIVE_HIGH>,
<12 GPIO_ACTIVE_HIGH>, <13 GPIO_ACTIVE_HIGH>,
<14 GPIO_ACTIVE_HIGH>, <15 GPIO_ACTIVE_HIGH>,
<16 GPIO_ACTIVE_HIGH>, <17 GPIO_ACTIVE_HIGH>,
<18 GPIO_ACTIVE_HIGH>, <19 GPIO_ACTIVE_HIGH>,
<20 GPIO_ACTIVE_HIGH>, <21 GPIO_ACTIVE_HIGH>,
<22 GPIO_ACTIVE_HIGH>, <23 GPIO_ACTIVE_HIGH>;
output-high;
line-name = "framing";
};
};

&clock_gpio_2 {
boot-hogs-framing {
gpio-hog;
gpios = <2 GPIO_ACTIVE_HIGH>, <23 GPIO_ACTIVE_HIGH>;
output-high;
line-name = "framing";
};
};

&clock_gpio_3 {
boot-hogs-framing {
gpio-hog;
gpios = <2 GPIO_ACTIVE_HIGH>, <23 GPIO_ACTIVE_HIGH>;
output-high;
line-name = "framing";
};
boot-hogs-hello {
gpio-hog;
gpios = <4 GPIO_ACTIVE_HIGH>, <6 GPIO_ACTIVE_HIGH>,
<8 GPIO_ACTIVE_HIGH>, <11 GPIO_ACTIVE_HIGH>,
<13 GPIO_ACTIVE_HIGH>, <15 GPIO_ACTIVE_HIGH>,
<16 GPIO_ACTIVE_HIGH>, <17 GPIO_ACTIVE_HIGH>,
<19 GPIO_ACTIVE_HIGH>, <21 GPIO_ACTIVE_HIGH>;
output-high;
line-name = "hello";
};
};

&clock_gpio_4 {
boot-hogs-framing {
gpio-hog;
gpios = <2 GPIO_ACTIVE_HIGH>, <23 GPIO_ACTIVE_HIGH>;
output-high;
line-name = "framing";
};
boot-hogs-hello {
gpio-hog;
gpios = <4 GPIO_ACTIVE_HIGH>, <5 GPIO_ACTIVE_HIGH>,
<6 GPIO_ACTIVE_HIGH>, <8 GPIO_ACTIVE_HIGH>,
<12 GPIO_ACTIVE_HIGH>, <15 GPIO_ACTIVE_HIGH>,
<17 GPIO_ACTIVE_HIGH>, <19 GPIO_ACTIVE_HIGH>,
<21 GPIO_ACTIVE_HIGH>;
output-high;
line-name = "hello";
};
};

&clock_gpio_5 {
boot-hogs-framing {
gpio-hog;
gpios = <2 GPIO_ACTIVE_HIGH>, <23 GPIO_ACTIVE_HIGH>;
output-high;
line-name = "framing";
};
boot-hogs-hello {
gpio-hog;
gpios = <4 GPIO_ACTIVE_HIGH>, <6 GPIO_ACTIVE_HIGH>,
<8 GPIO_ACTIVE_HIGH>, <12 GPIO_ACTIVE_HIGH>,
<8 GPIO_ACTIVE_HIGH>, <15 GPIO_ACTIVE_HIGH>,
<16 GPIO_ACTIVE_HIGH>, <17 GPIO_ACTIVE_HIGH>,
<19 GPIO_ACTIVE_HIGH>, <20 GPIO_ACTIVE_HIGH>,
<21 GPIO_ACTIVE_HIGH>;
output-high;
line-name = "hello";
};
};

&clock_gpio_6 {
boot-hogs-framing {
gpio-hog;
gpios = <2 GPIO_ACTIVE_HIGH>, <23 GPIO_ACTIVE_HIGH>;
output-high;
line-name = "framing";
};
};

&clock_gpio_7 {
boot-hogs-framing {
gpio-hog;
gpios = <2 GPIO_ACTIVE_HIGH>, <3 GPIO_ACTIVE_HIGH>,
<4 GPIO_ACTIVE_HIGH>, <5 GPIO_ACTIVE_HIGH>,
<6 GPIO_ACTIVE_HIGH>, <7 GPIO_ACTIVE_HIGH>,
<8 GPIO_ACTIVE_HIGH>, <9 GPIO_ACTIVE_HIGH>,
<10 GPIO_ACTIVE_HIGH>, <11 GPIO_ACTIVE_HIGH>,
<12 GPIO_ACTIVE_HIGH>, <13 GPIO_ACTIVE_HIGH>,
<14 GPIO_ACTIVE_HIGH>, <15 GPIO_ACTIVE_HIGH>,
<16 GPIO_ACTIVE_HIGH>, <17 GPIO_ACTIVE_HIGH>,
<18 GPIO_ACTIVE_HIGH>, <19 GPIO_ACTIVE_HIGH>,
<20 GPIO_ACTIVE_HIGH>, <21 GPIO_ACTIVE_HIGH>,
<22 GPIO_ACTIVE_HIGH>, <23 GPIO_ACTIVE_HIGH>;
output-high;
line-name = "framing";
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
/*
* Copyright (c) 2023-2024 TiaC Systems
* SPDX-License-Identifier: Apache-2.0
*/

#include <freq.h>

&clock_spi_leds {
sipo_mux_gp: sipo-mux-gp@0 {
compatible = "sipo-mux-gp-spi";
spi-max-frequency = <DT_FREQ_M(30)>;
reg = <0>;

status = "disabled";

refresh-time-us = <500>;
shift-width = <32>;
data-width = <24>;

#address-cells = <1>;
#size-cells = <0>;

sipo_mux_gpio_0: sipo-mux-gpio@0 {
compatible = "sipo-mux-gpio";
gpio-controller;
#gpio-cells = <2>;
ngpios = <24>;
offset = <0>;
reg = <0>;

status = "disabled";
};

sipo_mux_gpio_1: sipo-mux-gpio@1 {
compatible = "sipo-mux-gpio";
gpio-controller;
#gpio-cells = <2>;
ngpios = <24>;
offset = <24>;
reg = <1>;

status = "disabled";
};

sipo_mux_gpio_2: sipo-mux-gpio@2 {
compatible = "sipo-mux-gpio";
gpio-controller;
#gpio-cells = <2>;
ngpios = <24>;
offset = <48>;
reg = <2>;

status = "disabled";
};

sipo_mux_gpio_3: sipo-mux-gpio@3 {
compatible = "sipo-mux-gpio";
gpio-controller;
#gpio-cells = <2>;
ngpios = <24>;
offset = <72>;
reg = <3>;

status = "disabled";
};

sipo_mux_gpio_4: sipo-mux-gpio@4 {
compatible = "sipo-mux-gpio";
gpio-controller;
#gpio-cells = <2>;
ngpios = <24>;
offset = <96>;
reg = <4>;

status = "disabled";
};

sipo_mux_gpio_5: sipo-mux-gpio@5 {
compatible = "sipo-mux-gpio";
gpio-controller;
#gpio-cells = <2>;
ngpios = <24>;
offset = <120>;
reg = <5>;

status = "disabled";
};

sipo_mux_gpio_6: sipo-mux-gpio@6 {
compatible = "sipo-mux-gpio";
gpio-controller;
#gpio-cells = <2>;
ngpios = <24>;
offset = <144>;
reg = <6>;

status = "disabled";
};

sipo_mux_gpio_7: sipo-mux-gpio@7 {
compatible = "sipo-mux-gpio";
gpio-controller;
#gpio-cells = <2>;
ngpios = <24>;
offset = <168>;
reg = <7>;

status = "disabled";
};

sipo_mux_display_8: sipo-mux-display@8 {
compatible = "sipo-mux-display";
reg = <8>;

height = <7>;
width = <22>;
offset = <2 1>;

status = "disabled";
};
};
};

clock_sipo_mux: &sipo_mux_gp {};
clock_gpio_0: &sipo_mux_gpio_0 {};
clock_gpio_1: &sipo_mux_gpio_1 {};
clock_gpio_2: &sipo_mux_gpio_2 {};
clock_gpio_3: &sipo_mux_gpio_3 {};
clock_gpio_4: &sipo_mux_gpio_4 {};
clock_gpio_5: &sipo_mux_gpio_5 {};
clock_gpio_6: &sipo_mux_gpio_6 {};
clock_gpio_7: &sipo_mux_gpio_7 {};
clock_display: &sipo_mux_display_8 {};
Loading
Loading