dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pios_ws2811.h
Go to the documentation of this file.
1 
13 /*
14  * This program is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by
16  * the Free Software Foundation; either version 3 of the License, or
17  * (at your option) any later version.
18  *
19  * This program is distributed in the hope that it will be useful, but
20  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
21  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  * for more details.
23  *
24  * You should have received a copy of the GNU General Public License along
25  * with this program; if not, see <http://www.gnu.org/licenses/>
26  *
27  * Additional note on redistribution: The copyright and license notices above
28  * must be maintained in each individual source file that is a derivative work
29  * of this source file; otherwise redistribution is prohibited.
30  */
31 
32 #ifndef _PIOS_WS2811_H
33 #define _PIOS_WS2811_H
34 
35 #include <pios_ws2811_cfg.h>
36 
37 typedef struct ws2811_dev_s *ws2811_dev_t;
38 
46 int PIOS_WS2811_init(ws2811_dev_t *dev_out,
47  const struct pios_ws2811_cfg *cfg, int max_leds);
48 
53 void PIOS_WS2811_trigger_update(ws2811_dev_t dev);
54 
63 void PIOS_WS2811_set(ws2811_dev_t dev, int idx, uint8_t r, uint8_t g,
64  uint8_t b);
65 
73 void PIOS_WS2811_set_all(ws2811_dev_t dev, uint8_t r, uint8_t g,
74  uint8_t b);
75 
80 void PIOS_WS2811_dma_interrupt_handler(ws2811_dev_t dev);
81 
87 int PIOS_WS2811_get_num_leds(ws2811_dev_t dev);
88 
94 #endif /*_PIOS_WS2811_H */
int PIOS_WS2811_get_num_leds(ws2811_dev_t dev)
Find out how many LEDs are configured on an interface.
Definition: pios_ws2811.c:227
struct ws2811_dev_s * ws2811_dev_t
Definition: pios_ws2811.h:37
int PIOS_WS2811_init(ws2811_dev_t *dev_out, const struct pios_ws2811_cfg *cfg, int max_leds)
Allocate and initialise WS2811 device.
Definition: pios_ws2811.c:64
static struct flyingpicmd_cfg_fa cfg
Definition: main.c:49
void PIOS_WS2811_set_all(ws2811_dev_t dev, uint8_t r, uint8_t g, uint8_t b)
Sets all LEDs to a color value.
Definition: pios_ws2811.c:219
void PIOS_WS2811_set(ws2811_dev_t dev, int idx, uint8_t r, uint8_t g, uint8_t b)
Set a given LED to a color value.
Definition: pios_ws2811.c:176
void PIOS_WS2811_dma_interrupt_handler(ws2811_dev_t dev)
Handles a DMA completion interrupt on bit_clear_dma_stream.
void PIOS_WS2811_trigger_update(ws2811_dev_t dev)
Trigger an update of the LED strand.
Definition: pios_ws2811.c:197