samples: drivers led strip ws2812 overlay for stm32 nucleo

The spi node of the led_ws2812 now includes the frame format
as defined by the dts bindings spi-device.yaml
SPI_FRAME_FORMAT_TI is selected with overlay for target boards.

Signed-off-by: Francois Ramu <francois.ramu@st.com>
This commit is contained in:
Francois Ramu 2021-12-02 18:29:24 +01:00 committed by Anas Nashif
commit ff34965a0a
3 changed files with 35 additions and 0 deletions

View file

@ -19,6 +19,7 @@
/* SPI */
reg = <0>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <B1414_SPI_FREQ>;
frame-format = <32768>; /* SPI_FRAME_FORMAT_TI */
/* B1414 */
chain-length = <18>; /* arbitrary; change at will */

View file

@ -0,0 +1,33 @@
/*
* Copyright (c) 2021, STMicroelectronics
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <dt-bindings/led/led.h>
&arduino_spi {
led_strip: ws2812@0 {
compatible = "worldsemi,ws2812-spi";
label = "WS2812";
/* SPI */
reg = <0>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;
frame-format = <32768>; /* SPI_FRAME_FORMAT_TI */
/* WS2812 */
chain-length = <16>; /* 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>;
};
};
/ {
aliases {
led-strip = &led_strip;
};
};

View file

@ -14,6 +14,7 @@
/* SPI */
reg = <0>; /* ignored, but necessary for SPI bindings */
spi-max-frequency = <4000000>;
frame-format = <32768>; /* SPI_FRAME_FORMAT_TI */
/* WS2812 */
chain-length = <16>; /* arbitrary; change at will */