Skip to content

Commit db55efa

Browse files
committed
dts: bindings: led: introduce leds-group-multicolor binding
The leds-group-multicolor binding allows to combines several monochromatic LEDs into one multi-color LED. Signed-off-by: Simon Guinot <simon.guinot@seagate.com>
1 parent 2f25c1f commit db55efa

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Copyright (c) 2025 Seagate Technology LLC
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
title: Combines several monochromatic LEDs into one multi-color LED.
5+
6+
description: |
7+
Here is an example that defines an RGB LED with a group of monochromatic
8+
PWM LEDs. Note that the pwms property definition handle depends on the PWM
9+
controller model. In this example, an STM32 PWM controller is assumed.
10+
11+
#include <zephyr/dt-bindings/led/led.h>
12+
13+
/ {
14+
monochromatic-leds {
15+
compatible = "pwm-leds";
16+
17+
red_pwm_led: led-0 {
18+
pwms = <&pwm1 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
19+
};
20+
21+
green_pwm_led: led-1 {
22+
pwms = <&pwm2 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
23+
};
24+
25+
blue_pwm_led: led-2 {
26+
pwms = <&pwm3 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
27+
};
28+
};
29+
30+
rgb-led {
31+
compatible = "leds-group-multicolor";
32+
33+
leds = <&red_pwm_led>, <&green_pwm_led>, <&blue_pwm_led>;
34+
color-mapping = <LED_COLOR_ID_RED>,
35+
<LED_COLOR_ID_GREEN>,
36+
<LED_COLOR_ID_BLUE>;
37+
};
38+
};
39+
40+
compatible: "leds-group-multicolor"
41+
42+
include: led-node.yaml
43+
44+
properties:
45+
leds:
46+
required: true
47+
type: phandles
48+
description: |
49+
References to monochromatic LED nodes.

0 commit comments

Comments
 (0)