Interfaces for LED strips.
More...
|
file | led_strip.h |
| Main header file for LED strip driver API.
|
|
|
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.
|
|
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 corresponding to an individually addressable color channel or LED.
|
|
static size_t | led_strip_length (const struct device *dev) |
| Mandatory function to get chain length (in pixels) of an LED strip device.
|
|
Interfaces for LED strips.
◆ led_api_length
◆ led_api_update_channels
◆ led_api_update_rgb
◆ led_strip_length()
#include <include/zephyr/drivers/led_strip.h>
Mandatory function to get chain length (in pixels) of an LED strip device.
- Parameters
-
- Return values
-
Length | of LED strip device. |
◆ led_strip_update_channels()
static int led_strip_update_channels |
( |
const struct device * |
dev, |
|
|
uint8_t * |
channels, |
|
|
size_t |
num_channels |
|
) |
| |
|
inlinestatic |
#include <include/zephyr/drivers/led_strip.h>
Optional function to update an LED strip with the given channel array (each channel byte corresponding to an individually addressable color channel or LED.
Channels are updated linearly in strip order.
- Parameters
-
dev | LED strip device. |
channels | Array of per-channel data. |
num_channels | Length of channels array. |
- Return values
-
0 | on success. |
-ENOSYS | if not implemented. |
-errno | negative errno code on other failure. |
- Warning
- This routine may overwrite channels.
◆ led_strip_update_rgb()
static int led_strip_update_rgb |
( |
const struct device * |
dev, |
|
|
struct led_rgb * |
pixels, |
|
|
size_t |
num_pixels |
|
) |
| |
|
inlinestatic |
#include <include/zephyr/drivers/led_strip.h>
Mandatory function to update an LED strip with the given RGB array.
- Parameters
-
dev | LED strip device. |
pixels | Array of pixel data. |
num_pixels | Length of pixels array. |
- Return values
-
0 | on success. |
-errno | negative errno code on failure. |
- Warning
- This routine may overwrite pixels.