led: add a struct led_dt_spec and some _dt wrapper APIs
Add a struct led_dt_spec to hold an LED device and index pointer, some
initializer and wrapper APIs.
This allows simpler LED usage, such as:
static const struct led_dt_spec led = LED_DT_SPEC_GET(DT_NODELABEL(led0));
led_on_dt(&led);
led_off_dt(&led);
Signed-off-by:
Fabio Baltieri <fabiobaltieri@google.com>
Loading
Please sign in to comment