TM1638_plus 2.1.0
Arduino library for Tm1638 modules
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
TM1638plus_common Class Reference

The base Class , used to store common data & functions for all models types. More...

#include <TM1638plus_common.h>

Inheritance diagram for TM1638plus_common:
Inheritance graph
[legend]

Public Member Functions

void displayBegin ()
 Begin method , sets pin modes and activate display.
 
void reset (void)
 Reset / clear the display.
 
void brightness (uint8_t brightness)
 Sets the brightness level of segments in display on a scale of brightness.
 
uint8_t getHFIN_DELAY () const
 
void setHFIN_DELAY (uint8_t delay)
 
uint8_t getHFOUT_DELAY () const
 
void setHFOUT_DELAY (uint8_t delay)
 

Protected Member Functions

uint8_t HighFreqshiftin (uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder)
 Shifts in a byte of data from the Tm1638 SPI-like bus.
 
void HighFreqshiftOut (uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val)
 Shifts out a byte of data on to the Tm1638 SPI-like bus.
 
void sendCommand (uint8_t value)
 Send command to display.
 
void sendData (uint8_t data)
 Send Data to display.
 

Protected Attributes

uint8_t _STROBE_IO
 
uint8_t _DATA_IO
 
uint8_t _CLOCK_IO
 
bool _HIGH_FREQ = false
 
uint8_t _HFIN_DELAY = 1
 
uint8_t _HFOUT_DELAY = 1
 

Static Protected Attributes

static constexpr uint8_t TM_ACTIVATE = 0x8F
 
static constexpr uint8_t TM_BUTTONS_MODE = 0x42
 
static constexpr uint8_t TM_WRITE_LOC = 0x44
 
static constexpr uint8_t TM_WRITE_INC = 0x40
 
static constexpr uint8_t TM_SEG_ADR = 0xC0
 
static constexpr uint8_t TM_LEDS_ADR = 0xC1
 
static constexpr uint8_t TM_BRIGHT_ADR = 0x88
 
static constexpr uint8_t TM_BRIGHT_MASK = 0x07
 
static constexpr uint8_t TM_DEFAULT_BRIGHTNESS = 0x02
 
static constexpr uint8_t TM_DISPLAY_SIZE = 8
 
- Static Protected Attributes inherited from CommonData
static constexpr uint8_t _ASCII_FONT_OFFSET = 0x20
 
static constexpr uint8_t _ASCII_FONT_END = 0x7B
 
static constexpr uint8_t _ASCII_FONT_HEX_OFFSET = 0x10
 
static constexpr uint8_t DEC_POINT_7_MASK = 0x80
 

Additional Inherited Members

- Public Types inherited from CommonData
enum  DecimalPoint_e : uint8_t { DecPointOff = 0 , DecPointOn = 1 }
 Switch on or off decimal point on a digit. More...
 
- Public Attributes inherited from CommonData
bool displaylib_LED_debug = false
 
- Static Public Attributes inherited from CommonData
static constexpr uint16_t displaylib_LED_VersionNum = 210
 
- Static Protected Member Functions inherited from SevenSegmentFont
static const uint8_t * pFontSevenSegptr ()
 Retrieves a pointer to the seven-segment font data table.
 

Detailed Description

The base Class , used to store common data & functions for all models types.

Member Function Documentation

◆ brightness()

void TM1638plus_common::brightness ( uint8_t  brightness)

Sets the brightness level of segments in display on a scale of brightness.

Parameters
brightnessbyte with value 0 to 7 The DEFAULT_BRIGHTNESS = 0x02

◆ displayBegin()

void TM1638plus_common::displayBegin ( )

Begin method , sets pin modes and activate display.

Note
Call in Setup() loop

◆ HighFreqshiftin()

uint8_t TM1638plus_common::HighFreqshiftin ( uint8_t  dataPin,
uint8_t  clockPin,
uint8_t  bitOrder 
)
protected

Shifts in a byte of data from the Tm1638 SPI-like bus.

Parameters
dataPinTm1638 Data GPIO
clockPinTm1638 Clock GPIO
bitOrderData byte bit order LSBFIRST OR MSBFIRST, Set to LSBFIRST for Tm1638
Returns
Data byte
Note
Used instead of arduino function "shiftin" when _HIGH_FREQ is set to true, for high frequency CPU's

◆ HighFreqshiftOut()

void TM1638plus_common::HighFreqshiftOut ( uint8_t  dataPin,
uint8_t  clockPin,
uint8_t  bitOrder,
uint8_t  val 
)
protected

Shifts out a byte of data on to the Tm1638 SPI-like bus.

Parameters
dataPinTm1638 Data GPIO
clockPinTm1638 Clock GPIO
bitOrderData byte bit order LSBFIRST OR MSBFIRST, Set to LSBFIRST for Tm1638
valThe byte of data to shift out
Note
Used instead of arduino function "shiftOut" when _HIGH_FREQ is set to true, for high frequency CPU's

◆ reset()

void TM1638plus_common::reset ( void  )

Reset / clear the display.

Note
The display is cleared by writing zero to all data segment addresses.

◆ sendCommand()

void TM1638plus_common::sendCommand ( uint8_t  value)
protected

Send command to display.

Parameters
valuecommand byte to send

◆ sendData()

void TM1638plus_common::sendData ( uint8_t  data)
protected

Send Data to display.

Parameters
dataData byte to send

Member Data Documentation

◆ _CLOCK_IO

uint8_t TM1638plus_common::_CLOCK_IO
protected

GPIO connected to CLk on Tm1638

◆ _DATA_IO

uint8_t TM1638plus_common::_DATA_IO
protected

GPIO connected to DIO on Tm1638

◆ _HFIN_DELAY

uint8_t TM1638plus_common::_HFIN_DELAY = 1
protected

uS Delay used by shiftIn function for High-freq MCU

◆ _HFOUT_DELAY

uint8_t TM1638plus_common::_HFOUT_DELAY = 1
protected

uS Delay used by shiftOut function for High-freq MCU

◆ _HIGH_FREQ

bool TM1638plus_common::_HIGH_FREQ = false
protected

Set to true if running high freq CPU.

◆ _STROBE_IO

uint8_t TM1638plus_common::_STROBE_IO
protected

GPIO connected to STB on Tm1638

◆ TM_ACTIVATE

constexpr uint8_t TM1638plus_common::TM_ACTIVATE = 0x8F
staticconstexprprotected

Start up device

◆ TM_BRIGHT_ADR

constexpr uint8_t TM1638plus_common::TM_BRIGHT_ADR = 0x88
staticconstexprprotected

Brightness address

◆ TM_BRIGHT_MASK

constexpr uint8_t TM1638plus_common::TM_BRIGHT_MASK = 0x07
staticconstexprprotected

Brightness mask

◆ TM_BUTTONS_MODE

constexpr uint8_t TM1638plus_common::TM_BUTTONS_MODE = 0x42
staticconstexprprotected

Buttons mode

◆ TM_DEFAULT_BRIGHTNESS

constexpr uint8_t TM1638plus_common::TM_DEFAULT_BRIGHTNESS = 0x02
staticconstexprprotected

Brightness can be 0x00 to 0x07, 0x00 is least bright

◆ TM_DISPLAY_SIZE

constexpr uint8_t TM1638plus_common::TM_DISPLAY_SIZE = 8
staticconstexprprotected

Size of display in digits

◆ TM_LEDS_ADR

constexpr uint8_t TM1638plus_common::TM_LEDS_ADR = 0xC1
staticconstexprprotected

Leftmost LED address C1 C3 C5 C7 C9 CB CD CF

◆ TM_SEG_ADR

constexpr uint8_t TM1638plus_common::TM_SEG_ADR = 0xC0
staticconstexprprotected

Leftmost segment Address C0 C2 C4 C6 C8 CA CC CE

◆ TM_WRITE_INC

constexpr uint8_t TM1638plus_common::TM_WRITE_INC = 0x40
staticconstexprprotected

Incremental write

◆ TM_WRITE_LOC

constexpr uint8_t TM1638plus_common::TM_WRITE_LOC = 0x44
staticconstexprprotected

Write to a memory location


The documentation for this class was generated from the following files: