TM1638_plus 2.2.0
Arduino library for Tm1638 modules
Public Types | Public Member Functions | List of all members
MAX7219plus_Model6 Class Reference

Drive MAX7219 seven segment displays. More...

#include <MAX7219plus.h>

Inheritance diagram for MAX7219plus_Model6:
Inheritance graph
[legend]

Public Types

enum  TextAlignment_e : uint8_t { AlignLeft = 0 , AlignRight = 1 , AlignRightZeros = 2 }
 
enum  DecodeMode_e : uint8_t { DecodeModeNone = 0x00 , DecodeModeBCDOne = 0x01 , DecodeModeBCDTwo = 0x0F , DecodeModeBCDThree = 0xFF }
 
enum  CodeBFont_e : uint8_t {
  CodeBFontZero = 0x00 , CodeBFontOne = 0x01 , CodeBFontTwo = 0x02 , CodeBFontThree = 0x03 ,
  CodeBFontFour = 0x04 , CodeBFontFive = 0x05 , CodeBFontSix = 0x06 , CodeBFontSeven = 0x07 ,
  CodeBFontEight = 0x08 , CodeBFontNine = 0x09 , CodeBFontDash = 0x0A , CodeBFontE = 0x0B ,
  CodeBFontH = 0x0C , CodeBFontL = 0x0D , CodeBFontP = 0x0E , CodeBFontSpace = 0x0F
}
 
enum  Intensity_e : uint8_t { IntensityMin = 0x00 , IntensityDefault = 0x08 , IntensityMax = 0x0F }
 
enum  ScanLimit_e : uint8_t {
  ScanOneDigit = 0x00 , ScanTwoDigit = 0x01 , ScanThreeDigit = 0x02 , ScanFourDigit = 0x03 ,
  ScanFiveDigit = 0x04 , ScanSixDigit = 0x05 , ScanSevenDigit = 0x06 , ScanEightDigit = 0x07
}
 
enum  RegisterModes_e : uint8_t {
  MAX7219_REG_NOP = 0x00 , MAX7219_REG_DecodeMode = 0x09 , MAX7219_REG_Intensity = 0x0A , MAX7219_REG_ScanLimit = 0x0B ,
  MAX7219_REG_ShutDown = 0x0C , MAX7219_REG_DisplayTest = 0x0F
}
 
- Public Types inherited from CommonData
enum  DecimalPoint_e : uint8_t { DecPointOff = 0 , DecPointOn = 1 }
 Decimal point on digit control. More...
 

Public Member Functions

 MAX7219plus_Model6 (uint8_t chipSelect, uint8_t clock, uint8_t data, uint16_t CommDelay, uint8_t totalDisplays)
 Constructor for class MAX7219plus_Model6 software SPI.
 
 MAX7219plus_Model6 (uint8_t chipSelect, uint8_t totalDisplays)
 Constructor for class MAX7219plus_Model6 hardware SPI.
 
void InitDisplay (ScanLimit_e numDigits, DecodeMode_e decodeMode)
 Init the display.
 
void ClearDisplay (void)
 Clear the display.
 
void SetBrightness (uint8_t brightness)
 sets the brightness of display
 
void DisplayTestMode (bool OnOff)
 Turn on and off the Display Test Mode.
 
void ShutdownMode (bool OnOff)
 Turn on and off the Shutdown Mode.
 
uint16_t GetCommDelay (void)
 Get the communication delay value.
 
void SetCommDelay (uint16_t commDelay)
 Set the communication delay value.
 
bool GetHardwareSPI (void)
 get value of _HardwareSPI , true hardware SPI on , false off.
 
uint8_t GetCurrentDisplayNumber (void)
 Get the Current Display Number.
 
void SetCurrentDisplayNumber (uint8_t)
 Set the Current Display Number.
 
void DisplayChar (uint8_t digit, uint8_t value, DecimalPoint_e decimalPoint)
 Displays a character on display.
 
int DisplayText (char *text, TextAlignment_e TextAlignment)
 Displays a text string on display.
 
int DisplayText (char *text)
 Displays a text string on display.
 
void DisplayIntNum (unsigned long number, TextAlignment_e TextAlignment)
 Display an integer and leading zeros optional.
 
void DisplayDecNumNibble (uint16_t numberUpper, uint16_t numberLower, TextAlignment_e TextAlignment)
 Display an integer in a nibble (4 digits on display)
 
void DisplayBCDChar (uint8_t digit, CodeBFont_e value)
 Displays a character on display using MAX7219 Built in BCD code B font.
 
int DisplayBCDText (char *text)
 Displays a BCD text string on display using MAX7219 Built in BCD code B font.
 
void SetSegment (uint8_t digit, uint8_t segment)
 Set a seven segment LED ON.
 

Additional Inherited Members

- Public Attributes inherited from CommonData
bool displaylib_LED_debug = false
 
- Static Public Attributes inherited from CommonData
static constexpr uint16_t displaylib_LED_VersionNum = 220
 
- Static Protected Member Functions inherited from SevenSegmentFont
static const uint8_t * pFontSevenSegptr ()
 Retrieves a pointer to the seven-segment font data table.
 
- Static Protected Attributes inherited from SevenSegmentFont
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
 

Detailed Description

Drive MAX7219 seven segment displays.

Member Enumeration Documentation

◆ CodeBFont_e

sets BCD code B font (0-9, E, H, L,P, and -) Built-in font

Enumerator
CodeBFontZero 

Code B decode for Zero

CodeBFontOne 

Code B decode for One

CodeBFontTwo 

Code B decode for Two

CodeBFontThree 

Code B decode for Three

CodeBFontFour 

Code B decode for Four

CodeBFontFive 

Code B decode for Five

CodeBFontSix 

Code B decode for Six

CodeBFontSeven 

Code B decode for Seven

CodeBFontEight 

Code B decode for Eight

CodeBFontNine 

Code B decode for Nine

CodeBFontDash 

Code B decode for Dash

CodeBFontE 

Code B decode for letter E

CodeBFontH 

Code B decode for letter H

CodeBFontL 

Code B decode for letter L

CodeBFontP 

Code B decode for letter P

CodeBFontSpace 

Code B decode for Space

◆ DecodeMode_e

The decode-mode register sets BCD code B or no-decode operation for each digit

Enumerator
DecodeModeNone 

No decode for digits 7–0

DecodeModeBCDOne 

Code B decode for digit 0, No decode for digits 7–1

DecodeModeBCDTwo 

Code B decode for digits 3–0, No decode for digits 7–4

DecodeModeBCDThree 

Code B decode for digits 7–0

◆ Intensity_e

Set intensity/brightness of Display

Enumerator
IntensityMin 

Minimum Intensity

IntensityDefault 

Default Intensity

IntensityMax 

Maximum Intensity

◆ RegisterModes_e

Register opcodes of the MAZ7219 chip, Register Address Map

Enumerator
MAX7219_REG_NOP 

No operation

MAX7219_REG_DecodeMode 

Decode-Mode Register

MAX7219_REG_Intensity 

Intensity Register, brightness of display

MAX7219_REG_ScanLimit 

Scan Limit, The scan-limit register sets how many digits are displayed

MAX7219_REG_ShutDown 

When the MAX7219 is in shutdown mode, the scan oscillator is halted, all segment current sources are pulled to ground, and all digit drivers are pulled to V+, thereby blanking the display.

MAX7219_REG_DisplayTest 

Display-test mode turns all LEDs on by overriding, but not altering, all controls and digit registers

◆ ScanLimit_e

The scan-limit register sets how many digits are displayed

Enumerator
ScanOneDigit 

Scan One digit

ScanTwoDigit 

Scan Two digit

ScanThreeDigit 

Scan Three digit

ScanFourDigit 

Scan Four digit

ScanFiveDigit 

Scan Five digit

ScanSixDigit 

Scan Six digit

ScanSevenDigit 

Scan Seven digit

ScanEightDigit 

Scan Eight digit

◆ TextAlignment_e

Alignment of text on display

Enumerator
AlignLeft 

Align text to the left on display

AlignRight 

Align text to the right on display

AlignRightZeros 

Add leading zeros to the right aligned text

Constructor & Destructor Documentation

◆ MAX7219plus_Model6() [1/2]

MAX7219plus_Model6::MAX7219plus_Model6 ( uint8_t  chipSelect,
uint8_t  clock,
uint8_t  data,
uint16_t  CommDelay,
uint8_t  totalDisplays 
)

Constructor for class MAX7219plus_Model6 software SPI.

Parameters
clockCLk pin
chipSelectCS pin
dataDIO pin
CommDelaySoftware SPI communications delay in uS
totalDisplaysTotal number of displays in cascade
Note
overloaded this one is for Software SPI

◆ MAX7219plus_Model6() [2/2]

MAX7219plus_Model6::MAX7219plus_Model6 ( uint8_t  chipSelect,
uint8_t  totalDisplays 
)

Constructor for class MAX7219plus_Model6 hardware SPI.

Parameters
chipSelectCS pin
totalDisplaysTotal number of displays in cascade
Note
overloaded this one is for Hardware SPI

Member Function Documentation

◆ DisplayBCDChar()

void MAX7219plus_Model6::DisplayBCDChar ( uint8_t  digit,
CodeBFont_e  value 
)

Displays a character on display using MAX7219 Built in BCD code B font.

Parameters
digitThe digit to display character in, 7-0 ,7 = LHS 0 =RHS
valueThe BCD character to display
Note
sets BCD code B font (0-9, E, H, L,P, and -) Built-in font

◆ DisplayBCDText()

int MAX7219plus_Model6::DisplayBCDText ( char *  text)

Displays a BCD text string on display using MAX7219 Built in BCD code B font.

Parameters
textpointer to character array containing text string
Note
sets BCD code B font (0-9, E, H, L,P, and -) Built-in font Non supported characters printed as space ' '
Returns
error -2 if string is null , 0 for success

◆ DisplayChar()

void MAX7219plus_Model6::DisplayChar ( uint8_t  digit,
uint8_t  character,
DecimalPoint_e  decimalPoint 
)

Displays a character on display.

Parameters
digitThe digit to display character in, 7-0 ,7 = LHS 0 =RHS
characterThe ASCII character to display
decimalPointIs the decimal point(dp) to be set or not.

◆ DisplayDecNumNibble()

void MAX7219plus_Model6::DisplayDecNumNibble ( uint16_t  numberUpper,
uint16_t  numberLower,
TextAlignment_e  TextAlignment 
)

Display an integer in a nibble (4 digits on display)

Parameters
numberUpperupper nibble integer 2^16
numberLowerlower nibble integer 2^16
TextAlignmentleft or right alignment or leading zeros
Note
Divides the display into two nibbles and displays a Decimal number in each. takes in two numbers 0-9999 for each nibble.

◆ DisplayIntNum()

void MAX7219plus_Model6::DisplayIntNum ( unsigned long  number,
TextAlignment_e  TextAlignment 
)

Display an integer and leading zeros optional.

Parameters
numberinteger to display 2^32
TextAlignmentenum text alignment, left or right alignment or leading zeros

◆ DisplayTestMode()

void MAX7219plus_Model6::DisplayTestMode ( bool  OnOff)

Turn on and off the Display Test Mode.

Parameters
OnOfftrue = display test mode on , false display Test Mode off
Note
Display-test mode turns all LEDs on

◆ DisplayText() [1/2]

int MAX7219plus_Model6::DisplayText ( char *  text)

Displays a text string on display.

Parameters
textpointer to character array containing text string
Note
This method is overloaded, see also DisplayText(char *, TextAlignment_e )
Returns
error -2 if string is null , 0 for success

◆ DisplayText() [2/2]

int MAX7219plus_Model6::DisplayText ( char *  text,
TextAlignment_e  TextAlignment 
)

Displays a text string on display.

Parameters
textpointer to character array containg text string
TextAlignmentleft or right alignment

AlignRightZeros option for Text alignment not supported in this function.

Note
This method is overloaded, see also DisplayText(char *)
Returns
error -2 if string is null. -3 if option AlignRightZeros entered , 0 for success

◆ GetCommDelay()

uint16_t MAX7219plus_Model6::GetCommDelay ( void  )

Get the communication delay value.

Returns
Get the communication delay value uS Software SPi

◆ GetCurrentDisplayNumber()

uint8_t MAX7219plus_Model6::GetCurrentDisplayNumber ( void  )

Get the Current Display Number.

Returns
Get the Current Display Number

◆ GetHardwareSPI()

bool MAX7219plus_Model6::GetHardwareSPI ( void  )

get value of _HardwareSPI , true hardware SPI on , false off.

Returns
_HardwareSPI , true hardware SPI on , false off.

◆ InitDisplay()

void MAX7219plus_Model6::InitDisplay ( ScanLimit_e  numDigits,
DecodeMode_e  decodeMode 
)

Init the display.

Parameters
numDigitsscan limit set to 8 normally , advanced use only
decodeModeMust users will use 0x00 here
Note
when cascading supplies init display one first always!

◆ SetBrightness()

void MAX7219plus_Model6::SetBrightness ( uint8_t  brightness)

sets the brightness of display

Parameters
brightnessrang 0x00 to 0x0F , 0x00 being least bright.

◆ SetCommDelay()

void MAX7219plus_Model6::SetCommDelay ( uint16_t  commDelay)

Set the communication delay value.

Parameters
commDelaySet the communication delay value uS software SPI

◆ SetCurrentDisplayNumber()

void MAX7219plus_Model6::SetCurrentDisplayNumber ( uint8_t  DisplayNum)

Set the Current Display Number.

Parameters
DisplayNumSet the Current Display Number

◆ SetSegment()

void MAX7219plus_Model6::SetSegment ( uint8_t  digit,
uint8_t  segment 
)

Set a seven segment LED ON.

Parameters
digitThe digit to set segment in, 7-0 ,7 = LHS 0 =RHS
segmentThe segment of seven segment to set dpabcdefg

◆ ShutdownMode()

void MAX7219plus_Model6::ShutdownMode ( bool  OnOff)

Turn on and off the Shutdown Mode.

Parameters
OnOfftrue = Shutdown mode on , false shutdown mode off
Note
power saving mode

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