Booleans make sense for dimmers when accessed from a Sith application
that deals in absolutes.
Percent values are also a widespread interpretation of brightness
levels, and are thus supported as well.
The bit arithmetic makes sure that the arithmetic operation value / 100
* saul_pwm_resolution is done efficiently (by expression as a
multiplication followed by shifting) and accurately (by maximizing the
number of usable bits) while still being flexible both with respect to
integer sizes and to changes of saul_pwm_resolution.
Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>
In analogy to the existing GPIO mappings, this provides (write-only)
SAUL entries for PWM'd LEDs in a single-LED (as SAUL_ACT_DIMMER) and an
RGB (as SAUL_ACT_RGB_LED) mode.
Co-authored-by: Marian Buschsieweke <marian.buschsieweke@ovgu.de>