17#ifndef ZEPHYR_INCLUDE_DRIVERS_LED_STRIP_H_
18#define ZEPHYR_INCLUDE_DRIVERS_LED_STRIP_H_
49#ifdef CONFIG_LED_STRIP_RGB_SCRATCH
136 if (api->
length != NULL) {
138 if (api->
length(dev) < num_pixels) {
143 return api->
update_rgb(dev, pixels, num_pixels);
#define DEVICE_API_GET(_class, _dev)
Expands to the pointer of a device's API for a given class.
Definition device.h:1449
size_t(* led_api_length)(const struct device *dev)
Callback API for getting length of an LED strip.
Definition led_strip.h:92
int(* led_api_update_rgb)(const struct device *dev, struct led_rgb *pixels, size_t num_pixels)
Callback API for updating an RGB LED strip.
Definition led_strip.h:74
int(* led_api_update_channels)(const struct device *dev, uint8_t *channels, size_t num_channels)
Callback API for updating channels without an RGB interpretation.
Definition led_strip.h:83
static int led_strip_update_rgb(const struct device *dev, struct led_rgb *pixels, size_t num_pixels)
Update an LED strip with the given RGB array.
Definition led_strip.h:127
static size_t led_strip_length(const struct device *dev)
Get chain length (in pixels) of an LED strip device.
Definition led_strip.h:181
static int led_strip_update_channels(const struct device *dev, uint8_t *channels, size_t num_channels)
Update an LED strip with the given channel array.
Definition led_strip.h:161
#define ENOSYS
Function not implemented.
Definition errno.h:83
#define ERANGE
Result too large.
Definition errno.h:73
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
Runtime device structure (in ROM) per driver instance.
Definition device.h:513
Color value for a single RGB LED.
Definition led_strip.h:48
uint8_t r
Red channel.
Definition led_strip.h:57
uint8_t g
Green channel.
Definition led_strip.h:59
uint8_t b
Blue channel.
Definition led_strip.h:61
<span class="mlabel">Driver Operations</span> LED Strip driver operations
Definition led_strip.h:97
led_api_length length
<span class="op-badge op-req" title="This operation MUST be implemented by the driver....
Definition led_strip.h:105
led_api_update_channels update_channels
<span class="op-badge op-opt" title="This operation MAY optionally be implemented by the driver....
Definition led_strip.h:109
led_api_update_rgb update_rgb
<span class="op-badge op-req" title="This operation MUST be implemented by the driver....
Definition led_strip.h:101