Wim Huiskamp / TM1651

Dependents:   mbed_TM1651

Embed: (wiki syntax)

« Back to documentation index

TM1651 Class Reference

TM1651 Class Reference

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

#include <TM1651.h>

Inherited by TM1651_OPENSMART.

Public Types

typedef char DisplayData_t [TM1651_DISPLAY_MEM]
 Datatype for displaydata.
typedef char KeyData_t
 Datatypes for keymatrix data.

Public Member Functions

 TM1651 (PinName dio, PinName clk)
 Constructor for class for driving TM1651 LED controller.
void cls ()
 Clear the screen and locate to 0.
void writeData (char data, int address)
 Write databyte to TM1651.
void writeData (DisplayData_t data, int length=(TM1651_MAX_NR_GRIDS *TM1651_BYTES_PER_GRID), int address=0)
 Write Display datablock to TM1651.
bool getKeys (KeyData_t *keydata)
 Read keydata block from TM1651.
void setBrightness (char brightness=TM1651_BRT_DEF)
 Set Brightness.
void setDisplay (bool on)
 Set the Display mode On/off.

Detailed Description

A class for driving TM1651 LED controller.

Supports 4 Grids @ 7 Segments and 7 Keys. Serial bus interface device.

Definition at line 162 of file TM1651.h.


Member Typedef Documentation

typedef char DisplayData_t[TM1651_DISPLAY_MEM]

Datatype for displaydata.

Definition at line 166 of file TM1651.h.

typedef char KeyData_t

Datatypes for keymatrix data.

Definition at line 169 of file TM1651.h.


Constructor & Destructor Documentation

TM1651 ( PinName  dio,
PinName  clk 
)

Constructor for class for driving TM1651 LED controller.

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

Supports 4 Grids @ 7 segments and 7 Keys. Serial bus interface device.

Parameters:
PinNamedio Serial bus DIO pin
PinNamesck Serial bus CLK pin

Supports 4 digits @ 7 segments and 7 Keys.

Parameters:
PinNamedio Serial bus DIO pin
PinNameclk Serial bus CLK pin

Definition at line 32 of file TM1651.cpp.


Member Function Documentation

void cls (  )

Clear the screen and locate to 0.

Reimplemented in TM1651_OPENSMART.

Definition at line 66 of file TM1651.cpp.

bool getKeys ( KeyData_t keydata )

Read keydata block from TM1651.

Parameters:
*keydataPtr to bytes for keydata
Returns:
bool keypress True when at least one key was pressed

Definition at line 151 of file TM1651.cpp.

void setBrightness ( char  brightness = TM1651_BRT_DEF )

Set Brightness.

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

Definition at line 83 of file TM1651.cpp.

void setDisplay ( bool  on )

Set the Display mode On/off.

Parameters:
booldisplay mode

Definition at line 94 of file TM1651.cpp.

void writeData ( char  data,
int  address 
)

Write databyte to TM1651.

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 TM1651_OPENSMART.

Definition at line 111 of file TM1651.cpp.

void writeData ( DisplayData_t  data,
int  length = (TM1651_MAX_NR_GRIDS * TM1651_BYTES_PER_GRID),
int  address = 0 
)

Write Display datablock to TM1651.

Parameters:
DisplayData_tdata Array of TM1651_DISPLAY_MEM (=4) bytes for displaydata
lengthnumber bytes to write (valid range 0..(TM1651_MAX_NR_GRIDS * TM1651_BYTES_PER_GRID) (=4), when starting at address 0)
intaddress display memory location to write bytes (default = 0)
Returns:
none

Reimplemented in TM1651_OPENSMART.

Definition at line 127 of file TM1651.cpp.