-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhostExtension.overlay
More file actions
72 lines (56 loc) · 1.6 KB
/
hostExtension.overlay
File metadata and controls
72 lines (56 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
* At 4 MHz, 1 bit is 250 ns, so 3 bits is 750 ns.
* That's cutting it a bit close to the edge of the timing parameters,
* but it seems to work on AdaFruit LED rings.
*/
#define SPI_FREQ 4000000
#define ZERO_FRAME (0x40) // binary 0100 0000
#define ONE_FRAME (0x70) // b: 0111 0000
#include <zephyr/dt-bindings/led/led.h> // get Zephyr's header, using their driver
&spi3 {
compatible = "nordic,nrf-spim";
led_strip: ws2812@0 {
compatible = "worldsemi,ws2812-spi";
label = "WS2812";
/* SPI */
reg = <0>;
spi-max-frequency = <SPI_FREQ>;
/* WS2812 */
chain-length = <1>;
reset-delay = <100>;
color-mapping = <LED_COLOR_ID_GREEN
LED_COLOR_ID_RED
LED_COLOR_ID_BLUE>;
spi-zero-frame = <0x40>;
spi-one-frame = <0x70>;
};
};
&pinctrl {
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 29)>,
<NRF_PSEL(SPIM_MOSI, 0, 26)>,
<NRF_PSEL(SPIM_MISO, 0, 30)>;
};
};
spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 29)>,
<NRF_PSEL(SPIM_MOSI, 0, 26)>,
<NRF_PSEL(SPIM_MISO, 0, 30)>;
low-power-enable;
};
};
};
/ {
leds {
compatible = "gpio-leds";
led0: led_0 {
gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
};
};
aliases {
rgb-led = &led_strip;
level-test = &led0;
};
};