rgbled.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Freie Universit├Ąt Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser General
5  * Public License v2.1. See the file LICENSE in the top level directory for more
6  * details.
7  */
8 
21 #ifndef RGBLED_H
22 #define RGBLED_H
23 
24 #include "color.h"
25 #include "periph/pwm.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
34 typedef struct {
36  int channel_r;
37  int channel_g;
38  int channel_b;
39 } rgbled_t;
40 
41 
51 void rgbled_init(rgbled_t *led, pwm_t pwm, int channel_r, int channel_g, int channel_b);
52 
59 void rgbled_set(rgbled_t *led, color_rgb_t *color);
60 
61 #ifdef __cplusplus
62 }
63 #endif
64 
65 #endif /* RGBLED_H */
66 
Low-level PWM peripheral driver interface definitions.
Descriptor struct for rgbleds.
Definition: rgbled.h:34
pwm_t device
PWM device to use to control rgbleds.
Definition: rgbled.h:35
int channel_g
set the G value in RGB
Definition: rgbled.h:37
int channel_b
set the B value in RGB
Definition: rgbled.h:38
Headers for the color handling module.
void rgbled_set(rgbled_t *led, color_rgb_t *color)
Set the RGB-LED to the given color value.
unsigned int pwm_t
Default PWM type definition.
Definition: pwm.h:97
Data-structure describing a RGB color.
Definition: color.h:35
int channel_r
set the R value in RGB
Definition: rgbled.h:36
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.