Skip to content

Commit

Permalink
boards: Add chain length and colour mapping to LED strips
Browse files Browse the repository at this point in the history
Adds chain length and colour mapping properties to LED strip devices
on boards where these parameters are now required

Signed-off-by: Jamie McCrae <spam@helper3000.net>
  • Loading branch information
thedjnK authored and henrikbrixandersen committed May 14, 2024
1 parent f4a3771 commit 8ca3999
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 0 deletions.
5 changes: 5 additions & 0 deletions boards/adafruit/itsybitsy/adafruit_itsybitsy_nrf52840.dts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <nordic/nrf52840_qiaa.dtsi>
#include "adafruit_itsybitsy_nrf52840-pinctrl.dtsi"
#include <zephyr/dt-bindings/input/input-event-codes.h>
#include <zephyr/dt-bindings/led/led.h>

/ {
model = "Adafruit ItsyBitsy nRF52840 Express";
Expand Down Expand Up @@ -107,6 +108,10 @@
compatible = "apa,apa102";
reg = <0>;
spi-max-frequency = <5250000>;
chain-length = <1>;
color-mapping = <LED_COLOR_ID_BLUE
LED_COLOR_ID_GREEN
LED_COLOR_ID_RED>;
};
};

Expand Down
5 changes: 5 additions & 0 deletions boards/adafruit/trinket_m0/adafruit_trinket_m0.dts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <atmel/samd21.dtsi>
#include <atmel/samx2xx18.dtsi>
#include "adafruit_trinket_m0-pinctrl.dtsi"
#include <zephyr/dt-bindings/led/led.h>

/ {
model = "Adafruit Trinket M0";
Expand Down Expand Up @@ -87,6 +88,10 @@
compatible = "apa,apa102";
reg = <0>;
spi-max-frequency = <24000000>;
chain-length = <1>;
color-mapping = <LED_COLOR_ID_BLUE
LED_COLOR_ID_GREEN
LED_COLOR_ID_RED>;
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <nordic/nrf52832_qfaa.dtsi>
#include "blueclover_plt_demo_v2_nrf52832-pinctrl.dtsi"
#include <zephyr/dt-bindings/input/input-event-codes.h>
#include <zephyr/dt-bindings/led/led.h>

/ {
model = "Blue Clover PLT Demo Board V2";
Expand Down Expand Up @@ -107,6 +108,10 @@
compatible = "apa,apa102";
reg = <0>;
spi-max-frequency = <5250000>;
chain-length = <4>;
color-mapping = <LED_COLOR_ID_BLUE
LED_COLOR_ID_GREEN
LED_COLOR_ID_RED>;
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/dt-bindings/led/led.h>

&spi2 {

lpd8806: lpd8806@0 {
compatible = "greeled,lpd8806";
reg = <0>;
spi-max-frequency = <2000000>;
chain-length = <1>;
color-mapping = <LED_COLOR_ID_RED
LED_COLOR_ID_GREEN
LED_COLOR_ID_BLUE>;
};
};

Expand Down
6 changes: 6 additions & 0 deletions samples/drivers/led_strip/boards/nucleo_l432kc.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@
* SPDX-License-Identifier: Apache-2.0
*/

#include <zephyr/dt-bindings/led/led.h>

&spi1 {

apa102: apa102@0 {
compatible = "apa,apa102";
reg = <0>;
spi-max-frequency = <5250000>;
chain-length = <1>;
color-mapping = <LED_COLOR_ID_BLUE
LED_COLOR_ID_GREEN
LED_COLOR_ID_RED>;
};
};

Expand Down
6 changes: 6 additions & 0 deletions tests/drivers/build_all/display/app.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
* (and be extended to test) real hardware.
*/

#include <zephyr/dt-bindings/led/led.h>

/ {
test {
#address-cells = <1>;
Expand Down Expand Up @@ -83,6 +85,10 @@
compatible = "greeled,lpd8806";
reg = <2>;
spi-max-frequency = <2000000>;
chain-length = <1>;
color-mapping = <LED_COLOR_ID_RED
LED_COLOR_ID_GREEN
LED_COLOR_ID_BLUE>;
};

test_led_strip_1: ws2812_spi@3 {
Expand Down

0 comments on commit 8ca3999

Please sign in to comment.