AceSegment  0.8.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::Hc595Module< T_SPII, T_DIGITS, T_SUBFIELDS, T_CI > Class Template Reference

An implementation of LedModule class that supports an LED module using 2 74HC595 Shift Register chips. More...

#include <Hc595Module.h>

Inheritance diagram for ace_segment::Hc595Module< T_SPII, T_DIGITS, T_SUBFIELDS, T_CI >:
Inheritance graph
[legend]
Collaboration diagram for ace_segment::Hc595Module< T_SPII, T_DIGITS, T_SUBFIELDS, T_CI >:
Collaboration graph
[legend]

Public Member Functions

 Hc595Module (const T_SPII &spiInterface, uint8_t segmentOnPattern, uint8_t digitOnPattern, uint8_t framesPerSecond, uint8_t byteOrder, const uint8_t *remapArray=nullptr)
 
void begin ()
 
void end ()
 
- Public Member Functions inherited from ace_segment::ScanningModule< LedMatrixDualHc595< T_SPII >, T_DIGITS, 1, ClockInterface >
 ScanningModule (const LedMatrixDualHc595< T_SPII > &ledMatrix, uint8_t framesPerSecond)
 Constructor. More...
 
void begin ()
 Configure the driver with the parameters given by in the constructor. More...
 
void end ()
 A no-op end() function for consistency with other classes.
 
uint8_t getNumDigits () const
 Get the number of digits.
 
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
 
void setBrightnessAt (uint8_t pos, uint8_t brightness)
 Set the brightness for a given pos, leaving pattern unchanged. More...
 
uint16_t getFramesPerSecond () const
 Return the requested frames per second.
 
uint16_t getFieldsPerSecond () const
 Return the fields per second.
 
uint16_t getFieldsPerFrame () const
 Total fields per frame across all digits.
 
uint16_t getMicrosPerField () const
 Return micros per field. More...
 
bool renderFieldWhenReady ()
 Display one field of a frame when the time is right. More...
 
void renderFieldNow ()
 Render the current field immediately. 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, uint8_t T_SUBFIELDS = 1, typename T_CI = ClockInterface>
class ace_segment::Hc595Module< T_SPII, T_DIGITS, T_SUBFIELDS, T_CI >

An implementation of LedModule class that supports an LED module using 2 74HC595 Shift Register chips.

This is a convenience class that pairs together a ScanningModule and a LedMatrixDualHc595 in a single class.

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 LED digits
T_SUBFIELDSnumber of subfields for each digit to get brightness control using PWM. The default is 1, but can be set to greater than 1 to get brightness control.
T_CIclass that provides access to Arduino clock functions (millis() and micros()). The default is ClockInterface.

Definition at line 75 of file Hc595Module.h.

Constructor & Destructor Documentation

◆ Hc595Module()

template<typename T_SPII , uint8_t T_DIGITS, uint8_t T_SUBFIELDS = 1, typename T_CI = ClockInterface>
ace_segment::Hc595Module< T_SPII, T_DIGITS, T_SUBFIELDS, T_CI >::Hc595Module ( const T_SPII &  spiInterface,
uint8_t  segmentOnPattern,
uint8_t  digitOnPattern,
uint8_t  framesPerSecond,
uint8_t  byteOrder,
const uint8_t *  remapArray = nullptr 
)
inline
Parameters
spiInterfaceobject that knows how to send SPI packets
segmentOnPatternthe bit pattern that indicates whether the segment pins are wired to be active high (kActiveHighPattern) or active low (kActiveLowPattern)
digitOnPatternthe bit pattern that indicates whether the digit pins are wired to be active high (kActiveHighPattern) or active low (kActiveLowPattern)
framesPerSeconddesired number of frames per second (usually greater than or equal to 60 to avoid flickering)
byteOrderwhether to send the digit patterns first (kByteOrderDigitHighSegmentLow) or segment patterns first (kByteOrderSegmentHighDigitLow)
remapArray(optional, nullable) a mapping from the logical digit positions to their physical positions. For example, the 8-digit LED modules from diymore.cc have the left 4 and right 4 LED digits swapped.

Definition at line 108 of file Hc595Module.h.


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