Core Libary Functions


Detailed Description

These function are all prefixed with "Tlc.".


Modules

 Functions that Require VPRG_ENABLED
 Functions that require VPRG_ENABLED == 1.

Functions

void Tlc5940::init (uint16_t initialValue=0)
 Pin i/o and Timer setup.
void Tlc5940::clear (void)
 Clears the grayscale data array, tlc_GSData, but does not shift in any data.
uint8_t Tlc5940::update (void)
 Shifts in the data from the grayscale data array, tlc_GSData.
void Tlc5940::set (TLC_CHANNEL_TYPE channel, uint16_t value)
 Sets channel to value in the grayscale data array, tlc_GSData.
uint16_t Tlc5940::get (TLC_CHANNEL_TYPE channel)
 Gets the current grayscale value for a channel.
void Tlc5940::setAll (uint16_t value)
 Sets all channels to value.
void Tlc5940::setAllDC (uint8_t value)
 Sets the dot correction for all channels to value.
uint8_t Tlc5940::readXERR (void)
 Checks for shorted/broken LEDs reported by any of the TLCs.


Function Documentation

void Tlc5940::clear ( void   )  [inherited]

Clears the grayscale data array, tlc_GSData, but does not shift in any data.

This call should be followed by update() if you are turning off all the outputs.

uint16_t Tlc5940::get ( TLC_CHANNEL_TYPE  channel  )  [inherited]

Gets the current grayscale value for a channel.

Parameters:
channel (0 to NUM_TLCS * 16 - 1). OUT0 of the first TLC is channel 0, OUT0 of the next TLC is channel 16, etc.
Returns:
current grayscale value (0 - 4095) for channel
See also:
set

void Tlc5940::init ( uint16_t  initialValue = 0  )  [inherited]

Pin i/o and Timer setup.

The grayscale register will be reset to all zeros, or whatever initialValue is set to and the Timers will start.

Parameters:
initialValue = 0, optional parameter specifing the inital startup value

uint8_t Tlc5940::readXERR ( void   )  [inherited]

Checks for shorted/broken LEDs reported by any of the TLCs.

Returns:
1 if a TLC is reporting an error, 0 otherwise.

void Tlc5940::set ( TLC_CHANNEL_TYPE  channel,
uint16_t  value 
) [inherited]

Sets channel to value in the grayscale data array, tlc_GSData.

Parameters:
channel (0 to NUM_TLCS * 16 - 1). OUT0 of the first TLC is channel 0, OUT0 of the next TLC is channel 16, etc.
value (0-4095). The grayscale value, 4095 is maximum.
See also:
get

void Tlc5940::setAll ( uint16_t  value  )  [inherited]

Sets all channels to value.

Parameters:
value grayscale value (0 - 4095)

void Tlc5940::setAllDC ( uint8_t  value  )  [inherited]

Sets the dot correction for all channels to value.

The dot correction value correspondes to maximum output current by $\displaystyle I_{OUT_n} = I_{max} \times \frac{DCn}{63} $ where

  • $\displaystyle I_{max} = \frac{1.24V}{R_{IREF}} \times 31.5 = \frac{39.06}{R_{IREF}} $
  • DCn is the dot correction value for channel n
    Parameters:
    value (0-63)

uint8_t Tlc5940::update ( void   )  [inherited]

Shifts in the data from the grayscale data array, tlc_GSData.

If data has already been shifted in this grayscale cycle, another call to update() will immediately return 1 without shifting in the new data. To ensure that a call to update() does shift in new data, use

 while(Tlc.update()); 
or
 while(tlc_needXLAT); 
Returns:
1 if there is data waiting to be latched, 0 if data was successfully shifted in


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