![]() |
Display_Lib_RPI 2.3.0
A C++ Library to connect electronic displays to Linux single board computers.
|
Class for Model 1. More...
#include <TM1638plus_Model1_RDL.hpp>
Public Member Functions | |
TM1638plus_Model1 (uint8_t strobe, uint8_t clock, uint8_t data, int gpioDev) | |
Constructor for class TM1638plus_Model1. | |
uint8_t | readButtons (void) |
Read buttons values from display. | |
rdlib::Return_Codes_e | displayText (const char *text) |
Display a text string on display. | |
void | displayASCII (uint8_t position, uint8_t ascii) |
Display an ASCII character on display. | |
void | displayASCIIwDot (uint8_t position, uint8_t ascii) |
Display an ASCII character with decimal point turned on. | |
void | displayHex (uint8_t position, uint8_t hex) |
Send Hexadecimal value to seven segment. | |
void | display7Seg (uint8_t position, uint8_t value) |
Send seven segment value to seven segment. | |
void | displayIntNum (unsigned long number, AlignTextType_e=TMAlignTextLeft) |
Display an integer and leading zeros optional. | |
void | DisplayDecNumNibble (uint16_t numberUpper, uint16_t numberLower, AlignTextType_e=TMAlignTextLeft) |
Display an integer in a nibble (4 digits on display) | |
virtual void | setLEDs (uint16_t leds) |
Set all LED's on or off Model 1 & 3. | |
virtual rdlib::Return_Codes_e | setLED (uint8_t position, uint8_t value) |
Set one LED on or off Model 1 & 3. | |
![]() | |
TM1638plus_common (uint8_t strobe, uint8_t clock, uint8_t data, int gpioDev) | |
Constructor for class TM1638plus_common. | |
void | reset (void) |
Reset / clear the display. | |
rdlib::Return_Codes_e | displayBegin (void) |
Begin method , sets pin modes and activate display. | |
void | brightness (uint8_t brightness) |
Sets the brightness level of segments in display on a scale of brightness. | |
uint16_t | TMCommDelayGet (void) |
get the TM comm delay. | |
void | TMCommDelayset (uint16_t) |
set the TM comm delay. | |
rdlib::Return_Codes_e | displayClose (void) |
Close method , frees GPIO and deactivate display. | |
Additional Inherited Members | |
![]() | |
enum | AlignTextType_e : uint8_t { TMAlignTextRight = 1 , TMAlignTextLeft = 2 , TMAlignTextZeros = 3 } |
enum | TMOffsetsMasks : uint8_t { TM_ASCII_OFFSET = 0x20 , TM_HEX_OFFSET = 0x10 , TM_DOT_MASK_DEC = 0x80 , TM_BRIGHT_MASK = 0x07 } |
![]() | |
enum | TMCommands : uint8_t { TM_ACTIVATE = 0x8F , TM_BUTTONS_MODE = 0x42 , TM_WRITE_LOC = 0x44 , TM_WRITE_INC = 0x40 , TM_SEG_ADR = 0xC0 , TM_LEDS_ADR = 0xC1 , TM_BRIGHT_ADR = 0x88 } |
![]() | |
void | sendCommand (uint8_t value) |
Send command to display. | |
void | sendData (uint8_t data) |
Send Data to display. | |
uint8_t | HighFreqshiftin (void) |
Shifts in a byte of data from the Tm1638 SPI-like bus. | |
void | HighFreqshiftOut (uint8_t val) |
Shifts out a byte of data on to the Tm1638 SPI-like bus. | |
![]() | |
uint8_t | _Display_CS |
uint8_t | _Display_SDATA |
uint8_t | _Display_SCLK |
const uint8_t | _TMDisplaySize = 8 |
int | _DeviceNumGpioChip = 0 |
int | _GpioHandle = 0 |
Class for Model 1.
TM1638plus_Model1::TM1638plus_Model1 | ( | uint8_t | strobe, |
uint8_t | clock, | ||
uint8_t | data, | ||
int | gpioDev | ||
) |
Constructor for class TM1638plus_Model1.
strobe | GPIO STB pin |
clock | GPIO CLK pin |
data | GPIO DIO pin |
gpioDev | The device number of a gpiochip. |
void TM1638plus_Model1::display7Seg | ( | uint8_t | position, |
uint8_t | value | ||
) |
Send seven segment value to seven segment.
position | The position on display 0-7 |
value | byte of data corresponding to segments (dp)gfedcba |
void TM1638plus_Model1::displayASCII | ( | uint8_t | position, |
uint8_t | ascii | ||
) |
Display an ASCII character on display.
position | The position on display 0-7 |
ascii | The ASCII value from font table to display |
void TM1638plus_Model1::displayASCIIwDot | ( | uint8_t | position, |
uint8_t | ascii | ||
) |
Display an ASCII character with decimal point turned on.
position | The position on display 0-7 |
ascii | The ASCII value from font table to display |
void TM1638plus_Model1::DisplayDecNumNibble | ( | uint16_t | numberUpper, |
uint16_t | numberLower, | ||
AlignTextType_e | TextAlignment = TMAlignTextLeft |
||
) |
Display an integer in a nibble (4 digits on display)
numberUpper | upper nibble integer 2^16 |
numberLower | lower nibble integer 2^16 |
TextAlignment | left or right alignment or leading zeros |
void TM1638plus_Model1::displayHex | ( | uint8_t | position, |
uint8_t | hex | ||
) |
Send Hexadecimal value to seven segment.
position | The position on display 0-7 |
hex | hexadecimal value (DEC) 0-15 (0x00 - 0x0F) |
void TM1638plus_Model1::displayIntNum | ( | unsigned long | number, |
AlignTextType_e | TextAlignment = TMAlignTextLeft |
||
) |
Display an integer and leading zeros optional.
number | integer to display 2^32 |
TextAlignment | enum text alignment, left or right alignment or leading zeros |
rdlib::Return_Codes_e TM1638plus_Model1::displayText | ( | const char * | text | ) |
Display a text string on display.
text | pointer to a character array |
uint8_t TM1638plus_Model1::readButtons | ( | void | ) |
Read buttons values from display.
|
virtual |
Set one LED on or off Model 1 & 3.
position | 0-7 == L1-L8 on PCB |
value | 0 off 1 on |
Reimplemented in TM1638plus_Model3.
|
virtual |
Set all LED's on or off Model 1 & 3.
ledvalues | 1 on , 0 off , 0xXXLL where LL = L8-L1 |
Reimplemented in TM1638plus_Model3.