AceSegment  0.3.0
An adjustable, configurable, and extensible framework for rendering seven segment LED displays.
Public Member Functions | Protected Attributes | List of all members
ace_segment::LedMatrix Class Referenceabstract

Class that represents the abstraction of a particular LED display wiring. More...

#include <LedMatrix.h>

Inheritance diagram for ace_segment::LedMatrix:
Inheritance graph
[legend]
Collaboration diagram for ace_segment::LedMatrix:
Collaboration graph
[legend]

Public Member Functions

 LedMatrix (Hardware *hardware, uint8_t numGroups, uint8_t numElements)
 
void setCathodeOnGroup ()
 LED negative terminals are on the group line. More...
 
void setAnodeOnGroup ()
 LED positive terminals are on the group line. More...
 
void invertGroupLevels ()
 If a transistor drives the group, invert the logic levels. More...
 
virtual void configure ()
 Configure the pins for the given LED wiring. More...
 
virtual void finish ()
 Turn off the pins by doing the opposite of configure(). More...
 
virtual void enableGroup (uint8_t group)=0
 
virtual void disableGroup (uint8_t group)=0
 
virtual void drawElements (uint8_t pattern)=0
 

Protected Attributes

Hardware *const mHardware
 
const uint8_t mNumGroups
 
const uint8_t mNumElements
 
uint8_t mGroupOn
 
uint8_t mGroupOff
 
uint8_t mElementOn
 
uint8_t mElementOff
 

Detailed Description

Class that represents the abstraction of a particular LED display wiring.

If the resistors are on the segments, then the segments become the Elements and the digits become the Groups. If the resistors are on the digits, then the digits become the Elements and the segments become the Groups. The setCathodeOnGroup() and setAnnodeOnGroup() methods determine the polarity of the LED with respect to the Group line. The invertGroupLevels() should be called when transistors are used on the Group lines to handle higher currents.

Definition at line 49 of file LedMatrix.h.

Member Function Documentation

◆ configure()

virtual void ace_segment::LedMatrix::configure ( )
inlinevirtual

Configure the pins for the given LED wiring.

Reimplemented in ace_segment::LedMatrixSerial, ace_segment::LedMatrixSpi, and ace_segment::LedMatrixDirect.

Definition at line 82 of file LedMatrix.h.

◆ finish()

virtual void ace_segment::LedMatrix::finish ( )
inlinevirtual

Turn off the pins by doing the opposite of configure().

Reimplemented in ace_segment::LedMatrixSerial, ace_segment::LedMatrixSpi, and ace_segment::LedMatrixDirect.

Definition at line 85 of file LedMatrix.h.

◆ invertGroupLevels()

void ace_segment::LedMatrix::invertGroupLevels ( )
inline

If a transistor drives the group, invert the logic levels.

Definition at line 76 of file LedMatrix.h.

◆ setAnodeOnGroup()

void ace_segment::LedMatrix::setAnodeOnGroup ( )
inline

LED positive terminals are on the group line.

Required.

Definition at line 68 of file LedMatrix.h.

◆ setCathodeOnGroup()

void ace_segment::LedMatrix::setCathodeOnGroup ( )
inline

LED negative terminals are on the group line.

Required.

Definition at line 60 of file LedMatrix.h.


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