Library for TM1640 LED controller Initial version
TM1640_LM1640 Class Reference
Constructor for class for driving TM1640 controller as used in LM1640. More...
#include <TM1640.h>
Inherits TM1640.
Public Types | |
enum | Icon { DP1 = ( 1<<24) | S7_DP1, DP2 = ( 2<<24) | S7_DP2, DP3 = ( 3<<24) | S7_DP3, DP4 = ( 4<<24) | S7_DP4, DP5 = ( 5<<24) | S7_DP5, DP6 = ( 6<<24) | S7_DP6, DP7 = ( 7<<24) | S7_DP7, DP8 = ( 8<<24) | S7_DP8, DP9 = ( 9<<24) | S7_DP9, DP10 = (10<<24) | S7_DP10, DP11 = (11<<24) | S7_DP11, DP12 = (12<<24) | S7_DP12, DP13 = (13<<24) | S7_DP13, DP14 = (14<<24) | S7_DP14, DP15 = (15<<24) | S7_DP15, DP16 = (16<<24) | S7_DP16 } |
Enums for Icons. More... | |
typedef char | DisplayData_t [TM1640_DISPLAY_MEM] |
Datatype for displaydata. | |
Public Member Functions | |
TM1640_LM1640 (PinName mosi, PinName sclk) | |
Constructor for class for driving TM1640 LED controller as used in LM1640. | |
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 TM1640. | |
void | writeData (DisplayData_t data, int length=(LM1640_NR_GRIDS *TM1640_BYTES_PER_GRID), int address=0) |
Write Display datablock to TM1640. | |
void | cls () |
Clear the screen and locate to 0. | |
void | setBrightness (char brightness=TM1640_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) |
Detailed Description
Constructor for class for driving TM1640 controller as used in LM1640.
Supports 16 Digits of 7 Segments + DP.
- Parameters:
-
PinName mosi Serial bus MOSI pin PinName sclk Serial bus SCLK pin
Definition at line 210 of file TM1640.h.
Member Typedef Documentation
typedef char DisplayData_t[TM1640_DISPLAY_MEM] [inherited] |
Member Enumeration Documentation
enum Icon |
Enums for Icons.
- Enumerator:
Constructor & Destructor Documentation
TM1640_LM1640 | ( | PinName | mosi, |
PinName | sclk | ||
) |
Constructor for class for driving TM1640 LED controller as used in LM1640.
Supports 16 Digits of 7 Segments + DP.
- Parameters:
-
PinName mosi Serial bus MOSI pin PinName sclk Serial bus SCLK pin
Supports 8 Digits of 7 Segments + DP.
- Parameters:
-
PinName mosi Serial bus MOSI pin PinName sclk Serial bus SCLK pin
Definition at line 215 of file TM1640.cpp.
Member Function Documentation
int _putc | ( | int | value ) | [protected, virtual] |
Write a single character (Stream implementation)
Definition at line 339 of file TM1640.cpp.
void clrIcon | ( | Icon | icon ) |
Clr Icon.
- Parameters:
-
Icon icon Enums Icon has Grid position encoded in 8 MSBs, Icon pattern encoded in 16 LSBs
- Returns:
- none
Definition at line 306 of file TM1640.cpp.
void cls | ( | bool | clrAll = false ) |
Clear the screen and locate to 0.
- Parameters:
-
bool clrAll Clear Icons also (default = false)
Definition at line 263 of file TM1640.cpp.
void cls | ( | ) | [inherited] |
Clear the screen and locate to 0.
Definition at line 58 of file TM1640.cpp.
int columns | ( | ) |
Number of screen columns.
- Parameters:
-
none
- Returns:
- columns
Definition at line 255 of file TM1640.cpp.
void locate | ( | int | column ) |
Locate cursor to a screen column.
- Parameters:
-
column The horizontal position from the left, indexed from 0
Definition at line 241 of file TM1640.cpp.
int printf | ( | const char * | format, |
... | |||
) |
Write a formatted string to the Display.
- Parameters:
-
format A printf-style format string, followed by the variables to use in formatting the string.
int putc | ( | int | c ) |
Write a character to the Display.
- Parameters:
-
c The character to write to the display
void setBrightness | ( | char | brightness = TM1640_BRT_DEF ) |
[inherited] |
Set Brightness.
- Parameters:
-
char brightness (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 ) | [inherited] |
void setIcon | ( | Icon | icon ) |
Set Icon.
- Parameters:
-
Icon icon Enums Icon has Grid position encoded in 8 MSBs, Icon pattern encoded in 16 LSBs
- Returns:
- none
Definition at line 288 of file TM1640.cpp.
void setUDC | ( | unsigned char | udc_idx, |
int | udc_data | ||
) |
Set User Defined Characters (UDC)
- Parameters:
-
unsigned char udc_idx The Index of the UDC (0..7) int udc_data The bitpattern for the UDC (16 bits) unsigned char udc_idx The Index of the UDC (0..7) int udc_data The bitpattern for the UDC (8 bits)
Definition at line 325 of file TM1640.cpp.
void writeData | ( | char | data, |
int | address | ||
) |
void writeData | ( | DisplayData_t | data, |
int | length = (LM1640_NR_GRIDS * TM1640_BYTES_PER_GRID) , |
||
int | address = 0 |
||
) |
Write Display datablock to TM1640.
- Parameters:
-
DisplayData_t data Array of TM1640_DISPLAY_MEM (=16) bytes for displaydata length number bytes to write (valid range 0..(LM1640_NR_GRIDS * TM1640_BYTES_PER_GRID) (=16), when starting at address 0) int address display memory location to write bytes (default = 0)
- Returns:
- none
Reimplemented from TM1640.
Generated on Wed Jul 13 2022 03:36:07 by 1.7.2