40#ifndef sevenSegDispHw_ESP32_H
41#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};
80 uint8_t _dspHwInstNbr{0};
83 virtual void _send(uint8_t* digitsBuffer);
84 virtual void _send(
const uint8_t &segments,
const uint8_t &port);
86 virtual void _sendDataUnit(
void* dataUnit);
87 virtual void _sendMssg(
void* dataMssg);
105 SevenSegDispHw(uint8_t* ioPins, uint8_t dspDigits = 4,
bool commAnode =
true);
125 virtual bool begin(uint32_t updtLps = 0);
281 virtual void turnOn(
const uint8_t &newBrghtnssLvl);
292 static void tmrCbRfrshDyn(TimerHandle_t rfrshTmrCbArg);
295 virtual void _unAbstract() = 0;
298 TimerHandle_t _dynDspRfrshTmrHndl{NULL};
299 uint8_t _firstRefreshed{0};
300 String _rfrshTmrName{
""};
303 virtual void _send(uint8_t content);
304 virtual void _send(
const uint8_t &segments,
const uint8_t &port);
321 virtual bool begin(uint32_t updtLps=0);
342 static void tmrCbRfrshDynHC595(TimerHandle_t rfrshTmrCbArg);
345 const uint8_t _sclkIndx {0};
346 const uint8_t _rclkIndx {1};
347 const uint8_t _dioIndx {2};
349 ShiftRegGPIOXpander* _drvrShftRegPtr{
nullptr};
350 uint8_t* _drvrShftRegSndPtr{
nullptr};
355 virtual void _unAbstract();
358 TimerHandle_t _dynHC595DspRfrshTmrHndl{NULL};
361 virtual void send(uint8_t content){};
362 virtual void send(
const uint8_t &segments,
const uint8_t &port){};
393 virtual bool begin(uint32_t updtLps = 0);
427 static void tmrCbRfrshDynDummy(TimerHandle_t rfrshTmrCbArg);
430 virtual void _unAbstract();
434 TimerHandle_t _dynDummyDspRfrshTmrHndl{NULL};
437 virtual void send(
const uint8_t &segments,
const uint8_t &port);
465 bool begin(uint32_t updtLps = 0);
501 virtual void _unAbstract() = 0;
507 SevenSegStatic(uint8_t* ioPins, uint8_t dspDigits = 4,
bool commAnode =
true);
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);
587 const uint8_t _clkIndx {0};
588 const uint8_t _dioIndx {1};
589 const uint8_t _dspDigitsQtyMax{};
590 const uint8_t _hwBrghtnssLvlMax{0x07};
591 const uint8_t _hwBrghtnssLvlMin{0x00};
592 uint32_t _txClkTckTm{2};
596 virtual void _unAbstract() = 0;
597 void _updDsplyCntnt();
607 void _txWrByte(uint8_t data);
608 virtual void _sendBffr();
609 virtual bool _sendByte(uint8_t data);
625 SevenSegTM163X(uint8_t* ioPins, uint8_t dspDigits,
bool commAnode, uint8_t dspContMaxDigits);
639 bool begin(uint32_t updtLps = 0);
688 virtual void turnOn(
const uint8_t &newBrghtnssLvl);
703 const uint8_t _dspDigitsQtyMax{4};
704 virtual void _unAbstract();
718 SevenSegTM1636(uint8_t* ioPins, uint8_t dspDigits,
bool commAnode);
737 const uint8_t _dspDigitsQtyMax{6};
738 virtual void _unAbstract();
752 SevenSegTM1637(uint8_t* ioPins, uint8_t dspDigits,
bool commAnode);
771 const uint8_t _dspDigitsQtyMax{8};
772 virtual void _unAbstract();
786 SevenSegTM1639(uint8_t* ioPins, uint8_t dspDigits,
bool commAnode);
833 const uint8_t _NoOpAddr{0x00};
834 const uint8_t _DspPortsBaseAddr{0x01};
835 const uint8_t _DecodeModeAddr{0x09};
836 const uint8_t _BrghtnsSettAddr{0x0A};
837 const uint8_t _ScanLimitAddr{0x0B};
838 const uint8_t _ShutDownAddr{0x0C};
839 const uint8_t _DspTestAddr{0x0F};
842 const uint8_t _DisplayTestMode{0x01};
843 const uint8_t _NoDecode{0x00};
844 const uint8_t _NormalOp{0x00};
845 const uint8_t _TurnOff{0x00};
846 const uint8_t _TurnOn{0x01};
849 const uint8_t _clkIndx {0};
850 const uint8_t _dinIndx {1};
851 const uint8_t _csIndx {2};
853 const uint8_t _dspDigitsQtyMax{8};
854 const uint8_t _hwBrghtnssLvlMax{0x0F};
855 const uint8_t _hwBrghtnssLvlMin{0x00};
861 uint8_t _cnvrtStdDgtTo72xxDgt(
const uint8_t &StdDgt);
862 virtual void _unAbstract();
863 void _updLclBffrCntnt();
868 virtual void _sendByte(
const uint8_t &val,
const bool &MSbFrst =
true);
869 virtual void send(
const uint8_t &address,
const uint8_t &data,
const bool &MSbFrst =
true);
870 virtual void _sendBffr();
901 bool begin(uint32_t updtLps = 0);
948 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:110
virtual void turnOff()
Turns the display module off.
Definition sevenSegDispHw.cpp:162
virtual uint8_t getBrghtnssLvl()
Returns the current display brightness level setting for the display.
Definition sevenSegDispHw.cpp:75
virtual bool end()
Reverts the begin(uint32_t) actions, stopping the display activities, turning the display off and fre...
Definition sevenSegDispHw.cpp:64
virtual ~SevenSegDispHw()
Class destructor.
Definition sevenSegDispHw.cpp:50
uint8_t * getDspBuffPtr()
Returns a pointer to the display buffer.
Definition sevenSegDispHw.cpp:95
virtual bool setBrghtnssLvl(const uint8_t &newBrghtnssLvl)
Sets the brightness level for the display.
Definition sevenSegDispHw.cpp:135
SevenSegDispHw()
Default class constructor.
Definition sevenSegDispHw.cpp:38
bool _isOn
Current display status: On/Off.
Definition sevenSegDispHw.h:81
uint8_t * _dspBlankBuffPtr
Pointer to a display buffer filled with _allLedsOff ("spaces") to use as display buffer while in "Off...
Definition sevenSegDispHw.h:76
bool getCommAnode()
Returns a value indicating if the display module component of the display hardware uses a common anod...
Definition sevenSegDispHw.cpp:90
virtual bool begin(uint32_t updtLps=0)
Sets up the hardware display to work, and starts the display activities.
Definition sevenSegDispHw.cpp:58
uint8_t * _dspBuffPtrBkp
Pointer to the display buffer, copy of the original **_dspBuffPtr** to be used as backup.
Definition sevenSegDispHw.h:78
uint8_t _brghtnssLvl
Current display brightness level.
Definition sevenSegDispHw.h:73
virtual uint8_t getBrghtnssMaxLvl()
Returns the maximum display brightness level setting allowed for the display.
Definition sevenSegDispHw.cpp:80
virtual void turnOn()
Turns the display module on.
Definition sevenSegDispHw.cpp:176
uint8_t * _dspBuffPtr
Pointer to the display buffer, will be provided by the SevenSegDisplays object when it's instantiated...
Definition sevenSegDispHw.h:77
uint8_t _allLedsOff
Value to set in the display port to set all leds off (a "space"), dependent of _commAnode.
Definition sevenSegDispHw.h:72
virtual uint8_t getBrghtnssMinLvl()
Returns the minimum display brightness level setting for the display.
Definition sevenSegDispHw.cpp:85
virtual bool getIsOn()
Returns the state of the display.
Definition sevenSegDispHw.cpp:105
uint8_t _brghtnssLvlMin
Minimum display brightness level.
Definition sevenSegDispHw.h:75
uint8_t getHwDspDigitsQty()
Returns the quantity of digits of the display module.
Definition sevenSegDispHw.cpp:100
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:140
void setDspBuffPtr(uint8_t *newDspBuffPtr)
Sets the pointer to the Display Buffer memory area.
Definition sevenSegDispHw.cpp:155
uint8_t _brghtnssLvlMax
Maximum display brightness level.
Definition sevenSegDispHw.h:74
Models a dynamic display with no screen, for tests or remote display of the data.
Definition sevenSegDispHw.h:426
SevenSegDynDummy(uint8_t dspDigits=4, bool commAnode=true)
Class constructor, instantiates a SevenSegDynDummy object.
Definition sevenSegDispHw.cpp:347
bool end()
Stops the active display updating.
Definition sevenSegDispHw.cpp:399
virtual ~SevenSegDynDummy()
Class destructor
Definition sevenSegDispHw.cpp:352
bool begin(uint32_t updtLps=0)
Sets up the required resources for the "dummy hardware display" to work.
Definition sevenSegDispHw.cpp:364
virtual void turnOn()
Turns the display module on.
Definition sevenSegDispHw.cpp:466
virtual void turnOff()
Turns the display module off.
Definition sevenSegDispHw.cpp:459
Models seven segment displays driven by two 74HC595 shift registers.
Definition sevenSegDispHw.h:341
SevenSegDynHC595(uint8_t *ioPins, uint8_t dspDigits, bool commAnode)
Class constructor.
Definition sevenSegDispHw.cpp:243
virtual ~SevenSegDynHC595()
Class destructor.
Definition sevenSegDispHw.cpp:254
virtual bool begin(uint32_t updtLps=0)
Sets up the required resources for the hardware display to work.
Definition sevenSegDispHw.cpp:268
bool end()
Stops the active display updating.
Definition sevenSegDispHw.cpp:299
Abstract class models a generic dynamically updated Seven Segment display hardware
Definition sevenSegDispHw.h:291
virtual bool begin(uint32_t updtLps=0)
Sets up the hardware display to work.
Definition sevenSegDispHw.cpp:211
virtual bool end()
Reverts the begin(uint32_t) actions, stopping the display activities, stopping and deleting the timer...
Definition sevenSegDispHw.cpp:216
Models a Seven Segment display hardware using a Max7219 display controller component
Definition sevenSegDispHw.h:831
virtual void turnOff()
Turns the display module off.
Definition sevenSegDispHw.cpp:933
virtual bool setBrghtnssLvl(const uint8_t &newBrghtnssLvl)
Sets the brightness level for the display module.
Definition sevenSegDispHw.cpp:919
virtual bool getIsOn()
Returns a value indicating if the display controller is in working/On or shutdown/Off mode.
Definition sevenSegDispHw.cpp:874
virtual void ntfyUpdDsply()
See SevenSegDispHw::ntfyUpdDsply() for description.
Definition sevenSegDispHw.cpp:879
bool end()
Ends the active mode of the display by shutting it off.
Definition sevenSegDispHw.cpp:867
bool begin(uint32_t updtLps=0)
Sets up the hardware display to work, and starts the display activities.
Definition sevenSegDispHw.cpp:843
uint8_t * _lclDspBuffPtr
Pointer to an array of size equal to _dspDigitsQty, the local buffer differs from the shared _dspBuff...
Definition sevenSegDispHw.h:866
virtual void turnOn()
Turns the display module on.
Definition sevenSegDispHw.cpp:942
SevenSegMax7219()
Default class constructor.
Definition sevenSegDispHw.cpp:813
~SevenSegMax7219()
Class destructor.
Definition sevenSegDispHw.cpp:838
Models displays driven by 74HC595 or similar shift registers, one shift register per display port,...
Definition sevenSegDispHw.h:522
SevenSegStatHC595()
Class default constructor.
Definition sevenSegDispHw.cpp:488
virtual ~SevenSegStatHC595()
Class destructor.
Definition sevenSegDispHw.cpp:501
virtual void ntfyUpdDsply()
See SevenSegDispHw::ntfyUpdDsply() for description.
Definition sevenSegDispHw.cpp:503
Abstract class that models displays that don't need permanent MCU data updating to keep the data corr...
Definition sevenSegDispHw.h:499
Models a Seven Segment display hardware controlled by a TM1636 display controller component.
Definition sevenSegDispHw.h:701
SevenSegTM1636()
Default constructor.
Definition sevenSegDispHw.cpp:765
virtual ~SevenSegTM1636()
Default destructor.
Definition sevenSegDispHw.cpp:772
Models a Seven Segment display hardware controlled by a TM1637 display controller component.
Definition sevenSegDispHw.h:735
SevenSegTM1637()
Default constructor.
Definition sevenSegDispHw.cpp:781
~SevenSegTM1637()
Default destructor.
Definition sevenSegDispHw.cpp:788
Models a Seven Segment display hardware controlled by a TM1639 display controller component.
Definition sevenSegDispHw.h:769
~SevenSegTM1639()
Default destructor.
Definition sevenSegDispHw.cpp:804
SevenSegTM1639()
Default constructor.
Definition sevenSegDispHw.cpp:797
Abstract class that models Seven Segments LEDs static displays hardware using Titan Micro TM163X seri...
Definition sevenSegDispHw.h:585
virtual void turnOn()
Turns the display module on.
Definition sevenSegDispHw.cpp:681
bool begin(uint32_t updtLps=0)
Turns On the display to be ready to receive data.
Definition sevenSegDispHw.cpp:560
~SevenSegTM163X()
Class destructor.
Definition sevenSegDispHw.cpp:553
virtual uint8_t getBrghtnssLvl()
Returns the current brightness level setting for the display module.
Definition sevenSegDispHw.cpp:572
virtual bool setBrghtnssLvl(const uint8_t &newBrghtnssLvl)
Sets the Brightness level of the display.
Definition sevenSegDispHw.cpp:658
uint8_t * _xcdDspBuffPtr
A pointer to a buffer the size of the exceeding digits used to control display specific amenities.
Definition sevenSegDispHw.h:601
SevenSegTM163X()
Default class constructor.
Definition sevenSegDispHw.cpp:525
bool end()
Turns Off the display.
Definition sevenSegDispHw.cpp:566
uint8_t _xcdDspDigitsQty
Number of unused available display ports, its the difference (_dspDigitsQtyMax - _dspDigitsQty),...
Definition sevenSegDispHw.h:602
uint8_t * _lclDspBuffPtr
Pointer to an array of size equal to or less than display module component digits ports,...
Definition sevenSegDispHw.h:600
virtual void turnOff()
Turns the display module off.
Definition sevenSegDispHw.cpp:672
virtual void ntfyUpdDsply()
See SevenSegDispHw::ntfyUpdDsply() for description.
Definition sevenSegDispHw.cpp:577