AceSegment  0.7.0
A framework for rendering seven segment LED displays using the TM1637, 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 ()
 
uint8_t getNumDigits () const
 Return the number of digits supported by this display instance.
 
void setPatternAt (uint8_t pos, uint8_t pattern) override
 Set the led digit pattern at position pos.
 
uint8_t getPatternAt (uint8_t pos) override
 Get the led digit pattern at position pos.
 
void setBrightness (uint8_t brightness) override
 Set global brightness of all digits. More...
 
void flush ()
 Send segment patterns of all digits. More...
 
- Public Member Functions inherited from ace_segment::LedModule
 LedModule (uint8_t numDigits)
 Constructor. More...
 
uint8_t getNumDigits () const
 Return the number of digits supported by this display instance. More...
 

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_SPIIthe class that implements the SPI interface, usually either SoftSpiInterface or HardSpiInterface
T_DIGITSnumber of digits in the module

Definition at line 106 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 T_SPII class
remapArray(optional, nullable) a mapping of the physical digit positions to their logical positions

Definition at line 114 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

Definition at line 175 of file Max7219Module.h.

◆ setBrightness()

template<typename T_SPII , uint8_t T_DIGITS>
void ace_segment::Max7219Module< T_SPII, T_DIGITS >::setBrightness ( uint8_t  brightness)
inlineoverridevirtual

Set global brightness of all digits.

Different subclasses will interpret the brightness integer value differently.

Implements ace_segment::LedModule.

Definition at line 159 of file Max7219Module.h.


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