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>
This commit is contained in:
Simon Guinot 2024-03-22 11:22:19 +01:00 committed by Anas Nashif
parent dab7699fe0
commit b97dcef8ce

View File

@ -0,0 +1,49 @@
# Copyright (c) 2025 Seagate Technology LLC
# SPDX-License-Identifier: Apache-2.0
title: Combines several monochromatic LEDs into one multi-color LED.
description: |
Here is an example that defines an RGB LED with a group of monochromatic
PWM LEDs. Note that the pwms property definition handle depends on the PWM
controller model. In this example, an STM32 PWM controller is assumed.
#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>;
};
};
compatible: "leds-group-multicolor"
include: led-node.yaml
properties:
leds:
required: true
type: phandles
description: |
References to monochromatic LED nodes.