Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
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] |
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:
-
PinName dio Serial bus DIO pin PinName sck Serial bus CLK pin
Supports 4 digits @ 7 segments and 7 Keys.
- Parameters:
-
PinName dio Serial bus DIO pin PinName clk 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:
-
*keydata Ptr 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:
-
char brightness (3 significant bits, valid range 0..7 (1/16 .. 14/16 dutycycle)
- Returns:
- none
- Parameters:
-
char brightness (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 ) |
| void writeData | ( | char | data, |
| int | address | ||
| ) |
Write databyte to TM1651.
- Parameters:
-
char data byte written at given address int address display memory location to write byte
- Returns:
- none
- Parameters:
-
int address display memory location to write byte char data 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_t data Array of TM1651_DISPLAY_MEM (=4) bytes for displaydata length number bytes to write (valid range 0..(TM1651_MAX_NR_GRIDS * TM1651_BYTES_PER_GRID) (=4), when starting at address 0) int address display memory location to write bytes (default = 0)
- Returns:
- none
Reimplemented in TM1651_OPENSMART.
Definition at line 127 of file TM1651.cpp.
Generated on Mon Jul 25 2022 00:01:41 by
1.7.2
TM1651 LED controller (28 LEDs max), Keyboard scan (7 keys max)