16-channel I2C constant current LED sink driver

Fork of TLC59116 by Sille Van Landschoot

Committer:
pilotak
Date:
Tue Aug 22 10:56:36 2017 +0000
Revision:
2:daabe2fe9b1d
Parent:
1:c285b2c57b2e
fix the mbed::NonCopyable thing

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sillevl 0:52a1996ad711 1 #pragma once
sillevl 0:52a1996ad711 2
sillevl 0:52a1996ad711 3 #include "mbed.h"
sillevl 0:52a1996ad711 4
sillevl 0:52a1996ad711 5 class TLC59116{
pilotak 2:daabe2fe9b1d 6 public:
sillevl 1:c285b2c57b2e 7
pilotak 2:daabe2fe9b1d 8 TLC59116(I2C &i2c_obj, int address);
sillevl 0:52a1996ad711 9 TLC59116(PinName sda, PinName scl, int address);
sillevl 0:52a1996ad711 10
sillevl 0:52a1996ad711 11 void setBrightness(float brightness);
sillevl 0:52a1996ad711 12 void setChannel(int channel, float brightness);
sillevl 0:52a1996ad711 13 void enable();
sillevl 0:52a1996ad711 14 void disable();
sillevl 0:52a1996ad711 15
sillevl 0:52a1996ad711 16 protected:
sillevl 0:52a1996ad711 17 int address;
pilotak 2:daabe2fe9b1d 18
sillevl 0:52a1996ad711 19
sillevl 1:c285b2c57b2e 20 void initialize();
sillevl 1:c285b2c57b2e 21
sillevl 0:52a1996ad711 22 void setOutputState(int ledout0, int ledout1, int ledout2, int ledout3);
sillevl 0:52a1996ad711 23
pilotak 2:daabe2fe9b1d 24 private:
pilotak 2:daabe2fe9b1d 25 I2C *i2c_p;
pilotak 2:daabe2fe9b1d 26 I2C &i2c;
sillevl 0:52a1996ad711 27 void setRegister(int reg, int value);
sillevl 0:52a1996ad711 28 void setRegisters(int reg, char* value, int length, int mode = AUTO_INCREMENT_ALL_REGISTERS);
sillevl 0:52a1996ad711 29
sillevl 0:52a1996ad711 30 static const int AUTO_INCREMENT_ALL_REGISTERS = 0x80;
sillevl 0:52a1996ad711 31 static const int AUTO_INCREMENT_BRIGHTNESS = 0xA0;
sillevl 0:52a1996ad711 32 static const int AUTO_INCREMENT_CONTROL = 0xC0;
sillevl 0:52a1996ad711 33 static const int AUTO_INCREMENT_BRIGHTNESS_CONTROL = 0xE0;
sillevl 0:52a1996ad711 34 static const int NO_AUTO_INCREMENT = 0x00;
sillevl 0:52a1996ad711 35
sillevl 0:52a1996ad711 36 static const int GRPPWM = 0x12;
sillevl 0:52a1996ad711 37 static const int LEDOUT0 = 0x014;
sillevl 0:52a1996ad711 38
sillevl 0:52a1996ad711 39
sillevl 0:52a1996ad711 40 };