From e5b9134099a579c336a9b310b1b7811180243cf3 Mon Sep 17 00:00:00 2001 From: Daniel Istvan Nemeth Date: Sun, 5 Nov 2023 21:08:30 +0100 Subject: [PATCH] samples:drivers:led_ws2812 nRF7002DK support New config files to support nRF700DK Signed-off-by: Daniel Istvan Nemeth --- samples/drivers/led_ws2812/README.rst | 1 + .../led_ws2812/boards/nrf7002dk_nrf5340.conf | 5 +++ .../boards/nrf7002dk_nrf5340.overlay | 41 +++++++++++++++++++ 3 files changed, 47 insertions(+) create mode 100644 samples/drivers/led_ws2812/boards/nrf7002dk_nrf5340.conf create mode 100644 samples/drivers/led_ws2812/boards/nrf7002dk_nrf5340.overlay diff --git a/samples/drivers/led_ws2812/README.rst b/samples/drivers/led_ws2812/README.rst index 5529604b0a8caeb..3d4d78c0edaf6dc 100644 --- a/samples/drivers/led_ws2812/README.rst +++ b/samples/drivers/led_ws2812/README.rst @@ -102,6 +102,7 @@ This sample uses different drivers depending on the selected board: I2S driver: - thingy52_nrf52832 +- nrf7002dk_nrf5340 (1.8V logic level, make sure to use a logic level shifter!) SPI driver: diff --git a/samples/drivers/led_ws2812/boards/nrf7002dk_nrf5340.conf b/samples/drivers/led_ws2812/boards/nrf7002dk_nrf5340.conf new file mode 100644 index 000000000000000..f5d64aaf5da02e0 --- /dev/null +++ b/samples/drivers/led_ws2812/boards/nrf7002dk_nrf5340.conf @@ -0,0 +1,5 @@ +CONFIG_SPI=n + +CONFIG_I2S=y +CONFIG_WS2812_STRIP=y +CONFIG_WS2812_STRIP_I2S=y diff --git a/samples/drivers/led_ws2812/boards/nrf7002dk_nrf5340.overlay b/samples/drivers/led_ws2812/boards/nrf7002dk_nrf5340.overlay new file mode 100644 index 000000000000000..9c314e2e9ff8f69 --- /dev/null +++ b/samples/drivers/led_ws2812/boards/nrf7002dk_nrf5340.overlay @@ -0,0 +1,41 @@ +#include + +&pinctrl { + i2s0_default_alt: i2s0_default_alt { + group1 { + /* Default I2S config for the nRF5340, P1.13 is the output */ + psels = , + , + , + ; + }; + }; +}; + +i2s_led: &i2s0 { + status = "okay"; + pinctrl-0 = <&i2s0_default_alt>; + pinctrl-names = "default"; +}; + +&gpio1 { + status = "okay"; +}; + +/ { + led_strip: ws2812 { + compatible = "worldsemi,ws2812-i2s"; + + i2s-dev = < &i2s_led >; + chain-length = <42>; /* arbitrary; change at will */ + color-mapping = ; + // out-active-low; + reset-delay = <500>; + }; + + aliases { + led-strip = &led_strip; + }; +};