Subversion Repositories Code-Repo

Rev

Blame | Last modification | View Log | RSS feed

#ifndef TLC59116_H
#define TLC59116_H

#define TLC59116_ADDR       0x60
#define TLC59116_ALLCALL    0x68

// Write to this register to reset chip
#define TLC59116_RESET  0x6B

// Increment all registers, rollover from 00000 to 11011
#define TLC59116_AUTO_INCR_ALL          0x80
// Increment brightness registers, rollover from 00010 to 10001
#define TLC59116_AUTO_INCR_BRIGHTNESS   0xA0
// Increment global control registers, rollover from 10010 to 10011
#define TLC59116_AUTO_INCR_GLBL_CTRL    0xC0
// Increment individual and global registers, rollover from 00010 to 10011
#define TLC59116_AUTO_INCR_INDV_CTRL    0xE0

#define TLC59116_REG_MODE1      0x00
#define TLC59116_REG_MODE2      0x01
#define TLC59116_REG_PWM0       0x02
#define TLC59116_REG_PWM1       0x03
#define TLC59116_REG_PWM2       0x04
#define TLC59116_REG_PWM3       0x05
#define TLC59116_REG_PWM4       0x06
#define TLC59116_REG_PWM5       0x07
#define TLC59116_REG_PWM6       0x08
#define TLC59116_REG_PWM7       0x09
#define TLC59116_REG_PWM8       0x0A
#define TLC59116_REG_PWM9       0x0B
#define TLC59116_REG_PWM10      0x0C
#define TLC59116_REG_PWM11      0x0D
#define TLC59116_REG_PWM12      0x0E
#define TLC59116_REG_PWM13      0x0F
#define TLC59116_REG_PWM14      0x10
#define TLC59116_REG_PWM15      0x11
#define TLC59116_REG_GRPPWM     0x12
#define TLC59116_REG_GRPFREQ    0x13
#define TLC59116_REG_LEDOUT0    0x14
#define TLC59116_REG_LEDOUT1    0x15
#define TLC59116_REG_LEDOUT2    0x16
#define TLC59116_REG_LEDOUT3    0x17
#define TLC59116_REG_SUBADR1    0x18
#define TLC59116_REG_SUBADR2    0x19
#define TLC59116_REG_SUBADR3    0x1A
#define TLC59116_REG_ALLCALLADR 0x1B
#define TLC59116_REG_IREF       0x1C
#define TLC59116_REG_EFLAG1     0x1D
#define TLC59116_REG_EFLAG2     0x1E

void TLC59116_Init(void);
void TLC59116_Write(uint8_t led, uint8_t brightness);
void TLC59116_Write_All(uint8_t *values);
void TLC59116_Write_BC(uint8_t brightness);

#endif  /* TLC59116_H */