RGB-LED driver

High-level driver for RGB-LEDs.

void rgbled_init(rgbled_t * led, pwm.h::pwm_t pwm, int channel_r, int channel_g, int channel_b)

Initialize the RGB LED by assigning PWM channels to colors.

Parameters

led:Struct identifying the LED
pwm:PWM device to drive the LED
channel_r:PWM channel connected to red
channel_g:PWM channel connected to green
channel_b:PWM channel connected to blue

void rgbled_set(const rgbled_t * led, color_rgb_t * color)

Set the RGB-LED to the given color value.

Parameters

led:Struct identifying the LED to set
color:Color to set the led to

struct rgbled_t

Descriptor struct for rgbleds.

pwm.h::pwm_t device

PWM device to use to control rgbleds.

int channel_r

set the R value in RGB

int channel_g

set the G value in RGB

int channel_b

set the B value in RGB