diff options
Diffstat (limited to 'include/rgb_led.h')
| -rw-r--r-- | include/rgb_led.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/include/rgb_led.h b/include/rgb_led.h new file mode 100644 index 0000000..66eaddc --- /dev/null +++ b/include/rgb_led.h @@ -0,0 +1,25 @@ +typedef struct { + bool R; + bool G; + bool B; +} rgb_color; + +#define rgb_white (rgb_color){ .R = 0, .G = 0, .B = 0 } +#define rgb_yellow (rgb_color){ .R = 0, .G = 0, .B = 1 } +#define rgb_purple (rgb_color){ .R = 0, .G = 1, .B = 0 } +#define rgb_red (rgb_color){ .R = 0, .G = 1, .B = 1 } +#define rgb_cyan (rgb_color){ .R = 1, .G = 0, .B = 0 } +#define rgb_green (rgb_color){ .R = 1, .G = 0, .B = 1 } +#define rgb_blue (rgb_color){ .R = 1, .G = 1, .B = 0 } +#define rgb_black (rgb_color){ .R = 1, .G = 1, .B = 1 } + +typedef struct { + rgb_color color; + int R_pin; + int G_pin; + int B_pin; +} rgb_led; + +void rgb_init_LED(rgb_led *LED, int R_pin, int G_pin, int B_pin); + +void rgb_set_color(rgb_led *LED, rgb_color color); |
