16#ifndef ZEPHYR_INCLUDE_DRIVERS_LED_STRIP_H_
17#define ZEPHYR_INCLUDE_DRIVERS_LED_STRIP_H_
41#ifdef CONFIG_LED_STRIP_RGB_SCRATCH
117 if (api->
length != NULL) {
119 if (api->
length(dev) < num_pixels) {
124 return api->
update_rgb(dev, pixels, num_pixels);
size_t(* led_api_length)(const struct device *dev)
Callback API for getting length of an LED strip.
Definition led_strip.h:82
static int led_strip_update_rgb(const struct device *dev, struct led_rgb *pixels, size_t num_pixels)
Mandatory function to update an LED strip with the given RGB array.
Definition led_strip.h:107
static size_t led_strip_length(const struct device *dev)
Mandatory function to get chain length (in pixels) of an LED strip device.
Definition led_strip.h:163
static int led_strip_update_channels(const struct device *dev, uint8_t *channels, size_t num_channels)
Optional function to update an LED strip with the given channel array (each channel byte correspondin...
Definition led_strip.h:142
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:62
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:72
#define ENOSYS
Function not implemented.
Definition errno.h:82
#define ERANGE
Result too large.
Definition errno.h:72
Size of off_t must be equal or less than size of size_t
Definition retained_mem.h:28
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
Runtime device structure (in ROM) per driver instance.
Definition device.h:412
const void * api
Address of the API structure exposed by the device instance.
Definition device.h:418
Color value for a single RGB LED.
Definition led_strip.h:40
uint8_t r
Red channel.
Definition led_strip.h:49
uint8_t g
Green channel.
Definition led_strip.h:51
uint8_t b
Blue channel.
Definition led_strip.h:53
LED strip driver API.
Definition led_strip.h:89
led_api_length length
Definition led_strip.h:92
led_api_update_channels update_channels
Definition led_strip.h:91
led_api_update_rgb update_rgb
Definition led_strip.h:90