leds-group-multicolor
Description
Combines several monochromatic LEDs into one multi-color LED.
Defines an RGB LED with a group of monochromatic PWM LEDs. Note that the
pwms property definition handle depends on the PWM controller model.
Examples
/* Example where PWM controller is STM32 */
#include <zephyr/dt-bindings/led/led.h>
/ {
monochromatic-leds {
compatible = "pwm-leds";
red_pwm_led: led-0 {
pwms = <&pwm1 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
};
green_pwm_led: led-1 {
pwms = <&pwm2 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
};
blue_pwm_led: led-2 {
pwms = <&pwm3 1 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
};
};
rgb-led {
compatible = "leds-group-multicolor";
leds = <&red_pwm_led>, <&green_pwm_led>, <&blue_pwm_led>;
color-mapping = <LED_COLOR_ID_RED>,
<LED_COLOR_ID_GREEN>,
<LED_COLOR_ID_BLUE>;
};
};
Properties
Properties not inherited from the base binding file.
Name |
Type |
Details |
|---|---|---|
|
|
References to monochromatic LED nodes.
This property is required. |
|
|
Channel to color mapping of a multicolor LED. If a LED supports
several colors, then the color-mapping property can be used to
describe how the hardware channels and the colors are mapped.
For example the channel to color mapping of RGB LEDs would be
color-mapping =
<LED_COLOR_ID_RED>,
<LED_COLOR_ID_GREEN>,
<LED_COLOR_ID_BLUE>;
|
Deprecated properties not inherited from the base binding file.
(None)
Properties inherited from the base binding file, which defines common properties that may be set on many nodes. Not all of these may apply to the “leds-group-multicolor” compatible.
Name |
Type |
Details |
|---|---|---|
|
|
Human readable string describing the LED. It can be used by an
application to identify this LED or to retrieve its number/index
(i.e. child node number) on the parent device.
See Important properties for more information. |