forked from adafruit/Adafruit_TLC59711
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Adafruit_TLC59711.h
51 lines (34 loc) · 1.31 KB
/
Adafruit_TLC59711.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
47
48
49
50
51
/***************************************************
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/1455
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_TLC59711_H
#define _ADAFRUIT_TLC59711_H
#include <Arduino.h>
#include <SPI.h>
class Adafruit_TLC59711 {
public:
Adafruit_TLC59711(uint8_t n, uint8_t c, uint8_t d);
Adafruit_TLC59711(uint8_t n, SPIClass *spidev = &SPI);
boolean begin(void);
void setPWM(uint8_t chan, uint16_t pwm);
void setLED(uint8_t lednum, uint16_t r, uint16_t g, uint16_t b);
void write(void);
void spiwriteMSB(uint32_t d);
void setBrightness(uint8_t rgb);
void setBrightness(uint8_t r, uint8_t g, uint8_t b);
private:
SPIClass *spidev;
uint16_t *pwmbuffer;
uint8_t BCr, BCg, BCb;
int8_t numdrivers, _clk, _dat;
};
#endif