drivers: led: support variable brightness granularity #87737
Labels
area: LED
Label to identify LED subsystem
Enhancement
Changes/Updates/Additions to existing features
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
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
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
The text was updated successfully, but these errors were encountered: