File tree Expand file tree Collapse file tree 6 files changed +135
-0
lines changed
samples/drivers/led_ws2812/boards Expand file tree Collapse file tree 6 files changed +135
-0
lines changed Original file line number Diff line number Diff line change
1
+ CONFIG_WS2812_STRIP_SPI=y
2
+ CONFIG_SPI=y
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright (c) 2022 Espressif Systems (Shanghai) Co., Ltd.
3
+ *
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+
7
+ #include <zephyr/dt-bindings/led/led.h>
8
+
9
+ &spi2 {
10
+ /* Workaround to support WS2812 driver */
11
+ line-idle-low;
12
+
13
+ led_strip: ws2812@0 {
14
+ compatible = "worldsemi,ws2812-spi";
15
+
16
+ /* SPI */
17
+ reg = <0>; /* ignored, but necessary for SPI bindings */
18
+ spi-max-frequency = <6400000>;
19
+
20
+ /* WS2812 */
21
+ chain-length = <1>; /* arbitrary; change at will */
22
+ spi-cpha;
23
+ spi-one-frame = <0xf0>; /* 11110000: 625 ns high and 625 ns low */
24
+ spi-zero-frame = <0xc0>; /* 11000000: 312.5 ns high and 937.5 ns low */
25
+ color-mapping = <LED_COLOR_ID_GREEN
26
+ LED_COLOR_ID_RED
27
+ LED_COLOR_ID_BLUE>;
28
+ };
29
+ };
30
+
31
+ &pinctrl {
32
+ spim2_default: spim2_default {
33
+ group2 {
34
+ pinmux = <SPIM2_MOSI_GPIO8>;
35
+ };
36
+ };
37
+ };
38
+
39
+ / {
40
+ aliases {
41
+ led-strip = &led_strip;
42
+ };
43
+ };
Original file line number Diff line number Diff line change
1
+ CONFIG_WS2812_STRIP_SPI=y
2
+ CONFIG_SPI=y
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright (c) 2022 Espressif Systems (Shanghai) Co., Ltd.
3
+ *
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+
7
+ #include <zephyr/dt-bindings/led/led.h>
8
+
9
+ &spi3 {
10
+ /* Workaround to support WS2812 driver */
11
+ line-idle-low;
12
+
13
+ led_strip: ws2812@0 {
14
+ compatible = "worldsemi,ws2812-spi";
15
+
16
+ /* SPI */
17
+ reg = <0>; /* ignored, but necessary for SPI bindings */
18
+ spi-max-frequency = <6400000>;
19
+
20
+ /* WS2812 */
21
+ chain-length = <1>; /* arbitrary; change at will */
22
+ spi-cpha;
23
+ spi-one-frame = <0xf0>; /* 11110000: 625 ns high and 625 ns low */
24
+ spi-zero-frame = <0xc0>; /* 11000000: 312.5 ns high and 937.5 ns low */
25
+ color-mapping = <LED_COLOR_ID_GREEN
26
+ LED_COLOR_ID_RED
27
+ LED_COLOR_ID_BLUE>;
28
+ };
29
+ };
30
+
31
+ &pinctrl {
32
+ spim3_default: spim3_default {
33
+ group2 {
34
+ pinmux = <SPIM3_MOSI_GPIO18>;
35
+ };
36
+ };
37
+ };
38
+
39
+ / {
40
+ aliases {
41
+ led-strip = &led_strip;
42
+ };
43
+ };
Original file line number Diff line number Diff line change
1
+ CONFIG_WS2812_STRIP_SPI=y
2
+ CONFIG_SPI=y
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright (c) 2022 Espressif Systems (Shanghai) Co., Ltd.
3
+ *
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+
7
+ #include <zephyr/dt-bindings/led/led.h>
8
+
9
+ &spi3 {
10
+ /* Workaround to support WS2812 driver */
11
+ line-idle-low;
12
+
13
+ led_strip: ws2812@0 {
14
+ compatible = "worldsemi,ws2812-spi";
15
+
16
+ /* SPI */
17
+ reg = <0>; /* ignored, but necessary for SPI bindings */
18
+ spi-max-frequency = <6400000>;
19
+
20
+ /* WS2812 */
21
+ chain-length = <1>; /* arbitrary; change at will */
22
+ spi-cpha;
23
+ spi-one-frame = <0xf0>; /* 11110000: 625 ns high and 625 ns low */
24
+ spi-zero-frame = <0xc0>; /* 11000000: 312.5 ns high and 937.5 ns low */
25
+ color-mapping = <LED_COLOR_ID_GREEN
26
+ LED_COLOR_ID_RED
27
+ LED_COLOR_ID_BLUE>;
28
+ };
29
+ };
30
+
31
+ &pinctrl {
32
+ spim3_default: spim3_default {
33
+ group2 {
34
+ pinmux = <SPIM3_MOSI_GPIO48>;
35
+ };
36
+ };
37
+ };
38
+
39
+ / {
40
+ aliases {
41
+ led-strip = &led_strip;
42
+ };
43
+ };
You can’t perform that action at this time.
0 commit comments