Tlc5940.h File Reference


Detailed Description

Tlc5940 library header file.

#include <stdint.h>
#include "tlc_config.h"

Go to the source code of this file.

Classes

class  Tlc5940
 The main Tlc5940 class for the entire library. More...

Defines

#define set_XLAT_interrupt()   TIFR1 |= _BV(TOV1); TIMSK1 = _BV(TOIE1)
 Enables the Timer1 Overflow interrupt, which will fire after an XLAT pulse.
#define clear_XLAT_interrupt()   TIMSK1 = 0
 Disables any Timer1 interrupts.
#define enable_XLAT_pulses()   TCCR1A = _BV(COM1A1) | _BV(COM1B1)
 Enables the output of XLAT pulses.
#define disable_XLAT_pulses()   TCCR1A = _BV(COM1B1)
 Disables the output of XLAT pulses.

Functions

void tlc_shift8_init (void)
 Initializes the SPI module to double speed (f_osc / 2).
void tlc_shift8 (uint8_t byte)
 Shifts out a byte, MSB first.
void tlc_dcModeStart (void)
 Switches to dot correction mode and clears any waiting grayscale latches.
void tlc_dcModeStop (void)
 Switches back to grayscale mode.

Variables

volatile uint8_t tlc_needXLAT
 This will be true (!= 0) if update was just called and the data has not been latched in yet.
volatile void(* tlc_onUpdateFinished )(void)
 Some of the extened library will need to be called after a successful update.
uint8_t tlc_GSData [NUM_TLCS *24]
 Packed grayscale data, 24 bytes (16 * 12 bits) per TLC.
Tlc5940 Tlc
 Preinstantiated Tlc variable.


Function Documentation

void tlc_dcModeStart ( void   ) 

Switches to dot correction mode and clears any waiting grayscale latches.

void tlc_dcModeStop ( void   ) 

Switches back to grayscale mode.


Variable Documentation

Preinstantiated Tlc variable.

uint8_t tlc_GSData[NUM_TLCS *24]

Packed grayscale data, 24 bytes (16 * 12 bits) per TLC.

Format: Lets assume we have 2 TLCs, A and B, daisy-chained with the SOUT of A going into the SIN of B.

  • byte 0: upper 8 bits of B.15
  • byte 1: lower 4 bits of B.15 and upper 4 bits of B.14
  • byte 2: lower 8 bits of B.0
  • ...
  • byte 24: upper 8 bits of A.15
  • byte 25: lower 4 bits of A.15 and upper 4 bits of A.14
  • ...
  • byte 47: lower 8 bits of A.0

Note:
Normally packing data like this is bad practice. But in this situation, shifting the data out is really fast because the format of the array is the same as the format of the TLC's serial interface.

volatile uint8_t tlc_needXLAT

This will be true (!= 0) if update was just called and the data has not been latched in yet.

volatile void(* tlc_onUpdateFinished)(void)

Some of the extened library will need to be called after a successful update.


Generated on Mon Feb 16 13:52:57 2009 for Arduino Tlc5940 Library by  doxygen 1.5.6