Loading...
Searching...
No Matches

High-level driver for RGB-LEDs. More...

Detailed Description

High-level driver for RGB-LEDs.

Files

file  rgbled.h
 High-level driver for easy handling of RGB-LEDs.
 

Data Structures

struct  rgbled_t
 Descriptor struct for rgbleds. More...
 

Functions

void rgbled_init (rgbled_t *led, pwm_t pwm, int channel_r, int channel_g, int channel_b)
 Initialize the RGB LED by assigning PWM channels to colors.
 
void rgbled_set (const rgbled_t *led, color_rgb_t *color)
 Set the RGB-LED to the given color value.
 

Function Documentation

◆ rgbled_init()

void rgbled_init ( rgbled_t led,
pwm_t  pwm,
int  channel_r,
int  channel_g,
int  channel_b 
)

Initialize the RGB LED by assigning PWM channels to colors.

Parameters
[in]ledStruct identifying the LED
[in]pwmPWM device to drive the LED
[in]channel_rPWM channel connected to red
[in]channel_gPWM channel connected to green
[in]channel_bPWM channel connected to blue

◆ rgbled_set()

void rgbled_set ( const rgbled_t led,
color_rgb_t color 
)

Set the RGB-LED to the given color value.

Parameters
[in]ledStruct identifying the LED to set
[in]colorColor to set the led to