Skip to content

Commit 39d3d64

Browse files
committed
boards: arm: adafruit_kb2040: add led-strip configuration
Adafruit KB2040 has one NeoPixel(WS2812) LED that attaches to GPIO17 pin. Add configuration for it. Signed-off-by: TOKITA Hiroshi <[email protected]>
1 parent 0ab91c7 commit 39d3d64

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed

boards/arm/adafruit_kb2040/adafruit_kb2040-pinctrl.dtsi

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,10 @@
5050

5151
clocks_default: clocks_default {
5252
};
53+
54+
ws2812_pio0_default: ws2812_pio0_default {
55+
ws2812 {
56+
pinmux = <PIO0_P17>;
57+
};
58+
};
5359
};

boards/arm/adafruit_kb2040/adafruit_kb2040.dts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "adafruit_kb2040-pinctrl.dtsi"
1212
#include "sparkfun_pro_micro_connector.dtsi"
1313
#include <freq.h>
14+
#include <zephyr/dt-bindings/led/led.h>
1415

1516
/ {
1617
chosen {
@@ -24,6 +25,7 @@
2425

2526
aliases {
2627
watchdog0 = &wdt0;
28+
led-strip = &ws2812;
2729
};
2830
};
2931

@@ -94,6 +96,29 @@
9496
pinctrl-names = "default";
9597
};
9698

99+
&pio0 {
100+
status = "okay";
101+
102+
pio-ws2812 {
103+
compatible = "worldsemi,ws2812-rpi_pico-pio";
104+
status = "okay";
105+
pinctrl-0 = <&ws2812_pio0_default>;
106+
pinctrl-names = "default";
107+
bit-waveform = <3>, <3>, <4>;
108+
109+
ws2812: ws2812 {
110+
status = "okay";
111+
output-pin = <17>;
112+
chain-length = <1>;
113+
color-mapping = <LED_COLOR_ID_GREEN
114+
LED_COLOR_ID_RED
115+
LED_COLOR_ID_BLUE>;
116+
reset-delay = <280>;
117+
frequency = <800000>;
118+
};
119+
};
120+
};
121+
97122
zephyr_udc0: &usbd {
98123
status = "okay";
99124
};

0 commit comments

Comments
 (0)