aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeon Rinkel <[email protected]>2023-11-01 19:39:12 +0100
committerLeon Rinkel <[email protected]>2023-11-01 19:39:12 +0100
commit7b00a083dcceebb4c7a4efe023716498888e8ae3 (patch)
treea24ead567198ec5bf20853141738cef226ecce84
parentb84f9691faf564e112481698c0bf02860b8b9359 (diff)
Improve timing for SK6812-typed LEDs
-rw-r--r--boards/arm/lumen/lumen-pinctrl.dtsi4
-rw-r--r--boards/arm/lumen/lumen.dts18
2 files changed, 13 insertions, 9 deletions
diff --git a/boards/arm/lumen/lumen-pinctrl.dtsi b/boards/arm/lumen/lumen-pinctrl.dtsi
index 09bd517..39870c8 100644
--- a/boards/arm/lumen/lumen-pinctrl.dtsi
+++ b/boards/arm/lumen/lumen-pinctrl.dtsi
@@ -5,14 +5,14 @@
*/
&pinctrl {
- spi0_default: spi0_default {
+ spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 31)>,
<NRF_PSEL(SPIM_MOSI, 0, 6)>,
<NRF_PSEL(SPIM_MISO, 0, 2)>;
};
};
- spi0_sleep: spi0_sleep {
+ spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 31)>,
<NRF_PSEL(SPIM_MOSI, 0, 6)>,
diff --git a/boards/arm/lumen/lumen.dts b/boards/arm/lumen/lumen.dts
index a87f717..020201b 100644
--- a/boards/arm/lumen/lumen.dts
+++ b/boards/arm/lumen/lumen.dts
@@ -29,23 +29,27 @@
status = "okay";
};
-&spi0 {
+&spi3 {
compatible = "nordic,nrf-spim";
status = "okay";
- pinctrl-0 = <&spi0_default>;
- pinctrl-1 = <&spi0_sleep>;
+ pinctrl-0 = <&spi3_default>;
+ pinctrl-1 = <&spi3_sleep>;
pinctrl-names = "default", "sleep";
led_strip: ws2812@0 {
compatible = "worldsemi,ws2812-spi";
reg = <0>;
- spi-max-frequency = <4000000>;
chain-length = <30>;
+
+ /* Timing for SK6812-type LEDs */
+ spi-max-frequency = <6000000>; /* 1 / 6MHz = 167ns */
+ spi-one-frame = <0xF0>; /* 167ns * 4 = 0.668us */
+ spi-zero-frame = <0xC0>; /* 167ns * 2 = 0.334us */
+
color-mapping = <LED_COLOR_ID_GREEN
LED_COLOR_ID_RED
- LED_COLOR_ID_BLUE>;
- spi-one-frame = <0x70>;
- spi-zero-frame = <0x60>;
+ LED_COLOR_ID_BLUE
+ LED_COLOR_ID_WHITE>;
};
};