41#ifndef sevenSegDispHw_ESP32_H
42#define sevenSegDispHw_ESP32_H
46#include <ShiftRegGPIOXpander_ESP32.h>
62 static uint8_t _dspHwSerialNum;
64 virtual void _unAbstract() = 0;
68 uint8_t* _digitPosPtr{
nullptr};
69 uint8_t _dspDigitsQty{};
70 bool _commAnode {
true};
71 const uint8_t _dspDigitsQtyMax{0};
81 uint8_t _dspHwInstNbr{0};
105 SevenSegDispHw(uint8_t* ioPins, uint8_t dspDigits = 4,
bool commAnode =
true, uint8_t dspDigitsQtyMax = 0);
125 virtual bool begin(uint32_t updtLps = 0);
286 virtual void turnOn(
const uint8_t &newBrghtnssLvl);
297 static void tmrCbRfrshDyn(TimerHandle_t rfrshTmrCbArg);
300 virtual void _unAbstract() = 0;
303 TimerHandle_t _dynDspRfrshTmrHndl{NULL};
304 uint8_t _firstRefreshed{0};
305 String _rfrshTmrName{
""};
311 SevenSegDynamic(uint8_t* ioPins, uint8_t dspDigits,
bool commAnode, uint8_t dspDigitsQtyMax = 0);
312 virtual ~SevenSegDynamic();
324 virtual bool begin(uint32_t updtLps=0);
345 static void tmrCbRfrshDynHC595(TimerHandle_t rfrshTmrCbArg);
348 const uint8_t _sclkIndx {0};
349 const uint8_t _rclkIndx {1};
350 const uint8_t _dioIndx {2};
352 ShiftRegGPIOXpander* _drvrShftRegPtr{
nullptr};
353 uint8_t* _drvrShftRegSndPtr{
nullptr};
358 virtual void _unAbstract();
361 const uint8_t _dspDigitsQtyMax{8};
362 TimerHandle_t _dynHC595DspRfrshTmrHndl{NULL};
395 virtual bool begin(uint32_t updtLps = 0);
429 static void tmrCbRfrshDynDummy(TimerHandle_t rfrshTmrCbArg);
432 virtual void _unAbstract();
436 TimerHandle_t _dynDummyDspRfrshTmrHndl{NULL};
439 virtual void send(
const uint8_t &segments,
const uint8_t &port);
467 bool begin(uint32_t updtLps = 0);
503 virtual void _unAbstract() = 0;
507 SevenSegStatic(uint8_t* ioPins, uint8_t dspDigits = 4,
bool commAnode =
true, uint8_t dspDigitsQtyMax = 0);
508 virtual ~SevenSegStatic();
524 const uint8_t _sclkIndx {0};
525 const uint8_t _rclkIndx {1};
526 const uint8_t _dioIndx {2};
528 ShiftRegGPIOXpander* _dsplyHwShftRegPtr{
nullptr};
529 uint8_t* _lclDspBuffPtr{
nullptr};
534 virtual void _unAbstract();
535 void _updDsplyCntnt();
549 SevenSegStatHC595(uint8_t* ioPins, uint8_t dspDigits = 4,
bool commAnode =
true);
555 virtual bool begin(uint32_t updtLps = 0);
589 const uint8_t _clkIndx {0};
590 const uint8_t _dioIndx {1};
591 const uint8_t _hwBrghtnssLvlMax{0x07};
592 const uint8_t _hwBrghtnssLvlMin{0x00};
593 uint32_t _txClkTckTm{2};
597 virtual void _unAbstract() = 0;
598 void _updLclBffrCntnt();
602 uint8_t _dspDigitsQtyMax{};
607 void _txWrByte(uint8_t data);
608 virtual void _sendBffr();
609 virtual bool _sendByte(uint8_t data);
624 SevenSegTM163X(uint8_t* ioPins, uint8_t dspDigits,
bool commAnode, uint8_t dspDigitsQtyMax = 0);
638 bool begin(uint32_t updtLps = 0);
687 virtual void turnOn(
const uint8_t &newBrghtnssLvl);
702 virtual void _unAbstract();
705 const uint8_t _dspDigitsQtyMax{4};
719 SevenSegTM1636(uint8_t* ioPins, uint8_t dspDigits,
bool commAnode);
738 const uint8_t _dspDigitsQtyMax{6};
739 virtual void _unAbstract();
753 SevenSegTM1637(uint8_t* ioPins, uint8_t dspDigits,
bool commAnode);
772 const uint8_t _dspDigitsQtyMax{8};
773 virtual void _unAbstract();
787 SevenSegTM1639(uint8_t* ioPins, uint8_t dspDigits,
bool commAnode);
834 const uint8_t _NoOpAddr{0x00};
835 const uint8_t _DspPortsBaseAddr{0x01};
836 const uint8_t _DecodeModeAddr{0x09};
837 const uint8_t _BrghtnsSettAddr{0x0A};
838 const uint8_t _ScanLimitAddr{0x0B};
839 const uint8_t _ShutDownAddr{0x0C};
840 const uint8_t _DspTestAddr{0x0F};
843 const uint8_t _DisplayTestMode{0x01};
844 const uint8_t _NoDecode{0x00};
845 const uint8_t _NormalOp{0x00};
846 const uint8_t _TurnOff{0x00};
847 const uint8_t _TurnOn{0x01};
850 const uint8_t _clkIndx {0};
851 const uint8_t _dinIndx {1};
852 const uint8_t _csIndx {2};
854 const uint8_t _dspDigitsQtyMax{8};
855 const uint8_t _hwBrghtnssLvlMax{0x0F};
856 const uint8_t _hwBrghtnssLvlMin{0x00};
862 uint8_t _cnvrtStdDgtTo72xxDgt(
const uint8_t &StdDgt);
863 virtual void _unAbstract();
864 void _updLclBffrCntnt();
869 virtual void _sendByte(
const uint8_t &val,
const bool &MSbFrst =
true);
870 virtual void _sendAddrData(
const uint8_t &address,
const uint8_t &data,
const bool &MSbFrst =
true);
871 virtual void _sendBffr();
902 bool begin(uint32_t updtLps = 0);
949 virtual void turnOn(
const uint8_t &newBrghtnssLvl);
Base abstract class models a generic Seven Segment display hardware.
Definition SevenSegDispHw.h:61
virtual void ntfyUpdDsply()
Notifies the SevenSegDispHw component object of a change of content available in the display buffer,...
Definition SevenSegDispHw.cpp:126
virtual void turnOff()
Turns the display module off.
Definition SevenSegDispHw.cpp:174
virtual uint8_t getBrghtnssLvl()
Returns the current display brightness level setting for the display.
Definition SevenSegDispHw.cpp:86
virtual bool end()
Reverts the begin(uint32_t) actions, stopping the display activities, turning the display off and fre...
Definition SevenSegDispHw.cpp:76
virtual ~SevenSegDispHw()
Class destructor.
Definition SevenSegDispHw.cpp:60
uint8_t * getDspBuffPtr()
Returns a pointer to the display buffer.
Definition SevenSegDispHw.cpp:106
virtual bool setBrghtnssLvl(const uint8_t &newBrghtnssLvl)
Sets the brightness level for the display.
Definition SevenSegDispHw.cpp:131
SevenSegDispHw()
Default class constructor.
Definition SevenSegDispHw.cpp:38
bool _isOn
Current display status: On/Off.
Definition SevenSegDispHw.h:82
uint8_t * _dspBlankBuffPtr
Pointer to a display buffer filled with _allLedsOff ("spaces") to use as display buffer while in "Off...
Definition SevenSegDispHw.h:77
bool getCommAnode()
Returns a value indicating if the display module component of the display hardware uses a common anod...
Definition SevenSegDispHw.cpp:101
virtual bool begin(uint32_t updtLps=0)
Sets up the hardware display to work, and starts the display activities.
Definition SevenSegDispHw.cpp:70
uint8_t * _dspBuffPtrBkp
Pointer to the display buffer, copy of the original **_dspBuffPtr** to be used as backup.
Definition SevenSegDispHw.h:79
uint8_t _brghtnssLvl
Current display brightness level.
Definition SevenSegDispHw.h:74
virtual uint8_t getBrghtnssMaxLvl()
Returns the maximum display brightness level setting allowed for the display.
Definition SevenSegDispHw.cpp:91
uint8_t _xcdDspDigitsQty
Number of unused available display ports, its the difference (_dspDigitsQtyMax - _dspDigitsQty),...
Definition SevenSegDispHw.h:84
virtual void turnOn()
Turns the display module on.
Definition SevenSegDispHw.cpp:188
uint8_t * _dspBuffPtr
Pointer to the display buffer, will be provided by the SevenSegDisplays object when it's instantiated...
Definition SevenSegDispHw.h:78
uint8_t * getxcdDspBuffPtr()
Returns a pointer to an array holding the contents for the digits/ports available from the display co...
Definition SevenSegDispHw.cpp:121
uint8_t _allLedsOff
Value to set in the display port to set all leds off (a "space"), dependent of _commAnode.
Definition SevenSegDispHw.h:73
virtual uint8_t getBrghtnssMinLvl()
Returns the minimum display brightness level setting for the display.
Definition SevenSegDispHw.cpp:96
virtual bool getIsOn()
Returns the state of the display.
Definition SevenSegDispHw.cpp:116
uint8_t _brghtnssLvlMin
Minimum display brightness level.
Definition SevenSegDispHw.h:76
uint8_t getHwDspDigitsQty()
Returns the quantity of digits of the display module.
Definition SevenSegDispHw.cpp:111
virtual bool setDigitsOrder(uint8_t *newOrderPtr)
Sets a mapping to relate the display buffer positions to the display port assigned to exhibit it's co...
Definition SevenSegDispHw.cpp:136
uint8_t * _xcdDspBuffPtr
A pointer to a buffer the size of the exceeding digits used to control display specific amenities.
Definition SevenSegDispHw.h:83
void setDspBuffPtr(uint8_t *newDspBuffPtr)
Sets the pointer to the Display Buffer memory area.
Definition SevenSegDispHw.cpp:167
uint8_t _brghtnssLvlMax
Maximum display brightness level.
Definition SevenSegDispHw.h:75
SevenSegDynDummy(uint8_t dspDigits=4, bool commAnode=true)
Class constructor, instantiates a SevenSegDynDummy object.
Definition SevenSegDispHw.cpp:344
bool end()
Stops the active display updating.
Definition SevenSegDispHw.cpp:396
virtual ~SevenSegDynDummy()
Class destructor.
Definition SevenSegDispHw.cpp:349
bool begin(uint32_t updtLps=0)
Sets up the required resources for the "dummy hardware display" to work.
Definition SevenSegDispHw.cpp:361
virtual void turnOn()
Turns the display module on.
Definition SevenSegDispHw.cpp:463
virtual void turnOff()
Turns the display module off.
Definition SevenSegDispHw.cpp:456
SevenSegDynHC595(uint8_t *ioPins, uint8_t dspDigits, bool commAnode)
Class constructor.
Definition SevenSegDispHw.cpp:245
virtual ~SevenSegDynHC595()
Class destructor.
Definition SevenSegDispHw.cpp:253
virtual bool begin(uint32_t updtLps=0)
Sets up the required resources for the hardware display to work.
Definition SevenSegDispHw.cpp:267
bool end()
Stops the active display updating.
Definition SevenSegDispHw.cpp:299
virtual bool begin(uint32_t updtLps=0)
Sets up the hardware display to work.
Definition SevenSegDispHw.cpp:223
virtual bool end()
Reverts the begin(uint32_t) actions, stopping the display activities, stopping and deleting the timer...
Definition SevenSegDispHw.cpp:228
virtual void turnOff()
Turns the display module off.
Definition SevenSegDispHw.cpp:917
virtual bool setBrghtnssLvl(const uint8_t &newBrghtnssLvl)
Sets the brightness level for the display module.
Definition SevenSegDispHw.cpp:903
virtual bool getIsOn()
Returns a value indicating if the display controller is in working/On or shutdown/Off mode.
Definition SevenSegDispHw.cpp:861
virtual void ntfyUpdDsply()
See SevenSegDispHw::ntfyUpdDsply() for description.
Definition SevenSegDispHw.cpp:866
bool end()
Ends the active mode of the display by shutting it off.
Definition SevenSegDispHw.cpp:854
bool begin(uint32_t updtLps=0)
Sets up the hardware display to work, and starts the display activities.
Definition SevenSegDispHw.cpp:825
uint8_t * _lclDspBuffPtr
Pointer to an array of size equal to _dspDigitsQty, the local buffer differs from the shared _dspBuff...
Definition SevenSegDispHw.h:867
virtual void turnOn()
Turns the display module on.
Definition SevenSegDispHw.cpp:926
SevenSegMax7219()
Default class constructor.
Definition SevenSegDispHw.cpp:804
~SevenSegMax7219()
Class destructor.
Definition SevenSegDispHw.cpp:820
virtual bool begin(uint32_t updtLps=0)
Sets up the hardware display to work, and starts the display activities.
Definition SevenSegDispHw.cpp:498
SevenSegStatHC595()
Class default constructor.
Definition SevenSegDispHw.cpp:485
virtual ~SevenSegStatHC595()
Class destructor.
Definition SevenSegDispHw.cpp:496
virtual void ntfyUpdDsply()
See SevenSegDispHw::ntfyUpdDsply() for description.
Definition SevenSegDispHw.cpp:505
SevenSegTM1636()
Default constructor.
Definition SevenSegDispHw.cpp:756
virtual ~SevenSegTM1636()
Default destructor.
Definition SevenSegDispHw.cpp:763
SevenSegTM1637()
Default constructor.
Definition SevenSegDispHw.cpp:772
~SevenSegTM1637()
Default destructor.
Definition SevenSegDispHw.cpp:779
~SevenSegTM1639()
Default destructor.
Definition SevenSegDispHw.cpp:795
SevenSegTM1639()
Default constructor.
Definition SevenSegDispHw.cpp:788
virtual void turnOn()
Turns the display module on.
Definition SevenSegDispHw.cpp:672
bool begin(uint32_t updtLps=0)
Turns On the display to be ready to receive data.
Definition SevenSegDispHw.cpp:547
~SevenSegTM163X()
Class destructor.
Definition SevenSegDispHw.cpp:542
virtual uint8_t getBrghtnssLvl()
Returns the current brightness level setting for the display module.
Definition SevenSegDispHw.cpp:563
virtual bool setBrghtnssLvl(const uint8_t &newBrghtnssLvl)
Sets the Brightness level of the display.
Definition SevenSegDispHw.cpp:649
SevenSegTM163X()
Default class constructor.
Definition SevenSegDispHw.cpp:527
bool end()
Turns Off the display.
Definition SevenSegDispHw.cpp:557
uint8_t * _lclDspBuffPtr
Pointer to an array of size equal to or less than display module component digits ports,...
Definition SevenSegDispHw.h:601
virtual void turnOff()
Turns the display module off.
Definition SevenSegDispHw.cpp:663
virtual void ntfyUpdDsply()
See SevenSegDispHw::ntfyUpdDsply() for description.
Definition SevenSegDispHw.cpp:568