|
void | initialize (uint16_t channels=0, uint8_t dots=63, bool writeCH=true, bool writeDC=true, bool enable=true) |
|
void | setChannel (uint16_t channel, uint16_t value) |
|
void | setAllChannels (uint16_t value) |
|
uint16_t | getChannel (uint16_t channel) |
|
void | setDotCorrection (uint16_t channel, uint8_t value) |
|
void | setAllDotCorrection (uint8_t value) |
|
uint8_t | getDotCorrection (uint16_t channel) |
|
void | writeChannels (bool flush=true) |
| transfer channel data to driver chip
|
|
void | writeDotCorrection (bool flush=true) |
| transfer dot correction data to driver chip
|
|
void | latch () |
| writes data from the input shift register to either GS or DC register.
|
|
void | enable () |
| sets the blank pin low
|
|
void | disable () |
| sets the blank pin high
|
|
bool | isError () |
|
uint8_t * | getGrayscaleData () |
|
uint8_t * | getDotCorrectionData () |
|
uint8_t * | getStatusData () |
|
bool | isEnabled () |
|
template<uint16_t CHANNELS, typename Spi, typename Xlat, typename Xblank = modm::platform::GpioUnused, typename Vprog = modm::platform::GpioUnused, typename Xerr = modm::platform::GpioUnused>
class modm::TLC594X< CHANNELS, Spi, Xlat, Xblank, Vprog, Xerr >
TLC594* multi-channel, daisy-chainable, constant-current sink, 12bit PWM LED driver.
This class does not use the DCPRG pin, as writing to the EEPROM requires 22V to be applied to Vprog, requiring additional external circuits. Use of any EEPROM functions is therefore not implemented here. Make sure that pin is connected to Vcc, otherwise Dot Correction does not work.
This driver can be used for the 16-channel TLC5940 and 24-channel TLC5947 and probably similar TLC59s as well, simply by adjusting the number of CHANNELS. Therefore this class can also be used with daisy-chained TLC59s, e.g. to control two TLC5940s set CHANNELS to 2*16.
WARNING
Each channel in the TLC594x chip drives a transistor using a feedback loop to make it meet a particular current requirement. If a channel is disconnected, the feedback loop will fully drive the transistor. If most of the channels are disconnected (quite common in a testing environment if not in production), this will end up pulling quite a bit of power from the chip's 3.3 or 5v supply. This can significantly heat up the chip and cause power supply issues.
- Template Parameters
-
CHANNELS | Number of channels must be multiples of 4, adjust for daisy-chained chips |
Spi | Spi interface |
Xlat | Level triggered latch pin |
Xblank | Level triggered blank pin, use modm::platform::GpioUnused if not connected |
Vprog | Vprog pin, use modm::platform::GpioUnused if not connected |
Xerr | Error pin, use modm::platform::GpioUnused if not connected |
- Author
- Niklas Hauser