-
Notifications
You must be signed in to change notification settings - Fork 0
/
light_ws2812.h
45 lines (35 loc) · 1.49 KB
/
light_ws2812.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* light weight WS2812 lib
*
* Created: 07.04.2013 15:58:05 - v0.1
* 06.05.2013 - v0.3 - clean up
* 27.05.2013 - v0.6 - clean up, removed RC variants, added mask
* 08.08.2013 - v0.9 - 20 Mhz version added
* Author: Tim ([email protected])
*/
#include <avr/io.h>
#ifndef LIGHT_WS2812_H_
#define LIGHT_WS2812_H_
// Call with address to led color array (order is Green-Red-Blue)
// Numer of bytes to be transmitted is leds*3
void ws2812_sendarray(uint8_t *ledarray,uint16_t length);
void ws2812_sendarray_mask(uint8_t *ledarray,uint16_t length, uint8_t mask);
///////////////////////////////////////////////////////////////////////
// User defined area: Define I/O pin
///////////////////////////////////////////////////////////////////////
#define ws2812_port PORTB // Data port register
#define ws2812_pin 0 // Number of the data out pin
///////////////////////////////////////////////////////////////////////
// User defined area: Define CPU clock speed
// Uncomment one and only one #define matching your application
///////////////////////////////////////////////////////////////////////
// #define ws2812_4MHz
// #define ws2812_8MHz
// #define ws2812_9p6MHz
// #define ws2812_12MHz // Warning: Untested in v0.6
#define ws2812_16MHz
// #define ws2812_20MHz
///////////////////////////////////////////////////////////////////////
// End user defined area
///////////////////////////////////////////////////////////////////////
#endif /* LIGHT_WS2812_H_ */