-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
samples: drivers: led_ws2812: nRF5340DK support
New config files to support nrf5340-based boards Signed-off-by: Daniel Istvan Nemeth <[email protected]>
- Loading branch information
1 parent
9439c81
commit e5dbb26
Showing
3 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
36 changes: 36 additions & 0 deletions
36
samples/drivers/led_ws2812/boards/nrf5340dk_nrf5340.overlay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#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"; | ||
}; | ||
|
||
/ { | ||
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>; | ||
reset-delay = <500>; | ||
}; | ||
|
||
aliases { | ||
led-strip = &led_strip; | ||
}; | ||
}; |