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.
Dependents: mbed_TM1637 TM1637_test
TM1637_CATALEX Class Reference
Constructor for class for driving TM1637 controller as used in CATALEX. More...
#include <TM1637.h>
Inherits TM1637.
Public Types | |
enum | Icon { DP1 = ( 1<<24) | S7_DP1, DP2 = ( 2<<24) | S7_DP2, DP3 = ( 3<<24) | S7_DP3, DP4 = ( 4<<24) | S7_DP4, COL2 = ( 2<<24) | S7_DP2 } |
Enums for Icons. More... | |
typedef char | DisplayData_t [TM1637_DISPLAY_MEM] |
Datatype for displaydata. | |
typedef char | KeyData_t |
Datatypes for keymatrix data. | |
Public Member Functions | |
TM1637_CATALEX (PinName mosi_nc, PinName miso_dio, PinName sclk_clk) | |
Constructor for class for driving TM1637 LED controller as used in CATALEX. | |
TM1637_CATALEX (PinName dio, PinName clk) | |
Constructor for class for driving TM1637 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 TM1637. | |
void | writeData (DisplayData_t data, int length=(CATALEX_NR_GRIDS *TM1637_BYTES_PER_GRID), int address=0) |
Write Display datablock to TM1637. | |
void | cls () |
Clear the screen and locate to 0. | |
bool | getKeys (KeyData_t *keydata) |
Read keydata block from TM1637. | |
void | setBrightness (char brightness=TM1637_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 TM1637 controller as used in CATALEX.
Supports 4 Digits of 7 Segments + DP (or Colon for Digit2 on some models). Also Supports up to 16 Keys. Serial bus interface device.
- Parameters:
-
PinName mosi Serial bus MOSI pin PinName miso Serial bus MISO pin PinName sclk Serial bus SCLK pin
Definition at line 298 of file TM1637.h.
Member Typedef Documentation
typedef char DisplayData_t[TM1637_DISPLAY_MEM] [inherited] |
typedef char KeyData_t [inherited] |
Member Enumeration Documentation
enum Icon |
Constructor & Destructor Documentation
TM1637_CATALEX | ( | PinName | mosi_nc, |
PinName | miso_dio, | ||
PinName | sclk_clk | ||
) |
Constructor for class for driving TM1637 LED controller as used in CATALEX.
Supports 4 Digits of 7 Segments + DP (or Colon for Digit2 on some models). Also Supports up to 16 Keys. Serial bus interface device. DEPRECATED version
- Parameters:
-
PinName mosi_nc Serial bus NC pin PinName miso_dio Serial bus DIO pin PinName sclk_clk Serial bus CLK pin
Supports 4 Digits of 7 Segments + DP (or Colon for Digit2 on some models). DEPRECATED version
- Parameters:
-
PinName mosi_nc Serial bus NC pin PinName miso_dio Serial bus DIO pin PinName sclk_clk Serial bus CLK pin
Definition at line 345 of file TM1637.cpp.
TM1637_CATALEX | ( | PinName | dio, |
PinName | clk | ||
) |
Constructor for class for driving TM1637 LED controller.
Supports 4 Digits of 7 Segments + DP (or Colon for Digit2 on some models). Also Supports up to 16 Keys. Serial bus interface device.
- Parameters:
-
PinName dio Serial bus DIO pin PinName sck Serial bus CLK pin
Supports 4 Digits of 7 Segments + DP (or Colon for Digit2 on some models). Serial bus interface device.
- Parameters:
-
PinName dio Serial bus DIO pin PinName sck Serial bus CLK pin
Definition at line 359 of file TM1637.cpp.
Member Function Documentation
int _putc | ( | int | value ) | [protected, virtual] |
Write a single character (Stream implementation)
Definition at line 483 of file TM1637.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 450 of file TM1637.cpp.
void cls | ( | bool | clrAll = false ) |
Clear the screen and locate to 0.
- Parameters:
-
bool clrAll Clear Icons also (default = false)
Definition at line 407 of file TM1637.cpp.
void cls | ( | ) | [inherited] |
Clear the screen and locate to 0.
Definition at line 96 of file TM1637.cpp.
int columns | ( | ) |
Number of screen columns.
- Parameters:
-
none
- Returns:
- columns
Definition at line 399 of file TM1637.cpp.
bool getKeys | ( | KeyData_t * | keydata ) | [inherited] |
Read keydata block from TM1637.
- Parameters:
-
*keydata Ptr to bytes for keydata
- Returns:
- bool keypress True when at least one key was pressed
Definition at line 181 of file TM1637.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 385 of file TM1637.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 = TM1637_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 113 of file TM1637.cpp.
void setDisplay | ( | bool | on ) | [inherited] |
Set the Display mode On/off.
- Parameters:
-
bool display mode
Definition at line 124 of file TM1637.cpp.
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 432 of file TM1637.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 469 of file TM1637.cpp.
void writeData | ( | DisplayData_t | data, |
int | length = (CATALEX_NR_GRIDS * TM1637_BYTES_PER_GRID) , |
||
int | address = 0 |
||
) |
Write Display datablock to TM1637.
- Parameters:
-
DisplayData_t data Array of TM1637_DISPLAY_MEM (=4) bytes for displaydata length number bytes to write (valid range 0..(CATALEX_NR_GRIDS * TM1637_BYTES_PER_GRID) (=4), when starting at address 0) int address display memory location to write bytes (default = 0)
- Returns:
- none
Reimplemented from TM1637.
Generated on Wed Jul 13 2022 14:16:19 by
