boards: stm32wb5mmg_dk: add RGB LED support

This patch add RGB LED support for the TI
TLC59731 RGB controller.

Signed-off-by: Javad Rahimipetroudi <javad.rahimipetroudi@mind.be>
This commit is contained in:
Javad Rahimipetroudi 2024-02-06 10:44:04 +01:00 committed by Anas Nashif
commit c46466e48a
2 changed files with 30 additions and 0 deletions

View file

@ -170,6 +170,14 @@ Serial Port
STM32WB5MM-DK board has 2 (LP)U(S)ARTs. The Zephyr console output is assigned to USART1.
Default settings are ``115200 8N1``.
LEDs
----
STM32WB5MM-DK has two types of LEDs, The resources coming from STM32WB5MMG are
shared between the RGB and IR LEDs. It is not possible to use them
simultaneously. The selection is done by JP4 and JP5 jumpers.
To use the RGB LED, JP5 must be ON and JP4 OFF. In this configuration,
GPIO_SELECT2 (PH1) is the chip select for this RGB device on SPI1.
Programming and Debugging
*************************

View file

@ -8,6 +8,7 @@
#include <st/wb/stm32wb55Xg.dtsi>
#include <st/wb/stm32wb55vgyx-pinctrl.dtsi>
#include <zephyr/dt-bindings/input/input-event-codes.h>
#include <zephyr/dt-bindings/led/led.h>
/ {
model = "STMicroelectronics STM32WB5MM Discovery Development Kit";
@ -22,11 +23,23 @@
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
};
rgb_led_strip: rgb_strip {
compatible = "ti,tlc59731";
gpios = <&gpioa 7 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>;
chain-length = <1>;
color-mapping = <LED_COLOR_ID_BLUE
LED_COLOR_ID_GREEN
LED_COLOR_ID_RED>;
status = "disabled";
};
aliases {
watchdog0 = &iwdg;
die-temp0 = &die_temp;
volt-sensor0 = &vref;
volt-sensor1 = &vbat;
led-strip = &rgb_led_strip;
};
};
@ -136,6 +149,15 @@ zephyr_udc0: &usb {
};
};
&gpioh {
rgb_cs: rgb_cs {
gpios = <1 GPIO_ACTIVE_HIGH>;
gpio-hog;
output-high;
status = "disabled";
};
};
&vref {
status = "okay";
};