TM1638_plus  2.0.0
Arduino library for Tm1638 modules
Public Member Functions | Protected Member Functions | 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

 TM1638plus_common ()
 Constructor for class TM1638plus_common.
 
void displayBegin ()
 Begin method , sets pin modes and activate display. More...
 
void reset (void)
 Reset / clear the display. More...
 
void brightness (uint8_t brightness)
 Sets the brightness level of segments in display on a scale of brightness. More...
 

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. More...
 
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. More...
 
void sendCommand (uint8_t value)
 Send command to display. More...
 
void sendData (uint8_t data)
 Send Data to display. More...
 

Protected Attributes

uint8_t _STROBE_IO
 
uint8_t _DATA_IO
 
uint8_t _CLOCK_IO
 
bool _HIGH_FREQ = false
 

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 Font Data Table , map of ASCII values/table to 7-segment, offset to position 32.

◆ 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

◆ _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


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