PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Simple-Libraries
Learn
Simple Libraries
Light
libws2812
ws2812b_open.c
Go to the documentation of this file.
1
14
#include <stdlib.h>
15
#include "
ws2812.h
"
16
17
ws2812_t
*
ws2812b_open
(
void
)
18
{
19
ws2812_t
*state;
20
21
// allocate a driver state structure
22
if
(!(state = (
ws2812_t
*)malloc(
sizeof
(
ws2812_t
))))
23
return
NULL;
24
25
// start the driver
26
if
(
ws2812b_start
(state) < 0) {
27
free(state);
28
return
NULL;
29
}
30
31
// return the driver state
32
return
state;
33
}
34
ws2812_t
Definition:
ws2812.h:53
ws2812b_start
int ws2812b_start(ws2812_t *driver)
Start a driver for WS2812B chips.
Definition:
ws2812b_start.c:16
ws2812.h
Driver for WS2812 and WS2812B RGB LEDs.
ws2812b_open
ws2812_t * ws2812b_open(void)
Open a driver for WS2812B chips.
Definition:
ws2812b_open.c:17
Generated on Fri May 20 2022 16:48:04 for PropWare by
1.8.17