Skip to content

Commit 3d31f14

Browse files
author
Javad Rahimipetroudi
committed
boards: stm32wb5mmg_dk: add RGB LED support
This patch add RGB LED support for the TI TLC59731 RGB controller. Signed-off-by: Javad Rahimipetroudi <[email protected]>
1 parent 2b33c47 commit 3d31f14

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

boards/st/stm32wb5mm_dk/doc/stm32wb5mm_dk.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,14 @@ Serial Port
170170
STM32WB5MM-DK board has 2 (LP)U(S)ARTs. The Zephyr console output is assigned to USART1.
171171
Default settings are ``115200 8N1``.
172172

173+
LEDs
174+
----
175+
STM32WB5MM-DK has two types of LEDs, The resources coming from STM32WB5MMG are
176+
shared between the RGB and IR LEDs. It is not possible to use them
177+
simultaneously. The selection is done by JP4 and JP5 jumpers.
178+
To use the RGB LED, JP5 must be ON and JP4 OFF. In this configuration,
179+
GPIO_SELECT2 (PH1) is the chip select for this RGB device on SPI1.
180+
173181

174182
Programming and Debugging
175183
*************************

boards/st/stm32wb5mm_dk/stm32wb5mm_dk.dts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <st/wb/stm32wb55Xg.dtsi>
99
#include <st/wb/stm32wb55vgyx-pinctrl.dtsi>
1010
#include <zephyr/dt-bindings/input/input-event-codes.h>
11+
#include <zephyr/dt-bindings/led/led.h>
1112

1213
/ {
1314
model = "STMicroelectronics STM32WB5MM Discovery Development Kit";
@@ -22,11 +23,23 @@
2223
zephyr,flash = &flash0;
2324
zephyr,code-partition = &slot0_partition;
2425
};
26+
27+
rgb_led_strip: rgb_strip {
28+
compatible = "ti,tlc59731";
29+
gpios = <&gpioa 7 (GPIO_PULL_DOWN | GPIO_ACTIVE_HIGH)>;
30+
chain-length = <1>;
31+
color-mapping = <LED_COLOR_ID_BLUE
32+
LED_COLOR_ID_GREEN
33+
LED_COLOR_ID_RED>;
34+
status = "disabled";
35+
};
36+
2537
aliases {
2638
watchdog0 = &iwdg;
2739
die-temp0 = &die_temp;
2840
volt-sensor0 = &vref;
2941
volt-sensor1 = &vbat;
42+
led-strip = &rgb_led_strip;
3043
};
3144
};
3245

@@ -136,6 +149,15 @@ zephyr_udc0: &usb {
136149
};
137150
};
138151

152+
&gpioh {
153+
rgb_cs: rgb_cs {
154+
gpios = <1 GPIO_ACTIVE_HIGH>;
155+
gpio-hog;
156+
output-high;
157+
status = "disabled";
158+
};
159+
};
160+
139161
&vref {
140162
status = "okay";
141163
};

0 commit comments

Comments
 (0)