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

A Driver that assumes that the resistors are on the digits so the multiplexing occurs by scanning through the segments. More...

#include <SegmentDriver.h>

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

Public Member Functions

 SegmentDriver (LedMatrix *ledMatrix, DimmablePattern *dimmablePatterns, uint8_t numDigits, bool ownsLedMatrix=false)
 Constructor. More...
 
virtual void configure () override
 Configure the driver. More...
 
virtual uint16_t getFieldsPerFrame () override
 Return number of fields per frame. More...
 
virtual bool isBrightnessSupported () override
 Returns true if the driver supports brightness. More...
 
virtual void displayCurrentField () override
 Display the current field of the frame. More...
 
virtual void prepareToSleep () override
 Prepare to go to sleep by clearing the frame, and setting a flag so that it doesn't turn itself back on through an interrupt.
 
- Public Member Functions inherited from ace_segment::Driver
virtual ~Driver ()
 Virtual destructor needed to clean up LedMatrix that was created on the heap by DriverBuilder. More...
 
virtual void finish ()
 Turn off the LEDs by doing the opposite of configure(). More...
 
virtual void wakeFromSleep ()
 Wake up from sleep. More...
 
void setPattern (uint8_t digit, SegmentPatternType pattern, uint8_t brightness=DimmablePattern::kOn)
 Set the pattern for a given digit. More...
 
void setBrightness (uint8_t digit, uint8_t brightness)
 Set the brightness of the given digit. More...
 

Additional Inherited Members

- Public Types inherited from ace_segment::Driver
typedef uint8_t SegmentPatternType
 Integer type used to store the segment bit patterns of a single digit. More...
 
typedef uint8_t DigitPatternType
 Integer type used to store the digit bit patterns of a single segment. More...
 
- Protected Member Functions inherited from ace_segment::Driver
 Driver (const Driver &)=delete
 
Driveroperator= (const Driver &)=delete
 
 Driver (LedMatrix *ledMatrix, DimmablePattern *dimmablePatterns, uint8_t numDigits, bool ownsLedMatrix=false)
 Constructor. More...
 
- Protected Attributes inherited from ace_segment::Driver
LedMatrix *const mLedMatrix
 
DimmablePattern *const mDimmablePatterns
 
const uint8_t mNumDigits
 
const bool mOwnsLedMatrix
 
volatile bool mPreparedToSleep
 
- Static Protected Attributes inherited from ace_segment::Driver
static const uint8_t kNumSegments = 8
 Number of segments on a single digit. More...
 

Detailed Description

A Driver that assumes that the resistors are on the digits so the multiplexing occurs by scanning through the segments.

Definition at line 39 of file SegmentDriver.h.

Constructor & Destructor Documentation

◆ SegmentDriver()

ace_segment::SegmentDriver::SegmentDriver ( LedMatrix ledMatrix,
DimmablePattern dimmablePatterns,
uint8_t  numDigits,
bool  ownsLedMatrix = false 
)
inlineexplicit

Constructor.

Definition at line 42 of file SegmentDriver.h.

Member Function Documentation

◆ configure()

virtual void ace_segment::SegmentDriver::configure ( )
inlineoverridevirtual

Configure the driver.

Usually called only once in a program. Sometimes unit tests may call it twice.

Reimplemented from ace_segment::Driver.

Definition at line 48 of file SegmentDriver.h.

◆ displayCurrentField()

void ace_segment::SegmentDriver::displayCurrentField ( )
overridevirtual

Display the current field of the frame.

Automatically advances to the next field for the next call. A frame is one complete rendering of all the digits. A field is a slice of that frame. If the digits are multiplexed, then a field is a rendering of a single digit with all its segments. If the segments are multiplexed, then a field is a rendering of a single segment across multiple digits.

Implements ace_segment::Driver.

Definition at line 32 of file SegmentDriver.cpp.

◆ getFieldsPerFrame()

virtual uint16_t ace_segment::SegmentDriver::getFieldsPerFrame ( )
inlineoverridevirtual

Return number of fields per frame.

Implements ace_segment::Driver.

Definition at line 55 of file SegmentDriver.h.

◆ isBrightnessSupported()

virtual bool ace_segment::SegmentDriver::isBrightnessSupported ( )
inlineoverridevirtual

Returns true if the driver supports brightness.

If not, any brightness greater than 0 will be considered ON, and 0 will be OFF.

Implements ace_segment::Driver.

Definition at line 57 of file SegmentDriver.h.


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