PropWare
C++ objects and CMake build system for Parallax Propeller
Home
Download
Getting Started
Documentation
Reference
About
Related Links
Namespace List
Class List
File List
Examples
Build System
File List
File Members
propsideworkspace
Learn
Simple Libraries
Light
libws2812
ws2812_open.c
Go to the documentation of this file.
1
14
#include <stdlib.h>
15
#include "
ws2812.h
"
16
17
ws2812_t
*
ws2812_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
(
ws2812_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
ws2812.h
ws2812_start
int ws2812_start(ws2812_t *state)
Start a driver for WS2812 chips.
Definition:
ws2812_start.c:16
ws2812_open
ws2812_t * ws2812_open(void)
Open a driver for WS2812 chips.
Definition:
ws2812_open.c:17
Generated on Sat Aug 27 2016 00:58:09 for PropWare by
1.8.12