Wim Huiskamp / TM1640

Dependents:   mbed_TM1640

Embed: (wiki syntax)

« Back to documentation index

TM1640 Class Reference

TM1640 Class Reference

A class for driving TM1640 LED controller. More...

#include <TM1640.h>

Inherited by TM1640_LM1640.

Public Types

typedef char DisplayData_t [TM1640_DISPLAY_MEM]
 Datatype for displaydata.

Public Member Functions

 TM1640 (PinName mosi, PinName sclk)
 Constructor for class for driving TM1640 LED controller.
void cls ()
 Clear the screen and locate to 0.
void writeData (char data, int address)
 Write databyte to TM1640.
void writeData (DisplayData_t data, int length=(TM1640_MAX_NR_GRIDS *TM1640_BYTES_PER_GRID), int address=0)
 Write Display datablock to TM1640.
void setBrightness (char brightness=TM1640_BRT_DEF)
 Set Brightness.
void setDisplay (bool on)
 Set the Display mode On/off.

Detailed Description

A class for driving TM1640 LED controller.

Supports 16 Grids @ 8 Segments. Serial bus interface device.

Definition at line 105 of file TM1640.h.


Member Typedef Documentation

typedef char DisplayData_t[TM1640_DISPLAY_MEM]

Datatype for displaydata.

Definition at line 109 of file TM1640.h.


Constructor & Destructor Documentation

TM1640 ( PinName  mosi,
PinName  sclk 
)

Constructor for class for driving TM1640 LED controller.

Constructor for class for driving TM1640 LED controller with Serial bus interface device.

Supports 16 Grids @ 8 segments. Serial bus interface device.

Parameters:
PinNamemosi Serial bus MOSI pin
PinNamesclk Serial bus SCLK pin

Supports 16 digits @ 8 segments.

Parameters:
PinNamemosi Serial bus MOSI pin
PinNamesclk Serial bus SCLK pin

Definition at line 31 of file TM1640.cpp.


Member Function Documentation

void cls (  )

Clear the screen and locate to 0.

Definition at line 58 of file TM1640.cpp.

void setBrightness ( char  brightness = TM1640_BRT_DEF )

Set Brightness.

Parameters:
charbrightness (3 significant bits, valid range 0..7 (1/16 .. 14/14 dutycycle)
Returns:
none

Definition at line 75 of file TM1640.cpp.

void setDisplay ( bool  on )

Set the Display mode On/off.

Parameters:
booldisplay mode

Definition at line 86 of file TM1640.cpp.

void writeData ( DisplayData_t  data,
int  length = (TM1640_MAX_NR_GRIDS * TM1640_BYTES_PER_GRID),
int  address = 0 
)

Write Display datablock to TM1640.

Parameters:
DisplayData_tdata Array of TM1640_DISPLAY_MEM (=16) bytes for displaydata
lengthnumber bytes to write (valid range 0..(TM1640_MAX_NR_GRIDS * TM1640_BYTES_PER_GRID) (=16), when starting at address 0)
intaddress display memory location to write bytes (default = 0)
Returns:
none

Reimplemented in TM1640_LM1640.

Definition at line 119 of file TM1640.cpp.

void writeData ( char  data,
int  address 
)

Write databyte to TM1640.

Parameters:
chardata byte written at given address
intaddress display memory location to write byte
Returns:
none
Parameters:
intaddress display memory location to write byte
chardata byte written at given address
Returns:
none

Reimplemented in TM1640_LM1640.

Definition at line 103 of file TM1640.cpp.