Seven Segments Displays Agnostic Library for ESP32 (Arduino) v3.3.0
A library that provides a class that models a Seven Segment Display and provides an unified API through it's members independently of the display technology.
Loading...
Searching...
No Matches
SevenSegDynamic Class Referenceabstract

Abstract class models a generic dynamically updated Seven Segment display hardware More...

#include <SevenSegDispHw.h>

Inheritance diagram for SevenSegDynamic:
Collaboration diagram for SevenSegDynamic:

Public Member Functions

virtual bool begin (uint32_t updtLps=0)
 Sets up the hardware display to work.
virtual bool end ()
 Reverts the begin(uint32_t) actions, stopping the display activities, stopping and deleting the timer created for periodic refreshing and freeing the resources used by the Seven Segment display hardware object.
Public Member Functions inherited from SevenSegDispHw
 SevenSegDispHw ()
 Default class constructor.
 SevenSegDispHw (uint8_t *ioPins, uint8_t dspDigits=4, bool commAnode=true, uint8_t dspDigitsQtyMax=0)
 Class constructor.
virtual ~SevenSegDispHw ()
 Class destructor.
virtual uint8_t getBrghtnssLvl ()
 Returns the current display brightness level setting for the display.
virtual uint8_t getBrghtnssMaxLvl ()
 Returns the maximum display brightness level setting allowed for the display.
virtual uint8_t getBrghtnssMinLvl ()
 Returns the minimum display brightness level setting for the display.
bool getCommAnode ()
 Returns a value indicating if the display module component of the display hardware uses a common anode or a common cathode led wiring.
uint8_t * getDspBuffPtr ()
 Returns a pointer to the display buffer.
uint8_t getHwDspDigitsQty ()
 Returns the quantity of digits of the display module.
virtual bool getIsOn ()
 Returns the state of the display.
uint8_t * getxcdDspBuffPtr ()
 Returns a pointer to an array holding the contents for the digits/ports available from the display controller but not used for plain digits display.
virtual void ntfyUpdDsply ()
 Notifies the SevenSegDispHw component object of a change of content available in the display buffer, so that the object proceeds to update the display.
virtual bool setBrghtnssLvl (const uint8_t &newBrghtnssLvl)
 Sets the brightness level for the display.
virtual bool setDigitsOrder (uint8_t *newOrderPtr)
 Sets a mapping to relate the display buffer positions to the display port assigned to exhibit it's contents.
void setDspBuffPtr (uint8_t *newDspBuffPtr)
 Sets the pointer to the Display Buffer memory area.
virtual void turnOff ()
 Turns the display module off.
virtual void turnOn ()
 Turns the display module on.
virtual void turnOn (const uint8_t &newBrghtnssLvl)
 Turns the display module on set at the provided brightness level.

Additional Inherited Members

Protected Attributes inherited from SevenSegDispHw
uint8_t _allLedsOff {}
 Value to set in the display port to set all leds off (a "space"), dependent of _commAnode.
uint8_t _brghtnssLvl {0}
 Current display brightness level.
uint8_t _brghtnssLvlMax {0}
 Maximum display brightness level.
uint8_t _brghtnssLvlMin {0}
 Minimum display brightness level.
uint8_t * _dspBlankBuffPtr {nullptr}
 Pointer to a display buffer filled with _allLedsOff ("spaces") to use as display buffer while in "Off State".
uint8_t * _dspBuffPtr {nullptr}
 Pointer to the display buffer, will be provided by the SevenSegDisplays object when it's instantiated.
uint8_t * _dspBuffPtrBkp {nullptr}
 Pointer to the display buffer, copy of the original _dspBuffPtr to be used as backup.
bool _isOn {false}
 Current display status: On/Off.
uint8_t * _xcdDspBuffPtr {nullptr}
 A pointer to a buffer the size of the exceeding digits used to control display specific amenities.
uint8_t _xcdDspDigitsQty {}
 Number of unused available display ports, its the difference (_dspDigitsQtyMax - _dspDigitsQty), being the size of the array pointed by _xcdDspBuffPtr.

Detailed Description

Abstract class models a generic dynamically updated Seven Segment display hardware

Member Function Documentation

◆ begin()

bool SevenSegDynamic::begin ( uint32_t updtLps = 0)
virtual

Sets up the hardware display to work.

Depending on the display technology and the resources it needs to start working, this method takes care of those preparation. That means that each specific subclass of display will have to provide it's version of begin().
The SevenSegDynamic abstract class and it's subclasses model displays that need regular refreshing of its contents, and for this to happen their begin() method must implement and start timers and/or periodic interrupts to handle it's refreshing routines.

Return values
trueThe specific configurations and startups could be successfully made
Returns
false One or more of the specific configurations or startups failed.
Note
For each SevenSegDynamic instantiable subclass a short description of their respective begin() actions will be added if they are relevant to the developer using the library.

Reimplemented from SevenSegDispHw.

Reimplemented in SevenSegDynDummy, and SevenSegDynHC595.

◆ end()

bool SevenSegDynamic::end ( )
virtual

Reverts the begin(uint32_t) actions, stopping the display activities, stopping and deleting the timer created for periodic refreshing and freeing the resources used by the Seven Segment display hardware object.

Returns
true The display activities could be stopped and resources freed with no problems.
false The display activities couldn't be stopped. The method failed.

Reimplemented from SevenSegDispHw.

Reimplemented in SevenSegDynDummy, and SevenSegDynHC595.