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_OPENSMART Class Reference
Constructor for class for driving TM1651 controller as used in OPENSMART. More...
#include <TM1651.h>
Inherits TM1651.
Public Types | |
| enum | Icon { LD12 = ( 1<<24) | R12, LD3 = ( 1<<24) | Y3, LD4 = ( 1<<24) | Y4, LD5 = ( 1<<24) | Y5, LD67 = ( 1<<24) | G67, LD89 = ( 1<<24) | G89, LD10 = ( 1<<24) | B10 } |
Enums for Icons. More... | |
| enum | Level { LVL_0 = ( 1<<24) | R12, LVL_1 = ( 1<<24) | R12 | Y3, LVL_2 = ( 1<<24) | R12 | Y3 | Y4, LVL_3 = ( 1<<24) | R12 | Y3 | Y4 | Y5, LVL_4 = ( 1<<24) | R12 | Y3 | Y4 | Y5 | G67, LVL_5 = ( 1<<24) | R12 | Y3 | Y4 | Y5 | G67 | G89, LVL_0 = ( 1<<24) | R12, LVL_1 = ( 1<<24) | R12 | Y3, LVL_2 = ( 1<<24) | R12 | Y3 | Y4, LVL_3 = ( 1<<24) | R12 | Y3 | Y4 | Y5, LVL_4 = ( 1<<24) | R12 | Y3 | Y4 | Y5 | G67, LVL_5 = ( 1<<24) | R12 | Y3 | Y4 | Y5 | G67 | G89, LVL_6 = ( 1<<24) | R12 | Y3 | Y4 | Y5 | G67 | G89 | B10 } |
Enums for Batterylevels. More... | |
| typedef char | DisplayData_t [TM1651_DISPLAY_MEM] |
| Datatype for displaydata. | |
| typedef char | KeyData_t |
| Datatypes for keymatrix data. | |
Public Member Functions | |
| TM1651_OPENSMART (PinName dio, PinName clk) | |
| Constructor for class for driving TM1651 LED controller. | |
| void | cls () |
| Clear the screen and locate to 0. | |
| void | setIcon (Icon icon) |
| Set Icon. | |
| void | clrIcon (Icon icon) |
| Clr Icon. | |
| void | setLevel (Level level) |
| Set Level. | |
| void | writeData (char data, int address) |
| Write databyte to TM1651. | |
| void | writeData (DisplayData_t data, int length=(OPENSMART_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
Constructor for class for driving TM1651 controller as used in OPENSMART.
Supports battery display unit with 10 Segments.
- Parameters:
-
PinName dio Serial bus DIO pin PinName clk Serial bus CLK pin
Definition at line 292 of file TM1651.h.
Member Typedef Documentation
typedef char DisplayData_t[TM1651_DISPLAY_MEM] [inherited] |
typedef char KeyData_t [inherited] |
Member Enumeration Documentation
| enum Icon |
| enum Level |
Enums for Batterylevels.
- Enumerator:
Constructor & Destructor Documentation
| TM1651_OPENSMART | ( | PinName | dio, |
| PinName | clk | ||
| ) |
Constructor for class for driving TM1651 LED controller.
Supports battery display unit with 10 Segments. Serial bus interface device.
- Parameters:
-
PinName dio Serial bus DIO pin PinName sck Serial bus CLK pin
Supports battery display unit with 10 segments. Serial bus interface device.
- Parameters:
-
PinName dio Serial bus DIO pin PinName sck Serial bus CLK pin
Definition at line 313 of file TM1651.cpp.
Member Function Documentation
| void clrIcon | ( | Icon | icon ) |
Clr Icon.
- Parameters:
-
Icon icon Enums Icon has Grid position encoded in 8 MSBs, Pattern encoded in 16 LSBs
- Returns:
- none
Definition at line 353 of file TM1651.cpp.
| void cls | ( | ) |
Clear the screen and locate to 0.
- Parameters:
-
none
- Returns:
- none
Reimplemented from TM1651.
Definition at line 321 of file TM1651.cpp.
| bool getKeys | ( | KeyData_t * | keydata ) | [inherited] |
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 ) |
[inherited] |
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 ) | [inherited] |
| void setIcon | ( | Icon | icon ) |
Set Icon.
- Parameters:
-
Icon icon Enums Icon has Grid position encoded in 8 MSBs, Pattern encoded in 16 LSBs
- Returns:
- none
- Parameters:
-
Icon Icon Enums Icon has Grid position encoded in 8 MSBs, Pattern encoded in 16 LSBs
- Returns:
- none
Definition at line 336 of file TM1651.cpp.
| void setLevel | ( | Level | level ) |
Set Level.
- Parameters:
-
Level level Enums Level indicates the Battery level to be displayed
- Returns:
- none
Definition at line 371 of file TM1651.cpp.
| void writeData | ( | char | data, |
| int | address | ||
| ) |
| void writeData | ( | DisplayData_t | data, |
| int | length = (OPENSMART_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..(OPENSMART_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 from TM1651.
Generated on Mon Jul 25 2022 00:01:41 by
1.7.2
TM1651 LED controller (28 LEDs max), Keyboard scan (7 keys max)