forked from adafruit/Adafruit_TLC5947
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAdafruit_TLC5947.h
46 lines (31 loc) · 1.2 KB
/
Adafruit_TLC5947.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
46
/***************************************************
This is a library for our Adafruit 24-channel PWM/LED driver
Pick one up today in the adafruit shop!
------> http://www.adafruit.com/products/1429
These drivers uses SPI to communicate, 3 pins are required to
interface: Data, Clock and Latch. The boards are chainable
Adafruit invests time and resources providing this open source code,
please support Adafruit and open-source hardware by purchasing
products from Adafruit!
Written by Limor Fried/Ladyada for Adafruit Industries.
BSD license, all text above must be included in any redistribution
****************************************************/
#ifndef _ADAFRUIT_TLC5947_H
#define _ADAFRUIT_TLC5947_H
#include <Arduino.h>
class Adafruit_TLC5947 {
public:
Adafruit_TLC5947();
void init(uint16_t n, uint8_t c, uint8_t d, uint8_t l, uint8_t b);
void init(uint16_t n, uint8_t l, uint8_t b);
boolean begin(void);
void setPWM(uint16_t chan, uint16_t pwm);
void setLED(uint16_t lednum, uint16_t r, uint16_t g, uint16_t b);
void write(void);
void spiwriteMSB(uint32_t d);
private:
uint16_t *pwmbuffer;
uint16_t numdrivers;
int8_t _clk, _dat, _lat, _blank;
};
#endif