Zephyr API Documentation  3.6.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
LED Strip Interface

LED Strip Interface. More...

Data Structures

struct  led_rgb
 Color value for a single RGB LED. More...
 
struct  led_strip_driver_api
 LED strip driver API. More...
 

Typedefs

typedef 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.
 
typedef 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.
 

Functions

static int led_strip_update_rgb (const struct device *dev, struct led_rgb *pixels, size_t num_pixels)
 Update an LED strip made of RGB pixels.
 
static int led_strip_update_channels (const struct device *dev, uint8_t *channels, size_t num_channels)
 Update an LED strip on a per-channel basis.
 

Detailed Description

LED Strip Interface.

Typedef Documentation

◆ led_api_update_channels

led_api_update_channels

#include <zephyr/drivers/led_strip.h>

Callback API for updating channels without an RGB interpretation.

See also
led_strip_update_channels() for argument descriptions.

◆ led_api_update_rgb

led_api_update_rgb

#include <zephyr/drivers/led_strip.h>

Callback API for updating an RGB LED strip.

See also
led_strip_update_rgb() for argument descriptions.

Function Documentation

◆ led_strip_update_channels()

static int led_strip_update_channels ( const struct device dev,
uint8_t channels,
size_t  num_channels 
)
inlinestatic

#include <zephyr/drivers/led_strip.h>

Update an LED strip on a per-channel basis.

Important: This routine may overwrite channels.

This routine immediately updates the strip display according to the given channels array. Each channel byte corresponds to an individually addressable color channel or LED. Channels are updated linearly in strip order.

Parameters
devLED strip device
channelsArray of per-channel data
num_channelsLength of channels array
Returns
0 on success, negative on error
Warning
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 <zephyr/drivers/led_strip.h>

Update an LED strip made of RGB pixels.

Important: This routine may overwrite pixels.

This routine immediately updates the strip display according to the given pixels array.

Parameters
devLED strip device
pixelsArray of pixel data
num_pixelsLength of pixels array
Returns
0 on success, negative on error
Warning
May overwrite pixels