Skip to content

Commit

Permalink
samples:drivers:led_ws2812: nRF7002DK support
Browse files Browse the repository at this point in the history
New config files to support nRF700DK

Signed-off-by: Daniel Istvan Nemeth <[email protected]>
  • Loading branch information
ndaneil committed Nov 5, 2023
1 parent d5a1a8b commit 09aaaa3
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 0 deletions.
1 change: 1 addition & 0 deletions samples/drivers/led_ws2812/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
5 changes: 5 additions & 0 deletions samples/drivers/led_ws2812/boards/nrf7002dk_nrf5340.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CONFIG_SPI=n

CONFIG_I2S=y
CONFIG_WS2812_STRIP=y
CONFIG_WS2812_STRIP_I2S=y
41 changes: 41 additions & 0 deletions samples/drivers/led_ws2812/boards/nrf7002dk_nrf5340.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#include <zephyr/dt-bindings/led/led.h>

&pinctrl {
i2s0_default_alt: i2s0_default_alt {
group1 {
/* Default I2S config for the nRF5340, P1.13 is the output */
psels = <NRF_PSEL(I2S_SCK_M, 1, 15)>,
<NRF_PSEL(I2S_LRCK_M, 1, 12)>,
<NRF_PSEL(I2S_SDOUT, 1, 13)>,
<NRF_PSEL(I2S_SDIN, 1, 14)>;
};
};
};

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 = <LED_COLOR_ID_GREEN
LED_COLOR_ID_RED
LED_COLOR_ID_BLUE>;
// out-active-low;
reset-delay = <500>;
};

aliases {
led-strip = &led_strip;
};
};

0 comments on commit 09aaaa3

Please sign in to comment.