Skip to content

Commit

Permalink
Move to pinctrl.
Browse files Browse the repository at this point in the history
  • Loading branch information
kuolemax authored Apr 6, 2023
1 parent 2222080 commit 5d4c52d
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions config/boards/shields/swoop/boards/nice_nano_v2.overlay
Original file line number Diff line number Diff line change
@@ -1,24 +1,38 @@
#include <dt-bindings/led/led.h>

&pinctrl {
spi1_default: spi1_default {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
};
};

spi1_sleep: spi1_sleep {
group1 {
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
low-power-enable;
};
};
};

&spi1 {
compatible = "nordic,nrf-spim";
/* Cannot be used together with i2c0. */
status = "okay";
mosi-pin = <6>;
// Unused pins, needed for SPI definition, but not used by the ws2812 driver itself.
sck-pin = <5>;
miso-pin = <7>;

pinctrl-0 = <&spi1_default>;
pinctrl-1 = <&spi1_sleep>;
pinctrl-names = "default", "sleep";

led_strip: ws2812@0 {
compatible = "worldsemi,ws2812-spi";
label = "SK6812mini";
label = "WS2812";

/* SPI */
reg = <0>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;

/* WS2812 */
chain-length = <36>; /* There are per-key RGB, but the first 6 are underglow */
chain-length = <10>; /* arbitrary; change at will */
spi-one-frame = <0x70>;
spi-zero-frame = <0x40>;

Expand Down

0 comments on commit 5d4c52d

Please sign in to comment.