AceSegment  0.12.0
A library for rendering seven segment LED displays using the TM1637, TM1638, MAX7219, HT16K33, or 74HC595 controller chips
Public Member Functions | List of all members
ace_segment::Max7219Module< T_SPII, T_DIGITS > Class Template Reference

An implementation of LedModule using the MAX7219 chip. More...

#include <Max7219Module.h>

Inheritance diagram for ace_segment::Max7219Module< T_SPII, T_DIGITS >:
Inheritance graph
[legend]
Collaboration diagram for ace_segment::Max7219Module< T_SPII, T_DIGITS >:
Collaboration graph
[legend]

Public Member Functions

 Max7219Module (const T_SPII &spiInterface, const uint8_t *remapArray=nullptr)
 Constructor. More...
 
void begin ()
 
void end ()
 
bool isFlushRequired () const
 Return true if flushing required.
 
void flush ()
 Send segment patterns of all digits. More...
 
- Public Member Functions inherited from ace_segment::LedModule
 LedModule (uint8_t *patterns, uint8_t numDigits)
 Constructor. More...
 
uint8_t getNumDigits () const
 Return the number of digits supported by this display instance.
 
void setPatternAt (uint8_t pos, uint8_t pattern)
 Set the led digit pattern at position pos.
 
uint8_t getPatternAt (uint8_t pos) const
 Get the led digit pattern at position pos.
 
void setBrightness (uint8_t brightness)
 Set global brightness of all digits. More...
 
uint8_t getBrightness () const
 Get the current brightness.
 

Additional Inherited Members

- Protected Member Functions inherited from ace_segment::LedModule
void begin ()
 Subclasses should call this from its own begin().
 
void end ()
 Subclasses should call this from its own end(). More...
 
void setDigitDirty (uint8_t pos)
 Set the dirty bit of digit pos.
 
void clearDigitDirty (uint8_t pos)
 Clear the dirty bit of digit pos.
 
bool isDigitDirty (uint8_t pos) const
 Check the dirty bit of digit pos.
 
void clearDigitsDirty ()
 Clear dirty bits of all digits.
 
bool isAnyDigitDirty () const
 Return true if any digits are dirty.
 
bool isBrightnessDirty () const
 Check if the brightness level is dirty.
 
void setBrightnessDirty ()
 Mark the brightness as dirty.
 
void clearBrightnessDirty ()
 Clear the dirty bit for brightness.
 

Detailed Description

template<typename T_SPII, uint8_t T_DIGITS>
class ace_segment::Max7219Module< T_SPII, T_DIGITS >

An implementation of LedModule using the MAX7219 chip.

The chip uses SPI.

Template Parameters
T_SPIIclass that implements the SPI interface, usually one of the classes in the AceSPI library: SimpleSpiInterface, SimpleSpiFastInterface, HardSpiInterface, HardSpiFastInterface.
T_DIGITSnumber of digits in the module

Definition at line 107 of file Max7219Module.h.

Constructor & Destructor Documentation

◆ Max7219Module()

template<typename T_SPII , uint8_t T_DIGITS>
ace_segment::Max7219Module< T_SPII, T_DIGITS >::Max7219Module ( const T_SPII &  spiInterface,
const uint8_t *  remapArray = nullptr 
)
inlineexplicit

Constructor.

Parameters
spiInterfaceinstance of SPI interface class
remapArray(optional, nullable) a mapping of the physical digit positions to their logical positions

Definition at line 115 of file Max7219Module.h.

Member Function Documentation

◆ flush()

template<typename T_SPII , uint8_t T_DIGITS>
void ace_segment::Max7219Module< T_SPII, T_DIGITS >::flush ( )
inline

Send segment patterns of all digits.

For a rough idea of how long this function takes, here are the numbers on a 16 MHz AVR:

  • HW SPI: 170 microseconds
  • SW SPI: 1800 microseconds
  • SW SPI Fast: 210 microseconds

The isFlushRequired() method can be used to optimize the number of calls to flush(), but often it is not necessary.

Definition at line 171 of file Max7219Module.h.


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