1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

4 Commits

Author SHA1 Message Date
Marian Buschsieweke
16f859dafd
drivers/saul: use const qualifier for data to write
This makes life easier when calling e.g. `saul_reg_write()` with data
stored in flash.

As now the signatures for reading and writing differ (in that `const`
qualifier only), `saul_notsup()` is split into `saul_write_notsup()`
and `saul_read_notsup()`. However, one is implemented as a symbol alias
of the other, so that ROM consumption remains unchanged.
2022-05-23 08:35:27 +02:00
chrysn
1b7cd3d142 drivers/saul/auto_init: Err on out-of-range input 2020-11-05 19:01:17 +01:00
chrysn
4687504936 drivers/saul/auto_init: Support bool and percent for dimmers
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>
2020-10-17 11:20:30 +02:00
chrysn
d196c7c4a6 drivers/saul/auto_init: Add PWM for LEDs
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>
2020-10-17 11:20:17 +02:00