sofle: update underglow for zephyr 3.2 &pinctrl
This commit is contained in:
parent
25c93628d2
commit
f82ddba11d
4 changed files with 168 additions and 104 deletions
|
@ -1,35 +1,51 @@
|
||||||
#include <dt-bindings/led/led.h>
|
#include <dt-bindings/led/led.h>
|
||||||
|
|
||||||
&spi1 {
|
&pinctrl {
|
||||||
compatible = "nordic,nrf-spim";
|
spi3_default: spi3_default {
|
||||||
status = "okay";
|
group1 {
|
||||||
mosi-pin = <6>;
|
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
|
||||||
// Unused pins, needed for SPI definition, but not used by the ws2812 driver itself.
|
};
|
||||||
sck-pin = <5>;
|
};
|
||||||
miso-pin = <7>;
|
|
||||||
|
|
||||||
led_strip: ws2812@0 {
|
spi3_sleep: spi3_sleep {
|
||||||
compatible = "worldsemi,ws2812-spi";
|
group1 {
|
||||||
label = "WS2812";
|
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
|
||||||
|
low-power-enable;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
/* SPI */
|
&spi3 {
|
||||||
reg = <0>; /* ignored, but necessary for SPI bindings */
|
compatible = "nordic,nrf-spim";
|
||||||
spi-max-frequency = <4000000>;
|
status = "okay";
|
||||||
|
|
||||||
/* WS2812 */
|
pinctrl-0 = <&spi3_default>;
|
||||||
chain-length = <29>; /* arbitrary; change at will */
|
pinctrl-1 = <&spi3_sleep>;
|
||||||
spi-one-frame = <0x70>;
|
pinctrl-names = "default", "sleep";
|
||||||
spi-zero-frame = <0x40>;
|
|
||||||
color-mapping = <
|
led_strip: ws2812@0 {
|
||||||
LED_COLOR_ID_GREEN
|
compatible = "worldsemi,ws2812-spi";
|
||||||
LED_COLOR_ID_RED
|
label = "WS2812";
|
||||||
LED_COLOR_ID_BLUE
|
|
||||||
>;
|
/* SPI */
|
||||||
};
|
reg = <0>; /* ignored, but necessary for SPI bindings */
|
||||||
|
spi-max-frequency = <4000000>;
|
||||||
|
|
||||||
|
/* WS2812 */
|
||||||
|
chain-length = <36>; /* arbitrary; change at will */
|
||||||
|
spi-one-frame = <0x70>;
|
||||||
|
spi-zero-frame = <0x40>;
|
||||||
|
|
||||||
|
color-mapping = <
|
||||||
|
LED_COLOR_ID_GREEN
|
||||||
|
LED_COLOR_ID_RED
|
||||||
|
LED_COLOR_ID_BLUE
|
||||||
|
>;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
/ {
|
/ {
|
||||||
chosen {
|
chosen {
|
||||||
zmk,underglow = &led_strip;
|
zmk,underglow = &led_strip;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,35 +1,51 @@
|
||||||
#include <dt-bindings/led/led.h>
|
#include <dt-bindings/led/led.h>
|
||||||
|
|
||||||
&spi1 {
|
&pinctrl {
|
||||||
compatible = "nordic,nrf-spim";
|
spi3_default: spi3_default {
|
||||||
status = "okay";
|
group1 {
|
||||||
mosi-pin = <6>;
|
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
|
||||||
// Unused pins, needed for SPI definition, but not used by the ws2812 driver itself.
|
};
|
||||||
sck-pin = <5>;
|
};
|
||||||
miso-pin = <7>;
|
|
||||||
|
|
||||||
led_strip: ws2812@0 {
|
spi3_sleep: spi3_sleep {
|
||||||
compatible = "worldsemi,ws2812-spi";
|
group1 {
|
||||||
label = "WS2812";
|
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
|
||||||
|
low-power-enable;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
/* SPI */
|
&spi3 {
|
||||||
reg = <0>; /* ignored, but necessary for SPI bindings */
|
compatible = "nordic,nrf-spim";
|
||||||
spi-max-frequency = <4000000>;
|
status = "okay";
|
||||||
|
|
||||||
/* WS2812 */
|
pinctrl-0 = <&spi3_default>;
|
||||||
chain-length = <29>; /* arbitrary; change at will */
|
pinctrl-1 = <&spi3_sleep>;
|
||||||
spi-one-frame = <0x70>;
|
pinctrl-names = "default", "sleep";
|
||||||
spi-zero-frame = <0x40>;
|
|
||||||
color-mapping = <
|
led_strip: ws2812@0 {
|
||||||
LED_COLOR_ID_GREEN
|
compatible = "worldsemi,ws2812-spi";
|
||||||
LED_COLOR_ID_RED
|
label = "WS2812";
|
||||||
LED_COLOR_ID_BLUE
|
|
||||||
>;
|
/* SPI */
|
||||||
};
|
reg = <0>; /* ignored, but necessary for SPI bindings */
|
||||||
|
spi-max-frequency = <4000000>;
|
||||||
|
|
||||||
|
/* WS2812 */
|
||||||
|
chain-length = <36>; /* arbitrary; change at will */
|
||||||
|
spi-one-frame = <0x70>;
|
||||||
|
spi-zero-frame = <0x40>;
|
||||||
|
|
||||||
|
color-mapping = <
|
||||||
|
LED_COLOR_ID_GREEN
|
||||||
|
LED_COLOR_ID_RED
|
||||||
|
LED_COLOR_ID_BLUE
|
||||||
|
>;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
/ {
|
/ {
|
||||||
chosen {
|
chosen {
|
||||||
zmk,underglow = &led_strip;
|
zmk,underglow = &led_strip;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,35 +1,51 @@
|
||||||
#include <dt-bindings/led/led.h>
|
#include <dt-bindings/led/led.h>
|
||||||
|
|
||||||
&spi1 {
|
&pinctrl {
|
||||||
compatible = "nordic,nrf-spim";
|
spi3_default: spi3_default {
|
||||||
status = "okay";
|
group1 {
|
||||||
mosi-pin = <6>;
|
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
|
||||||
// Unused pins, needed for SPI definition, but not used by the ws2812 driver itself.
|
};
|
||||||
sck-pin = <5>;
|
};
|
||||||
miso-pin = <7>;
|
|
||||||
|
|
||||||
led_strip: ws2812@0 {
|
spi3_sleep: spi3_sleep {
|
||||||
compatible = "worldsemi,ws2812-spi";
|
group1 {
|
||||||
label = "WS2812";
|
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
|
||||||
|
low-power-enable;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
/* SPI */
|
&spi3 {
|
||||||
reg = <0>; /* ignored, but necessary for SPI bindings */
|
compatible = "nordic,nrf-spim";
|
||||||
spi-max-frequency = <4000000>;
|
status = "okay";
|
||||||
|
|
||||||
/* WS2812 */
|
pinctrl-0 = <&spi3_default>;
|
||||||
chain-length = <29>; /* arbitrary; change at will */
|
pinctrl-1 = <&spi3_sleep>;
|
||||||
spi-one-frame = <0x70>;
|
pinctrl-names = "default", "sleep";
|
||||||
spi-zero-frame = <0x40>;
|
|
||||||
color-mapping = <
|
led_strip: ws2812@0 {
|
||||||
LED_COLOR_ID_GREEN
|
compatible = "worldsemi,ws2812-spi";
|
||||||
LED_COLOR_ID_RED
|
label = "WS2812";
|
||||||
LED_COLOR_ID_BLUE
|
|
||||||
>;
|
/* SPI */
|
||||||
};
|
reg = <0>; /* ignored, but necessary for SPI bindings */
|
||||||
|
spi-max-frequency = <4000000>;
|
||||||
|
|
||||||
|
/* WS2812 */
|
||||||
|
chain-length = <36>; /* arbitrary; change at will */
|
||||||
|
spi-one-frame = <0x70>;
|
||||||
|
spi-zero-frame = <0x40>;
|
||||||
|
|
||||||
|
color-mapping = <
|
||||||
|
LED_COLOR_ID_GREEN
|
||||||
|
LED_COLOR_ID_RED
|
||||||
|
LED_COLOR_ID_BLUE
|
||||||
|
>;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
/ {
|
/ {
|
||||||
chosen {
|
chosen {
|
||||||
zmk,underglow = &led_strip;
|
zmk,underglow = &led_strip;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,35 +1,51 @@
|
||||||
#include <dt-bindings/led/led.h>
|
#include <dt-bindings/led/led.h>
|
||||||
|
|
||||||
&spi1 {
|
&pinctrl {
|
||||||
compatible = "nordic,nrf-spim";
|
spi3_default: spi3_default {
|
||||||
status = "okay";
|
group1 {
|
||||||
mosi-pin = <6>;
|
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
|
||||||
// Unused pins, needed for SPI definition, but not used by the ws2812 driver itself.
|
};
|
||||||
sck-pin = <5>;
|
};
|
||||||
miso-pin = <7>;
|
|
||||||
|
|
||||||
led_strip: ws2812@0 {
|
spi3_sleep: spi3_sleep {
|
||||||
compatible = "worldsemi,ws2812-spi";
|
group1 {
|
||||||
label = "WS2812";
|
psels = <NRF_PSEL(SPIM_MOSI, 0, 6)>;
|
||||||
|
low-power-enable;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
/* SPI */
|
&spi3 {
|
||||||
reg = <0>; /* ignored, but necessary for SPI bindings */
|
compatible = "nordic,nrf-spim";
|
||||||
spi-max-frequency = <4000000>;
|
status = "okay";
|
||||||
|
|
||||||
/* WS2812 */
|
pinctrl-0 = <&spi3_default>;
|
||||||
chain-length = <29>; /* arbitrary; change at will */
|
pinctrl-1 = <&spi3_sleep>;
|
||||||
spi-one-frame = <0x70>;
|
pinctrl-names = "default", "sleep";
|
||||||
spi-zero-frame = <0x40>;
|
|
||||||
color-mapping = <
|
led_strip: ws2812@0 {
|
||||||
LED_COLOR_ID_GREEN
|
compatible = "worldsemi,ws2812-spi";
|
||||||
LED_COLOR_ID_RED
|
label = "WS2812";
|
||||||
LED_COLOR_ID_BLUE
|
|
||||||
>;
|
/* SPI */
|
||||||
};
|
reg = <0>; /* ignored, but necessary for SPI bindings */
|
||||||
|
spi-max-frequency = <4000000>;
|
||||||
|
|
||||||
|
/* WS2812 */
|
||||||
|
chain-length = <36>; /* arbitrary; change at will */
|
||||||
|
spi-one-frame = <0x70>;
|
||||||
|
spi-zero-frame = <0x40>;
|
||||||
|
|
||||||
|
color-mapping = <
|
||||||
|
LED_COLOR_ID_GREEN
|
||||||
|
LED_COLOR_ID_RED
|
||||||
|
LED_COLOR_ID_BLUE
|
||||||
|
>;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
/ {
|
/ {
|
||||||
chosen {
|
chosen {
|
||||||
zmk,underglow = &led_strip;
|
zmk,underglow = &led_strip;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue