apa102.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 Freie Universität Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
21 #ifndef APA102_H
22 #define APA102_H
23 
24 #include "color.h"
25 #include "periph/gpio.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
34 typedef struct {
35  int led_numof;
36  gpio_t data_pin;
37  gpio_t clk_pin;
39 
44 
54 void apa102_init(apa102_t *dev, const apa102_params_t *params);
55 
65 void apa102_load_rgba(const apa102_t *dev, const color_rgba_t vals[]);
66 
67 #ifdef __cplusplus
68 }
69 #endif
70 
71 #endif /* APA102_H */
Headers for the color handling module.
Low-level GPIO peripheral driver interface definitions.
apa102_params_t apa102_t
Device descriptor definition for APA102 LEDs.
Definition: apa102.h:43
void apa102_load_rgba(const apa102_t *dev, const color_rgba_t vals[])
Apply the given color values to the connected LED(s)
void apa102_init(apa102_t *dev, const apa102_params_t *params)
Initialize (chained) APA102 LEDs.
Configuration parameters for (chained) APA102 LEDs.
Definition: apa102.h:34
gpio_t data_pin
data pin
Definition: apa102.h:36
gpio_t clk_pin
clock pin
Definition: apa102.h:37
int led_numof
number of chained LEDs
Definition: apa102.h:35
RGBA color value.
Definition: color.h:44