Open
Description
Is your enhancement proposal related to a problem? Please describe.
Some LED drivers, e.g. LED PWM, supports a higher granularity than the current 0-100 range.
Increase the supported range to allow adjusting the light level with a finer granularity.
This is useful for delicate devices that needs a constant and precise lumen output from an LED.
Describe the solution you'd like
- Increase
led_set_brightness
'svalue
type touint16_t
to allow using full granularity for all LED drivers. Maybe evenuint32_t
.
Return an errno if the value is above maximum supported.
or
- To prevent modifying a lot of the LED code base it might be worth adding a new optional API function that allows full range and keep the existing
led_set_brightness
. This also allows having a brightness function that is simple to use from an application point of view. Function name and prototype suggestion:
int led_set_brightness_raw(const struct device *dev, uint32_t led, uint32_t value)
Describe alternatives you've considered
Using DAC or PWM API directly to control an LED device.
Additional context
Discord discussion:
https://discord.com/channels/720317445772017664/1352646386113314846