boards: arm: sparkfun_pro_micro_rp2040: Add RGB LED

The SparkFun Pro Micro RP2040 board has an WS2812-style RGB LED connected
to a GPIO pin.  Add this to the devicetree so that this device can be used.

Signed-off-by: David Brown <david.brown@linaro.org>
This commit is contained in:
David Brown 2024-02-22 13:07:26 -07:00 committed by Alberto Escolar
parent a0d75923aa
commit 9fd211a3f8
2 changed files with 30 additions and 0 deletions

View file

@ -49,4 +49,10 @@
clocks_default: clocks_default {
};
ws2812_pio0_default: ws2812_pio_default {
ws2812 {
pinmux = <PIO0_P25>;
};
};
};

View file

@ -10,6 +10,7 @@
#include "sparkfun_pro_micro_rp2040-pinctrl.dtsi"
#include "sparkfun_pro_micro_connector.dtsi"
#include <freq.h>
#include <zephyr/dt-bindings/led/led.h>
/ {
chosen {
@ -22,6 +23,7 @@
aliases {
watchdog0 = &wdt0;
led-strip = &ws2812;
};
};
@ -96,6 +98,28 @@
pinctrl-names = "default";
};
&pio0 {
status = "okay";
pio-ws2812 {
compatible = "worldsemi,ws2812-rpi_pico-pio";
status = "okay";
pinctrl-0 = <&ws2812_pio0_default>;
pinctrl-names = "default";
bit-waveform = <3>, <3>, <4>;
ws2812: ws2812 {
status = "okay";
gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>;
chain-length = <1>;
color-mapping = <LED_COLOR_ID_GREEN
LED_COLOR_ID_RED
LED_COLOR_ID_BLUE>;
reset-delay = <280>;
frequency = <800000>;
};
};
};
zephyr_udc0: &usbd {
status = "okay";