25 #ifndef ACE_SEGMENT_DRIVER_H 26 #define ACE_SEGMENT_DRIVER_H 29 #include "DimmablePattern.h" 92 mPreparedToSleep =
true;
97 mPreparedToSleep =
false;
117 void setPattern(uint8_t digit, SegmentPatternType pattern,
118 uint8_t brightness = DimmablePattern::kOn);
149 uint8_t numDigits,
bool ownsLedMatrix =
false):
150 mLedMatrix(ledMatrix),
151 mDimmablePatterns(dimmablePatterns),
152 mNumDigits(numDigits),
153 mOwnsLedMatrix(ownsLedMatrix),
154 mPreparedToSleep(false)
159 const uint8_t mNumDigits;
160 const bool mOwnsLedMatrix;
162 volatile bool mPreparedToSleep;
uint8_t SegmentPatternType
Integer type used to store the segment bit patterns of a single digit.
virtual void displayCurrentField()=0
Display the current field of the frame.
virtual void wakeFromSleep()
Wake up from sleep.
virtual bool isBrightnessSupported()=0
Returns true if the driver supports brightness.
virtual void configure()
Configure the driver.
Driver(LedMatrix *ledMatrix, DimmablePattern *dimmablePatterns, uint8_t numDigits, bool ownsLedMatrix=false)
Constructor.
virtual void prepareToSleep()
Prepare to go to sleep by clearing the frame, and setting a flag so that it doesn't turn itself back ...
virtual void finish()
Turn off the LEDs by doing the opposite of configure().
Class that represents the abstraction of a particular LED display wiring.
void setPattern(uint8_t digit, SegmentPatternType pattern, uint8_t brightness=DimmablePattern::kOn)
Set the pattern for a given digit.
virtual ~Driver()
Virtual destructor needed to clean up LedMatrix that was created on the heap by DriverBuilder.
void setBrightness(uint8_t digit, uint8_t brightness)
Set the brightness of the given digit.
Base class of drivers which knows how to transfer the bit patterns stored in the array of DimmablePat...
virtual uint16_t getFieldsPerFrame()=0
Return number of fields per frame.
static const uint8_t kNumSegments
Number of segments on a single digit.
uint8_t DigitPatternType
Integer type used to store the digit bit patterns of a single segment.