Library for TM1650 LED controller (32 LEDs max, 28 keys max)

Dependents:   mbed_TM1650

Embed: (wiki syntax)

« Back to documentation index

TM1650_MEIBAI Class Reference

Constructor for class for driving TM1650 controller as used in MEIBAI. More...

#include <TM1650.h>

Inherits TM1650.

Public Types

enum  Icon { DP1 = ( 1<<24) | S7_DP1, DP2 = ( 2<<24) | S7_DP2, DP3 = ( 3<<24) | S7_DP3, DP4 = ( 4<<24) | S7_DP4 }
 

Enums for Icons.

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

Public Member Functions

 TM1650_MEIBAI (PinName dio, PinName clk)
 Constructor for class for driving TM1650 LED controller.
int putc (int c)
 Write a character to the Display.
int printf (const char *format,...)
 Write a formatted string to the Display.
void locate (int column)
 Locate cursor to a screen column.
void cls (bool clrAll=false)
 Clear the screen and locate to 0.
void setIcon (Icon icon)
 Set Icon.
void clrIcon (Icon icon)
 Clr Icon.
void setUDC (unsigned char udc_idx, int udc_data)
 Set User Defined Characters (UDC)
int columns ()
 Number of screen columns.
void writeData (char data, int address)
 Write databyte to TM1650.
void writeData (DisplayData_t data, int length=(MEIBAI_NR_GRIDS *TM1650_BYTES_PER_GRID), int address=0)
 Write Display datablock to TM1650.
void cls ()
 Clear the screen and locate to 0.
bool getKeys (KeyData_t *keydata)
 Read keydata block from TM1650.
void setBrightness (char brightness=TM1650_BRT_DEF)
 Set Brightness.
void setDisplay (bool on)
 Set the Display mode On/off.

Protected Member Functions

virtual int _putc (int value)
 Write a single character (Stream implementation)
virtual int _getc ()
 Get a single character (Stream implementation)

Detailed Description

Constructor for class for driving TM1650 controller as used in MEIBAI.

Supports 4 Digits of 7 Segments + DP. Also Supports 3 Keys. Serial bus interface device.

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

Definition at line 294 of file TM1650.h.


Member Typedef Documentation

typedef char DisplayData_t[TM1650_DISPLAY_MEM] [inherited]

Datatype for displaydata.

Definition at line 173 of file TM1650.h.

typedef char KeyData_t [inherited]

Datatypes for keymatrix data.

Definition at line 176 of file TM1650.h.


Member Enumeration Documentation

enum Icon

Enums for Icons.

Enumerator:
DP1 

Digit 1.

DP2 

Digit 2.

DP3 

Digit 3.

DP4 

Digit 4.

Definition at line 299 of file TM1650.h.


Constructor & Destructor Documentation

TM1650_MEIBAI ( PinName  dio,
PinName  clk 
)

Constructor for class for driving TM1650 LED controller.

Supports 4 Digits of 7 Segments + DP. Also Supports 3 Keys. Serial bus interface device.

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

Supports 4 Digits of 7 Segments + DP. Also supports 3 keys. Serial bus interface device.

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

Definition at line 304 of file TM1650.cpp.


Member Function Documentation

int _getc (  ) [protected, virtual]

Get a single character (Stream implementation)

Parameters:
none
Returns:
-1

Definition at line 538 of file TM1650.cpp.

int _putc ( int  value ) [protected, virtual]

Write a single character (Stream implementation)

Parameters:
cThe character to write to the display
Returns:
c

Definition at line 436 of file TM1650.cpp.

void clrIcon ( Icon  icon )

Clr Icon.

Parameters:
Iconicon Enums Icon has Grid position encoded in 8 MSBs, Icon pattern encoded in 16 LSBs
Returns:
none

Definition at line 399 of file TM1650.cpp.

void cls ( bool  clrAll = false )

Clear the screen and locate to 0.

Parameters:
boolclrAll Clear Icons also (default = false)
Returns:
none

Definition at line 356 of file TM1650.cpp.

void cls (  ) [inherited]

Clear the screen and locate to 0.

Definition at line 64 of file TM1650.cpp.

int columns (  )

Number of screen columns.

Parameters:
none
Returns:
columns

Definition at line 346 of file TM1650.cpp.

bool getKeys ( KeyData_t keydata ) [inherited]

Read keydata block from TM1650.

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

Definition at line 143 of file TM1650.cpp.

void locate ( int  column )

Locate cursor to a screen column.

Parameters:
columnThe horizontal position from the left, indexed from 0
Returns:
none

Definition at line 332 of file TM1650.cpp.

int printf ( const char *  format,
  ... 
)

Write a formatted string to the Display.

Parameters:
formatA printf-style format string, followed by the variables to use in formatting the string.
Returns:
chars written
int putc ( int  c )

Write a character to the Display.

Parameters:
cThe character to write to the display
Returns:
c
void setBrightness ( char  brightness = TM1650_BRT_DEF ) [inherited]

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 80 of file TM1650.cpp.

void setDisplay ( bool  on ) [inherited]

Set the Display mode On/off.

Parameters:
booldisplay mode
Returns:
none
Parameters:
booldisplay mode

Definition at line 91 of file TM1650.cpp.

void setIcon ( Icon  icon )

Set Icon.

Parameters:
Iconicon Enums Icon has Grid position encoded in 8 MSBs, Icon pattern encoded in 16 LSBs
Returns:
none

Definition at line 381 of file TM1650.cpp.

void setUDC ( unsigned char  udc_idx,
int  udc_data 
)

Set User Defined Characters (UDC)

Parameters:
unsignedchar udc_idx The Index of the UDC (0..7)
intudc_data The bitpattern for the UDC (16 bits)
Returns:
none
Parameters:
unsignedchar udc_idx The Index of the UDC (0..7)
intudc_data The bitpattern for the UDC (8 bits)
Returns:
none

Definition at line 419 of file TM1650.cpp.

void writeData ( DisplayData_t  data,
int  length = (MEIBAI_NR_GRIDS * TM1650_BYTES_PER_GRID),
int  address = 0 
)

Write Display datablock to TM1650.

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

Reimplemented from TM1650.

Definition at line 395 of file TM1650.h.

void writeData ( char  data,
int  address 
)

Write databyte to TM1650.

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

Reimplemented from TM1650.

Definition at line 385 of file TM1650.h.