| ButtonToSwitch Library for Arduino v4.5.0 A library that provides elaborated switch mechanism behavior simulation for digital signals inputs

Loading...
Searching...
No Matches
ButtonToSwitch.h
1
48#ifndef _BUTTONTOSWITCH_H_
49#define _BUTTONTOSWITCH_H_
50
51#include <Arduino.h>
52#include <stdint.h>
53
54//===========================>> BEGIN General use constant definitions
55#define _HwMinDbncTime 20 //Documented minimum wait time for a MPB signal to stabilize
56#define _StdPollDelay 10
57#define _MinSrvcTime 100
58#define _InvalidPinNum 0xFF // Value to give as "yet to be defined", the "Valid pin number" range and characteristics are development platform and environment related
59
60/*---------- DbncdMPBttn complete status related constants, argument structs, information packing and unpacking BEGIN -------*/
61 const uint8_t IsOnBitPos {0};
62 const uint8_t IsEnabledBitPos{1};
63 const uint8_t PilotOnBitPos{2};
64 const uint8_t WrnngOnBitPos{3};
65 const uint8_t IsVoidedBitPos{4};
66 const uint8_t IsOnScndryBitPos{5};
67 const uint8_t OtptCurValBitPos{16};
68//===========================>> END General use constant definitions
69
70#ifndef MPBOTPTS_T
71 #define MPBOTPTS_T
78 struct MpbOtpts_t{
79 bool isOn;
80 bool isEnabled;
81 bool pilotOn;
82 bool wrnngOn;
83 bool isVoided;
84 bool isOnScndry;
85 uint16_t otptCurVal;
86 };
87#endif
88/*---------------- DbncdMPBttn complete status related constants, argument structs, information packing and unpacking END -------*/
89
90// Definition workaround to let a function/method return value to be a function pointer
91 typedef void (*fncPtrType)();
92 typedef fncPtrType (*ptrToTrnFnc)();
93
94/* Definition workaround to let a function/method return value to be a function pointer
95 to a function that receives a void* argument and returns no values: void (funcName*)(void*)
96 The resulting **fncVdPtrPrmPtrType** type then defines a pointer to a function of the described properties and signature*/
97 typedef void (*fncVdPtrPrmPtrType)(void*);
98 typedef fncVdPtrPrmPtrType (*ptrToTrnFncVdPtr)(void*);
99//===========================>> BEGIN General use function prototypes
100 MpbOtpts_t otptsSttsUnpkg(uint32_t pkgOtpts);
101 unsigned long int findMCD(unsigned long int a, unsigned long int b);
102//===========================>> END General use function prototypes
103
128
129//==========================================================>> Classes declarations BEGIN
130
140 class DbncdMPBttn{
141 static DbncdMPBttn** _mpbsInstncsLstPtr;
142 static unsigned long int _updTimerPeriod;
143/*
144 * This is the callback function to be executed by the TimerOne managed timer INT.
145 *
146 * The callback function duties:
147 * - Verify for a valid **_mpbsInstncsLstPtr**, if it's nullptr something failed, correct it by disabling the timer
148 * - Save the **current time** for reference and traverse the list till the end (nullptr).
149 * - For each MPB in the list verify the _updTmrAttchd == true
150 * - If _updTmrAttchd == true -> verify the ("current time" - _lstPollTime) >= _pollPeriodMs. If the condition is true:
151 * - Execute the objects mpbPollCallback()
152 * - Set _lstPollTime = "current time" *
153 */
154 static void _ISRMpbsRfrshCb();
155
156 protected:
157 enum fdaDmpbStts {
158 stOffNotVPP,
159 stOffVPP,
160 stOn,
161 stOnVRP,
162 stDisabled
163 };
164 const unsigned long int _stdMinDbncTime {_HwMinDbncTime};
165
166 uint8_t _mpbttnPin{};
167 bool _pulledUp{};
168 bool _typeNO{};
169 unsigned long int _dbncTimeOrigSett{};
170
171 bool _beginDisabled{false};
172 unsigned long int _dbncRlsTimerStrt{0};
173 unsigned long int _dbncRlsTimeTempSett{0};
174 unsigned long int _dbncTimerStrt{0};
175 unsigned long int _dbncTimeTempSett{0};
176 fncVdPtrPrmPtrType _fnVdPtrPrmWhnTrnOff{nullptr}; // _fVPPWhnTrnOff
177 void* _fnVdPtrPrmWhnTrnOffArgPtr{nullptr}; // _fVPPWhnTrnOffArgPtr
178 fncVdPtrPrmPtrType _fnVdPtrPrmWhnTrnOn{nullptr}; // _fVPPWhnTrnOn
179 void* _fnVdPtrPrmWhnTrnOnArgPtr{nullptr}; // _fVPPWhnTrnOnArgPtr
180 void (*_fnWhnTrnOff)() {nullptr};
181 void (*_fnWhnTrnOn)() {nullptr};
182
183 bool _isEnabled{true};
184 volatile bool _isOn{false};
185 bool _isOnDisabled{false};
186 volatile bool _isPressed{false};
187 unsigned long int _lstPollTime{0};
188 fdaDmpbStts _mpbFdaState {stOffNotVPP};
189 DbncdMPBttn* _mpbInstnc{nullptr};
190 volatile bool _outputsChange {false};
191 uint32_t _outputsChangeCnt{0};
192 unsigned long int _pollPeriodMs{0};
193 bool _prssRlsCcl{false};
194 unsigned long int _strtDelay {0};
195 bool _sttChng {true};
196 bool _updTmrAttchd{false};
197 volatile bool _validDisablePend{false};
198 volatile bool _validEnablePend{false};
199 volatile bool _validPressPend{false};
200 volatile bool _validReleasePend{false};
201
202 void clrSttChng();
203 const bool getIsPressed() const;
204 virtual void mpbPollCallback();
205 virtual uint32_t _otptsSttsPkg(uint32_t prevVal = 0);
206 void _popMpb(DbncdMPBttn** &DMpbTmrUpdLst, DbncdMPBttn* mpbToPop);
207 void _pushMpb(DbncdMPBttn** &DMpbTmrUpdLst, DbncdMPBttn* mpbToPush);
208 void _setIsEnabled(const bool &newEnabledValue);
209 void _setLstPollTime(const unsigned long int &newLstPollTIme);
210 void setSttChng();
211 void _turnOff();
212 void _turnOn();
213 virtual void updFdaState();
214 bool updIsPressed();
215 unsigned long int _updTmrsMCDCalc();
216 virtual bool updValidPressesStatus();
217
218 public:
223 DbncdMPBttn();
232 DbncdMPBttn(const uint8_t &mpbttnPin, const bool &pulledUp = true, const bool &typeNO = true, const unsigned long int &dbncTimeOrigSett = 0);
238 DbncdMPBttn(const DbncdMPBttn& other);
243 virtual ~DbncdMPBttn();
261 virtual bool begin(const unsigned long int &pollDelayMs = _StdPollDelay);
272 void clrStatus(bool clrIsOn = true);
283 void disable();
293 void enable();
307 bool end();
315 const unsigned long int getCurDbncTime() const;
326 fncPtrType getFnWhnTrnOff();
337 fncPtrType getFnWhnTrnOn();
346 fncVdPtrPrmPtrType getFVPPWhnTrnOff();
352 void* getFVPPWhnTrnOffArgPtr();
361 fncVdPtrPrmPtrType getFVPPWhnTrnOn();
367 void* getFVPPWhnTrnOnArgPtr();
376 const bool getIsEnabled() const;
385 const bool getIsOn () const;
397 const bool getIsOnDisabled() const;
405 const unsigned long int getLstPollTime();
413 const uint32_t getOtptsSttsPkgd();
424 const bool getOutputsChange() const;
434 const unsigned long int getPollPeriodMs();
444 unsigned long int getStrtDelay();
454 bool getUpdTmrAttchd();
460 bool init(const uint8_t &mpbttnPin, const bool &pulledUp = true, const bool &typeNO = true, const unsigned long int &dbncTimeOrigSett = 0);
471 bool pause();
477 void resetDbncTime();
483 void resetFda();
494 bool resume();
502 void setBeginDisabled(const bool &newBeginDisabled = false);
514 bool setDbncTime(const unsigned long int &newDbncTime);
522 void setFnWhnTrnOffPtr(void(*newFnWhnTrnOff)());
530 void setFnWhnTrnOnPtr(void (*newFnWhnTrnOn)());
539 void setFVPPWhnTrnOff(fncVdPtrPrmPtrType newFVPPWhnTrnOff, void* argPtr = nullptr);
547 void setFVPPWhnTrnOffArgPtr(void* newFVPPWhnTrnOffArgPtr);
556 void setFVPPWhnTrnOn(fncVdPtrPrmPtrType newFVPPWhnTrnOn, void* argPtr = nullptr);
564 void setFVPPWhnTrnOnArgPtr(void* newFVPPWhnTrnOnArgPtr);
575 void setIsOnDisabled(const bool &newIsOnDisabled);
583 void setOutputsChange(bool newOutputsChange);
584
585};
586
587//==========================================================>>
588
598 class DbncdDlydMPBttn: public DbncdMPBttn{
599 public:
604 DbncdDlydMPBttn();
614 DbncdDlydMPBttn(const uint8_t &mpbttnPin, const bool &pulledUp = true, const bool &typeNO = true, const unsigned long int &dbncTimeOrigSett = 0, const unsigned long int &strtDelay = 0);
620 DbncdDlydMPBttn(const DbncdDlydMPBttn& other);
624 virtual ~DbncdDlydMPBttn();
633 bool init(const uint8_t &mpbttnPin, const bool &pulledUp = true, const bool &typeNO = true, const unsigned long int &dbncTimeOrigSett = 0, const unsigned long int &strtDelay = 0);
643 void setStrtDelay(const unsigned long int &newStrtDelay);
644};
645
646//==========================================================>>
647
664 class LtchMPBttn: public DbncdDlydMPBttn{
665 protected:
666 enum fdaLmpbStts {
667 stOffNotVPP,
668 stOffVPP,
669 stOnNVRP,
670 stOnVRP,
671 stLtchNVUP,
672 stLtchdVUP,
673 stOffVUP,
674 stOffNVURP,
675 stOffVURP,
676 stDisabled
677 };
678 bool _isLatched{false};
679 fdaLmpbStts _mpbFdaState {stOffNotVPP};
680 bool _trnOffASAP{true};
681 volatile bool _validUnlatchPend{false};
682 volatile bool _validUnlatchRlsPend{false};
683
684 virtual void mpbPollCallback();
685 virtual void stDisabled_In(){};
686 virtual void stDisabled_Out(){};
687 virtual void stLtchNVUP_Do(){};
688 virtual void stOffNotVPP_In(){};
689 virtual void stOffNotVPP_Out(){};
690 virtual void stOffNVURP_Do(){};
691 virtual void stOffVPP_Out(){};
692 virtual void stOffVURP_Out(){};
693 virtual void stOnNVRP_Do(){};
694 virtual void updFdaState();
695 virtual void updValidUnlatchStatus() = 0;
696 public:
700 LtchMPBttn();
706 LtchMPBttn(const uint8_t &mpbttnPin, const bool &pulledUp = true, const bool &typeNO = true, const unsigned long int &dbncTimeOrigSett = 0, const unsigned long int &strtDelay = 0);
712 LtchMPBttn(const LtchMPBttn& other);
716 virtual ~LtchMPBttn();
720 virtual bool begin(const unsigned long int &pollDelayMs = _StdPollDelay);
724 void clrStatus(bool clrIsOn = true);
733 const bool getIsLatched() const;
743 bool getTrnOffASAP();
751 const bool getUnlatchPend() const;
759 const bool getUnlatchRlsPend() const;
771 void setTrnOffASAP(const bool &newVal);
779 void setUnlatchPend(const bool &newVal);
787 void setUnlatchRlsPend(const bool &newVal);
798 bool unlatch();
799};
800
801//==========================================================>>
802
810 class TgglLtchMPBttn: public LtchMPBttn{
811 protected:
812 virtual void stOffNVURP_Do();
813 virtual void updValidUnlatchStatus();
814
815 public:
820 TgglLtchMPBttn();
826 TgglLtchMPBttn(const uint8_t &mpbttnPin, const bool &pulledUp = true, const bool &typeNO = true, const unsigned long int &dbncTimeOrigSett = 0, const unsigned long int &strtDelay = 0);
832 TgglLtchMPBttn(const TgglLtchMPBttn& other);
836 virtual ~TgglLtchMPBttn();
837};
838
839//==========================================================>>
840
850 class TmLtchMPBttn: public LtchMPBttn{
851 protected:
852 bool _tmRstbl {true};
853 unsigned long int _srvcTime {};
854 unsigned long int _srvcTimerStrt{0};
855
856 virtual void stOffNotVPP_Out();
857 virtual void stOffVPP_Out();
858 virtual void updValidUnlatchStatus();
859
860 public:
865 TmLtchMPBttn();
873 TmLtchMPBttn(const uint8_t &mpbttnPin, const unsigned long int &svcTime, const bool &pulledUp = true, const bool &typeNO = true, const unsigned long int &dbncTimeOrigSett = 0, const unsigned long int &strtDelay = 0);
879 TmLtchMPBttn(const TmLtchMPBttn &other);
883 virtual ~TmLtchMPBttn();
887 void clrStatus(bool clrIsOn = true);
893 const unsigned long int getSrvcTime() const;
906 bool setSrvcTime(const unsigned long int &newSrvcTime);
914 void setTmerRstbl(const bool &newIsRstbl);
915};
916
917//==========================================================>>
918
929 class HntdTmLtchMPBttn: public TmLtchMPBttn{
930 protected:
931 unsigned int _wrnngPrctg {0};
932
933 fncVdPtrPrmPtrType _fnVdPtrPrmWhnTrnOffPilot{nullptr}; // _fVPPWhnTrnOffPilot
934 void* _fnVdPtrPrmWhnTrnOffPilotArgPtr{nullptr}; // _fVPPWhnTrnOffPilotArgPtr
935 fncVdPtrPrmPtrType _fnVdPtrPrmWhnTrnOnPilot{nullptr}; // _fVPPWhnTrnOnPilot
936 void* _fnVdPtrPrmWhnTrnOnPilotArgPtr{nullptr}; // _fVPPWhnTrnOnPilotArgPtr
937 fncVdPtrPrmPtrType _fnVdPtrPrmWhnTrnOffWrnng{nullptr}; // _fVPPWhnTrnOffWrnng
938 void* _fnVdPtrPrmWhnTrnOffWrnngArgPtr{nullptr}; // _fVPPWhnTrnOffWrnngArgPtr
939 fncVdPtrPrmPtrType _fnVdPtrPrmWhnTrnOnWrnng{nullptr}; // _fVPPWhnTrnOnWrnng
940 void* _fnVdPtrPrmWhnTrnOnWrnngArgPtr{nullptr}; // _fVPPWhnTrnOnWrnngArgPtr
941 void (*_fnWhnTrnOffPilot)() {nullptr};
942 void (*_fnWhnTrnOffWrnng)() {nullptr};
943 void (*_fnWhnTrnOnPilot)() {nullptr};
944 void (*_fnWhnTrnOnWrnng)() {nullptr};
945 bool _keepPilot{false};
946 volatile bool _pilotOn{false};
947 unsigned long int _wrnngMs{0};
948 volatile bool _wrnngOn {false};
949
950 bool _validWrnngSetPend{false};
951 bool _validWrnngResetPend{false};
952 bool _validPilotSetPend{false};
953 bool _validPilotResetPend{false};
954
955 virtual void mpbPollCallback();
956 uint32_t _otptsSttsPkg(uint32_t prevVal = 0);
957 virtual void stDisabled_In();
958 virtual void stLtchNVUP_Do();
959 virtual void stOffNotVPP_In();
960 virtual void stOffVPP_Out();
961 virtual void stOnNVRP_Do();
962 void _turnOffPilot();
963 void _turnOffWrnng();
964 void _turnOnPilot();
965 void _turnOnWrnng();
966 bool updPilotOn();
967 bool updWrnngOn();
968 public:
973 HntdTmLtchMPBttn();
981 HntdTmLtchMPBttn(const uint8_t &mpbttnPin, const unsigned long int &svcTime, const unsigned int &wrnngPrctg = 0, const bool &pulledUp = true, const bool &typeNO = true, const unsigned long int &dbncTimeOrigSett = 0, const unsigned long int &strtDelay = 0);
987 HntdTmLtchMPBttn(const HntdTmLtchMPBttn &other);
991 ~HntdTmLtchMPBttn();
995 virtual bool begin(const unsigned long int &pollDelayMs = _StdPollDelay);
999 void clrStatus(bool clrIsOn = true);
1010 fncPtrType getFnWhnTrnOffPilot();
1021 fncPtrType getFnWhnTrnOffWrnng();
1032 fncPtrType getFnWhnTrnOnPilot();
1043 fncPtrType getFnWhnTrnOnWrnng();
1052 fncVdPtrPrmPtrType getFVPPWhnTrnOffPilot();
1058 void* getFVPPWhnTrnOffPilotArgPtr();
1067 fncVdPtrPrmPtrType getFVPPWhnTrnOnPilot();
1073 void* getFVPPWhnTrnOnPilotArgPtr();
1082 fncVdPtrPrmPtrType getFVPPWhnTrnOffWrnng();
1088 void* getFVPPWhnTrnOffWrnngArgPtr();
1097 fncVdPtrPrmPtrType getFVPPWhnTrnOnWrnng();
1103 void* getFVPPWhnTrnOnWrnngArgPtr();
1113 const bool getPilotOn() const;
1125 const bool getWrnngOn() const;
1133 void setFnWhnTrnOffPilotPtr(void(*newFnWhnTrnOff)());
1141 void setFnWhnTrnOffWrnngPtr(void(*newFnWhnTrnOff)());
1149 void setFnWhnTrnOnPilotPtr(void(*newFnWhnTrnOn)());
1157 void setFnWhnTrnOnWrnngPtr(void(*newFnWhnTrnOn)());
1166 void setFVPPWhnTrnOffPilot(fncVdPtrPrmPtrType newFVPPWhnTrnOff, void* argPtr = nullptr);
1174 void setFVPPWhnTrnOffPilotArgPtr(void* newFVPPWhnTrnOffArgPtr);
1183 void setFVPPWhnTrnOnPilot(fncVdPtrPrmPtrType newFVPPWhnTrnOn, void* argPtr = nullptr);
1191 void setFVPPWhnTrnOnPilotArgPtr(void* newFVPPWhnTrnOnArgPtr);
1200 void setFVPPWhnTrnOffWrnng(fncVdPtrPrmPtrType newFVPPWhnTrnOff, void* argPtr = nullptr);
1208 void setFVPPWhnTrnOffWrnngArgPtr(void* newFVPPWhnTrnOffArgPtr);
1217 void setFVPPWhnTrnOnWrnng(fncVdPtrPrmPtrType newFVPPWhnTrnOn, void* argPtr = nullptr);
1225 void setFVPPWhnTrnOnWrnngArgPtr(void* newFVPPWhnTrnOnArgPtr);
1231 void setKeepPilot(const bool &newKeepPilot);
1237 bool setSrvcTime(const unsigned long int &newSvcTime);
1249 bool setWrnngPrctg (const unsigned int &newWrnngPrctg);
1250};
1251
1252//==========================================================>>
1253
1262 class XtrnUnltchMPBttn: public LtchMPBttn{
1263 protected:
1264 DbncdDlydMPBttn* _unLtchBttn {nullptr};
1265 bool _xtrnUnltchPRlsCcl {false};
1266
1267 virtual void stOffNVURP_Do();
1268 virtual void updValidUnlatchStatus();
1269
1270 public:
1274 XtrnUnltchMPBttn();
1288 XtrnUnltchMPBttn(const uint8_t &mpbttnPin, DbncdDlydMPBttn* unLtchBttn,
1289 const bool &pulledUp, const bool &typeNO, const unsigned long int &dbncTimeOrigSett, const unsigned long int &strtDelay);
1297 XtrnUnltchMPBttn(const uint8_t &mpbttnPin,
1298 const bool &pulledUp, const bool &typeNO, const unsigned long int &dbncTimeOrigSett, const unsigned long int &strtDelay);
1302 virtual bool begin(const unsigned long int &pollDelayMs = _StdPollDelay);
1306 void clrStatus(bool clrIsOn = true);
1307};
1308
1309//==========================================================>>
1310
1335 class DblActnLtchMPBttn: public LtchMPBttn{
1336 protected:
1337 enum fdaDALmpbStts{
1338 stOffNotVPP,
1339 stOffVPP,
1340 stOnMPBRlsd,
1341 //--------
1342 stOnStrtScndMod,
1343 stOnScndMod,
1344 stOnEndScndMod,
1345 //--------
1346 stOnTurnOff,
1347 //--------
1348 stDisabled
1349 };
1350 volatile bool _isOnScndry{false};
1351 fdaDALmpbStts _mpbFdaState {stOffNotVPP};
1352 unsigned long _scndModActvDly {2000};
1353 unsigned long _scndModTmrStrt {0};
1354 bool _validScndModPend{false};
1355
1356 fncVdPtrPrmPtrType _fnVdPtrPrmWhnTrnOffScndry{nullptr}; // _fVPPWhnTrnOffScndry
1357 void* _fnVdPtrPrmWhnTrnOffScndryArgPtr{nullptr}; // _fVPPWhnTrnOffScndryArgPtr
1358 fncVdPtrPrmPtrType _fnVdPtrPrmWhnTrnOnScndry{nullptr}; // _fVPPWhnTrnOnScndry
1359 void* _fnVdPtrPrmWhnTrnOnScndryArgPtr{nullptr}; // _fVPPWhnTrnOnScndryArgPtr
1360 void (*_fnWhnTrnOffScndry)() {nullptr};
1361 void (*_fnWhnTrnOnScndry)() {nullptr};
1362
1363 virtual void mpbPollCallback();
1364 virtual uint32_t _otptsSttsPkg(uint32_t prevVal = 0);
1365 virtual void stDisabled_In(){};
1366 virtual void stOnEndScndMod_Out(){};
1367 virtual void stOnScndMod_Do() = 0;
1368 virtual void stOnStrtScndMod_In(){};
1369 virtual void _turnOffScndry();
1370 virtual void _turnOnScndry();
1371 virtual void updFdaState();
1372 virtual bool updValidPressesStatus();
1373 virtual void updValidUnlatchStatus();
1374
1375 public:
1379 DblActnLtchMPBttn();
1385 DblActnLtchMPBttn(const uint8_t &mpbttnPin, const bool &pulledUp = true, const bool &typeNO = true, const unsigned long int &dbncTimeOrigSett = 0, const unsigned long int &strtDelay = 0);
1389 ~DblActnLtchMPBttn();
1394 virtual bool begin(const unsigned long int &pollDelayMs = _StdPollDelay);
1398 void clrStatus(bool clrIsOn = true);
1407 fncPtrType getFnWhnTrnOffScndry();
1416 fncPtrType getFnWhnTrnOnScndry();
1425 fncVdPtrPrmPtrType getFVPPWhnTrnOffScndry();
1431 void* getFVPPWhnTrnOffScndryArgPtr();
1440 fncVdPtrPrmPtrType getFVPPWhnTrnOnScndry();
1446 void* getFVPPWhnTrnOnScndryArgPtr();
1454 bool getIsOnScndry();
1462 unsigned long getScndModActvDly();
1470 void setFnWhnTrnOffScndryPtr(void(*newFnWhnTrnOff)());
1478 void setFnWhnTrnOnScndryPtr(void (*newFnWhnTrnOn)());
1487 void setFVPPWhnTrnOffScndry(fncVdPtrPrmPtrType newFVPPWhnTrnOff, void* argPtr = nullptr);
1495 void setFVPPWhnTrnOffScndryArgPtr(void* newFVPPWhnTrnOffArgPtr);
1504 void setFVPPWhnTrnOnScndry(fncVdPtrPrmPtrType newFVPPWhnTrnOn, void* argPtr = nullptr);
1512 void setFVPPWhnTrnOnScndryArgPtr(void* newFVPPWhnTrnOnArgPtr);
1523 bool setScndModActvDly(const unsigned long &newVal);
1524};
1525
1526//==========================================================>>
1527
1540 class DDlydDALtchMPBttn: public DblActnLtchMPBttn{
1541 protected:
1542 virtual void stOnEndScndMod_Out();
1543 virtual void stOnScndMod_Do();
1544 virtual void stOnStrtScndMod_In();
1545 public:
1549 DDlydDALtchMPBttn();
1555 DDlydDALtchMPBttn(const uint8_t &mpbttnPin, const bool &pulledUp = true, const bool &typeNO = true, const unsigned long int &dbncTimeOrigSett = 0, const unsigned long int &strtDelay = 0);
1559 ~DDlydDALtchMPBttn();
1563 void clrStatus(bool clrIsOn = true);
1564};
1565
1566//==========================================================>>
1567
1585 class SldrDALtchMPBttn: public DblActnLtchMPBttn{
1586 protected:
1587 bool _autoSwpDirOnEnd{true}; // Changes slider direction automatically when reaches _otptValMax or _otptValMin
1588 bool _autoSwpDirOnPrss{false};// Changes slider direction each time it enters slider mode
1589 bool _curSldrDirUp{true};
1590 uint16_t _initOtptCurVal{};
1591 uint16_t _otptCurVal{};
1592 bool _otptCurValIsMax{false};
1593 bool _otptCurValIsMin{false};
1594 unsigned long _otptSldrSpd{1};
1595 uint16_t _otptSldrStpSize{0x01};
1596 uint16_t _otptValMax{0xFFFF};
1597 uint16_t _otptValMin{0x0000};
1598
1599
1600
1601 fncVdPtrPrmPtrType _fnVdPtrPrmWhnTrnOffSldrMax{nullptr}; // _fVPPWhnTrnOffSldrMax
1602 void* _fnVdPtrPrmWhnTrnOffSldrMaxArgPtr{nullptr}; // _fVPPWhnTrnOffSldrMaxArgPtr
1603 fncVdPtrPrmPtrType _fnVdPtrPrmWhnTrnOnSldrMax{nullptr}; // _fVPPWhnTrnOnSldrMax
1604 void* _fnVdPtrPrmWhnTrnOnSldrMaxArgPtr{nullptr}; // _fVPPWhnTrnOnSldrMaxArgPtr
1605 void (*_fnWhnTrnOffSldrMax)() {nullptr};
1606 void (*_fnWhnTrnOnSldrMax)() {nullptr};
1607
1608 fncVdPtrPrmPtrType _fnVdPtrPrmWhnTrnOffSldrMin{nullptr}; // _fVPPWhnTrnOffSldrMin
1609 void* _fnVdPtrPrmWhnTrnOffSldrMinArgPtr{nullptr}; // _fVPPWhnTrnOffSldrMinArgPtr
1610 fncVdPtrPrmPtrType _fnVdPtrPrmWhnTrnOnSldrMin{nullptr}; // _fVPPWhnTrnOnSldrMin
1611 void* _fnVdPtrPrmWhnTrnOnSldrMinArgPtr{nullptr}; // _fVPPWhnTrnOnSldrMinArgPtr
1612 void (*_fnWhnTrnOffSldrMin)() {nullptr};
1613 void (*_fnWhnTrnOnSldrMin)() {nullptr};
1614
1615
1616
1617 virtual uint32_t _otptsSttsPkg(uint32_t prevVal = 0);
1618 bool _setSldrDir(const bool &newVal);
1619 void stOnEndScndMod_Out();
1620 virtual void stOnScndMod_Do();
1621 virtual void stOnStrtScndMod_In();
1622 void _turnOffSldrMax();
1623 void _turnOnSldrMax();
1624 void _turnOffSldrMin();
1625 void _turnOnSldrMin();
1626
1627 public:
1631 SldrDALtchMPBttn();
1639 SldrDALtchMPBttn(const uint8_t &mpbttnPin, const bool &pulledUp = true, const bool &typeNO = true, const unsigned long int &dbncTimeOrigSett = 0, const unsigned long int &strtDelay = 0, const uint16_t initVal = 0xFFFF);
1643 ~SldrDALtchMPBttn();
1648 void clrStatus(bool clrIsOn = true);
1654 uint16_t getOtptCurVal();
1664 bool getOtptCurValIsMax();
1674 bool getOtptCurValIsMin();
1684 unsigned long getOtptSldrSpd();
1694 uint16_t getOtptSldrStpSize();
1700 uint16_t getOtptValMax();
1706 uint16_t getOtptValMin();
1716 bool getSldrDirUp();
1728 bool setOtptCurVal(const uint16_t &newVal);
1743 bool setOtptSldrSpd(const uint16_t &newVal);
1760 bool setOtptSldrStpSize(const uint16_t &newVal);
1776 bool setOtptValMax(const uint16_t &newVal);
1792 bool setOtptValMin(const uint16_t &newVal);
1805 bool setSldrDirDn();
1818 bool setSldrDirUp();
1828 void setSwpDirOnEnd(const bool &newVal);
1837 void setSwpDirOnPrss(const bool &newVal);
1845 bool swapSldrDir();
1846};
1847
1848//==========================================================>>
1849
1868 class VdblMPBttn: public DbncdDlydMPBttn{
1869 private:
1870 void setFrcdOtptWhnVdd(const bool &newVal);
1871 void setStOnWhnOtpFrcd(const bool &newVal);
1872
1873 protected:
1874 enum fdaVmpbStts{
1875 stOffNotVPP,
1876 stOffVPP,
1877 stOnNVRP,
1878 //--------
1879 stOnVVP,
1880 stOnVddNVUP,
1881 stOffVddNVUP,
1882 stOffVddVUP,
1883 stOffUnVdd,
1884 //--------
1885 stOnVRP,
1886 stOnTurnOff,
1887 stOff,
1888 //--------
1889 stDisabled
1890 };
1891 fdaVmpbStts _mpbFdaState {stOffNotVPP};
1892
1893 fncVdPtrPrmPtrType _fnVdPtrPrmWhnTrnOffVdd{nullptr}; // _fVPPWhnTrnOffVdd
1894 void* _fnVdPtrPrmWhnTrnOffVddArgPtr{nullptr}; // _fVPPWhnTrnOffVddArgPtr
1895 fncVdPtrPrmPtrType _fnVdPtrPrmWhnTrnOnVdd{nullptr}; // _fVPPWhnTrnOnVdd
1896 void* _fnVdPtrPrmWhnTrnOnVddArgPtr{nullptr}; // _fVPPWhnTrnOnVddArgPtr
1897 void (*_fnWhnTrnOffVdd)() {nullptr};
1898 void (*_fnWhnTrnOnVdd)() {nullptr};
1899 bool _frcOtptLvlWhnVdd {true};
1900 bool _isVoided{false};
1901 bool _stOnWhnOtptFrcd{false};
1902 bool _validVoidPend{false};
1903 bool _validUnvoidPend{false};
1904
1905 virtual void mpbPollCallback();
1906 uint32_t _otptsSttsPkg(uint32_t prevVal = 0);
1907 bool setVoided(const bool &newVoidValue);
1908 virtual void stDisabled_In();
1909 virtual void stDisabled_Out();
1910 virtual void stOffNotVPP_In(){};
1911 virtual void stOffVddNVUP_Do(){}; //This provides a setting point for calculating the _validUnvoidPend
1912 virtual void stOffVPP_Do(){}; // This provides a setting point for the voiding mechanism to be started
1913 void _turnOffVdd();
1914 void _turnOnVdd();
1915 virtual void updFdaState();
1916 virtual bool updVoidStatus() = 0;
1917
1918 public:
1922 VdblMPBttn();
1930 VdblMPBttn(const uint8_t &mpbttnPin, const bool &pulledUp = true, const bool &typeNO = true, const unsigned long int &dbncTimeOrigSett = 0, const unsigned long int &strtDelay = 0, const bool &isOnDisabled = false);
1934 virtual ~VdblMPBttn();
1938 void clrStatus(bool clrIsOn = true);
1947 fncPtrType getFnWhnTrnOffVdd();
1956 fncPtrType getFnWhnTrnOnVdd();
1966 bool getFrcOtptLvlWhnVdd();
1975 fncVdPtrPrmPtrType getFVPPWhnTrnOffVdd();
1981 void* getFVPPWhnTrnOffVddArgPtr();
1990 fncVdPtrPrmPtrType getFVPPWhnTrnOnVdd();
1996 void* getFVPPWhnTrnOnVddArgPtr();
2004 const bool getIsVoided() const;
2016 bool getStOnWhnOtpFrcd();
2024 void setFnWhnTrnOffVddPtr(void(*newFnWhnTrnOff)());
2032 void setFnWhnTrnOnVddPtr(void(*newFnWhnTrnOn)());
2041 void setFVPPWhnTrnOffVdd(fncVdPtrPrmPtrType newFVPPWhnTrnOff, void* argPtr = nullptr);
2049 void setFVPPWhnTrnOffVddArgPtr(void* newFVPPWhnTrnOffArgPtr);
2058 void setFVPPWhnTrnOnVdd(fncVdPtrPrmPtrType newFVPPWhnTrnOn, void* argPtr = nullptr);
2066 void setFVPPWhnTrnOnVddArgPtr(void* newFVPPWhnTrnOnArgPtr);
2077 bool setIsNotVoided();
2085 bool setIsVoided();
2086};
2087
2088//==========================================================>>
2089
2098 class TmVdblMPBttn: public VdblMPBttn{
2099 protected:
2100 unsigned long int _voidTime;
2101 unsigned long int _voidTmrStrt{0};
2102
2103 virtual void stOffNotVPP_In();
2104 virtual void stOffVddNVUP_Do(); //This provides a setting point for calculating the _validUnvoidPend
2105 virtual void stOffVPP_Do(); // This provides a setting point for the voiding mechanism to be started
2106 bool updIsPressed();
2107 virtual bool updVoidStatus();
2108
2109 public:
2113 TmVdblMPBttn();
2121 TmVdblMPBttn(const uint8_t &mpbttnPin, unsigned long int voidTime, const bool &pulledUp = true, const bool &typeNO = true, const unsigned long int &dbncTimeOrigSett = 0, const unsigned long int &strtDelay = 0, const bool &isOnDisabled = false);
2125 virtual ~TmVdblMPBttn();
2129 virtual bool begin(const unsigned long int &pollDelayMs = _StdPollDelay);
2133 void clrStatus();
2141 const unsigned long int getVoidTime() const;
2152 bool setVoidTime(const unsigned long int &newVoidTime);
2153};
2154
2155//==========================================================>>
2156
2172 class SnglSrvcVdblMPBttn: public VdblMPBttn{
2173 protected:
2174 virtual void stOffVddNVUP_Do(); //This provides the calculation for the _validUnvoidPend
2175 virtual bool updVoidStatus();
2176
2177 public:
2182 SnglSrvcVdblMPBttn();
2188 SnglSrvcVdblMPBttn(const uint8_t &mpbttnPin, const bool &pulledUp = true, const bool &typeNO = true, const unsigned long int &dbncTimeOrigSett = 0, const unsigned long int &strtDelay = 0);
2192 virtual ~SnglSrvcVdblMPBttn();
2196 virtual bool begin(const unsigned long int &pollDelayMs = _StdPollDelay);
2197};
2198
2199//==========================================================>>
2200
2201#endif /*_BUTTONTOSWITCH_H_*/
DDlydDALtchMPBttn::clrStatus
void clrStatus(bool clrIsOn=true)
See DbncddMPBttn::clrStatus(bool)
Definition ButtonToSwitch.cpp:2345
DDlydDALtchMPBttn::~DDlydDALtchMPBttn
~DDlydDALtchMPBttn()
Class virtual destructor.
Definition ButtonToSwitch.cpp:2341
DDlydDALtchMPBttn::DDlydDALtchMPBttn
DDlydDALtchMPBttn()
Default class constructor.
Definition ButtonToSwitch.cpp:2332
DblActnLtchMPBttn::setScndModActvDly
bool setScndModActvDly(const unsigned long &newVal)
Sets a new value for the scndModActvDly class attribute.
Definition ButtonToSwitch.cpp:2064
DblActnLtchMPBttn::setFnWhnTrnOnScndryPtr
void setFnWhnTrnOnScndryPtr(void(*newFnWhnTrnOn)())
Sets the function that will be called to execute every time the object enters the Secondary On State.
Definition ButtonToSwitch.cpp:2023
DblActnLtchMPBttn::getFVPPWhnTrnOnScndry
fncVdPtrPrmPtrType getFVPPWhnTrnOnScndry()
Returns a pointer to a function that is set to execute every time the object enters the Secondary Mod...
Definition ButtonToSwitch.cpp:1972
DblActnLtchMPBttn::getFnWhnTrnOnScndry
fncPtrType getFnWhnTrnOnScndry()
Returns the function that is set to execute every time the object enters the Secondary On State.
Definition ButtonToSwitch.cpp:1957
DblActnLtchMPBttn::setFVPPWhnTrnOnScndryArgPtr
void setFVPPWhnTrnOnScndryArgPtr(void *newFVPPWhnTrnOnArgPtr)
Sets a pointer to an argument to be passed to the function set to execute every time the object enter...
Definition ButtonToSwitch.cpp:2056
DblActnLtchMPBttn::getFVPPWhnTrnOffScndryArgPtr
void * getFVPPWhnTrnOffScndryArgPtr()
Returns a pointer to the argument to be passed to the function set to execute every time the object e...
Definition ButtonToSwitch.cpp:1967
DblActnLtchMPBttn::clrStatus
void clrStatus(bool clrIsOn=true)
See DbncddMPBttn::clrStatus(bool)
Definition ButtonToSwitch.cpp:1942
DblActnLtchMPBttn::getIsOnScndry
bool getIsOnScndry()
Returns the current value of the isOnScndry attribute flag.
Definition ButtonToSwitch.cpp:1982
DblActnLtchMPBttn::DblActnLtchMPBttn
DblActnLtchMPBttn()
Abstract Class default constructor.
Definition ButtonToSwitch.cpp:1921
DblActnLtchMPBttn::setFVPPWhnTrnOnScndry
void setFVPPWhnTrnOnScndry(fncVdPtrPrmPtrType newFVPPWhnTrnOn, void *argPtr=nullptr)
Sets a function to be executed every time the object enters the Secondary Mode On State.
Definition ButtonToSwitch.cpp:2047
DblActnLtchMPBttn::setFVPPWhnTrnOffScndry
void setFVPPWhnTrnOffScndry(fncVdPtrPrmPtrType newFVPPWhnTrnOff, void *argPtr=nullptr)
Sets a function to be executed every time the object enters the Secondary Mode Off State.
Definition ButtonToSwitch.cpp:2030
DblActnLtchMPBttn::getScndModActvDly
unsigned long getScndModActvDly()
Returns the current value of the scndModActvDly class attribute.
Definition ButtonToSwitch.cpp:1987
DblActnLtchMPBttn::begin
virtual bool begin(const unsigned long int &pollDelayMs=_StdPollDelay)
See DbncdMPBttn::begin(const unsigned long int)
Definition ButtonToSwitch.cpp:1934
DblActnLtchMPBttn::getFVPPWhnTrnOnScndryArgPtr
void * getFVPPWhnTrnOnScndryArgPtr()
Returns a pointer to the argument to be passed to the function set to execute every time the object e...
Definition ButtonToSwitch.cpp:1977
DblActnLtchMPBttn::setFnWhnTrnOffScndryPtr
void setFnWhnTrnOffScndryPtr(void(*newFnWhnTrnOff)())
Sets the function that will be called to execute every time the object enters the Secondary Off State...
Definition ButtonToSwitch.cpp:2015
DblActnLtchMPBttn::getFnWhnTrnOffScndry
fncPtrType getFnWhnTrnOffScndry()
returns the function that is set to execute every time the object enters the Secondary Off State.
Definition ButtonToSwitch.cpp:1952
DblActnLtchMPBttn::setFVPPWhnTrnOffScndryArgPtr
void setFVPPWhnTrnOffScndryArgPtr(void *newFVPPWhnTrnOffArgPtr)
Sets a pointer to an argument to be passed to the function set to execute every time the object enter...
Definition ButtonToSwitch.cpp:2039
DblActnLtchMPBttn::~DblActnLtchMPBttn
~DblActnLtchMPBttn()
Virtual destructor.
Definition ButtonToSwitch.cpp:1930
DblActnLtchMPBttn::getFVPPWhnTrnOffScndry
fncVdPtrPrmPtrType getFVPPWhnTrnOffScndry()
Returns a pointer to a function that is set to execute every time the object enters the Secondary Mod...
Definition ButtonToSwitch.cpp:1962
DbncdDlydMPBttn
Models a Debounced Delayed MPB (DD-MPB).
Definition ButtonToSwitch.h:598
DbncdDlydMPBttn::~DbncdDlydMPBttn
virtual ~DbncdDlydMPBttn()
Class destructor.
Definition ButtonToSwitch.cpp:918
DbncdDlydMPBttn::DbncdDlydMPBttn
DbncdDlydMPBttn()
Default constructor.
Definition ButtonToSwitch.cpp:901
DbncdDlydMPBttn::setStrtDelay
void setStrtDelay(const unsigned long int &newStrtDelay)
Sets a new value to the "Start Delay" strtDelay attribute.
Definition ButtonToSwitch.cpp:932
DbncdDlydMPBttn::init
bool init(const uint8_t &mpbttnPin, const bool &pulledUp=true, const bool &typeNO=true, const unsigned long int &dbncTimeOrigSett=0, const unsigned long int &strtDelay=0)
see DbncdMPBttn::init(const uint8_t, const bool, const bool, const unsigned long int)
Definition ButtonToSwitch.cpp:922
DbncdMPBttn::setBeginDisabled
void setBeginDisabled(const bool &newBeginDisabled=false)
Sets the starting isDisabled state.
Definition ButtonToSwitch.cpp:537
DbncdMPBttn::getFnWhnTrnOn
fncPtrType getFnWhnTrnOn()
Returns the function that is set to execute every time the object enters the On State.
Definition ButtonToSwitch.cpp:252
DbncdMPBttn::setFVPPWhnTrnOff
void setFVPPWhnTrnOff(fncVdPtrPrmPtrType newFVPPWhnTrnOff, void *argPtr=nullptr)
Sets a function to be executed every time the object enters the Off State.
Definition ButtonToSwitch.cpp:573
DbncdMPBttn::getPollPeriodMs
const unsigned long int getPollPeriodMs()
Returns the poll period time setting attribute's value.
Definition ButtonToSwitch.cpp:312
DbncdMPBttn::resetFda
void resetFda()
Resets the MPB behavior automaton to it's Initial or Start State
Definition ButtonToSwitch.cpp:488
DbncdMPBttn::clrStatus
void clrStatus(bool clrIsOn=true)
Clears and resets flags, timers and counters modified through the object's signals processing.
Definition ButtonToSwitch.cpp:192
DbncdMPBttn::getCurDbncTime
const unsigned long int getCurDbncTime() const
Returns the current debounce period time set for the object.
Definition ButtonToSwitch.cpp:242
DbncdMPBttn::enable
void enable()
Enables the input signal processing.
Definition ButtonToSwitch.cpp:221
DbncdMPBttn::pause
bool pause()
Pauses the software timer updating the computation of the object's internal flags value (object's sta...
Definition ButtonToSwitch.cpp:377
DbncdMPBttn::~DbncdMPBttn
virtual ~DbncdMPBttn()
Default virtual destructor.
Definition ButtonToSwitch.cpp:155
DbncdMPBttn::getFVPPWhnTrnOff
fncVdPtrPrmPtrType getFVPPWhnTrnOff()
Returns a pointer to a function that is set to execute every time the object enters the Off State.
Definition ButtonToSwitch.cpp:257
DbncdMPBttn::setIsOnDisabled
void setIsOnDisabled(const bool &newIsOnDisabled)
Sets the value of the isOnDisabled attribute.
Definition ButtonToSwitch.cpp:622
DbncdMPBttn::init
bool init(const uint8_t &mpbttnPin, const bool &pulledUp=true, const bool &typeNO=true, const unsigned long int &dbncTimeOrigSett=0)
Initializes an object instantiated by the default constructor.
Definition ButtonToSwitch.cpp:327
DbncdMPBttn::end
bool end()
Detaches the object from the timer that monitors the input pins, compute and updates the object's sta...
Definition ButtonToSwitch.cpp:226
DbncdMPBttn::begin
virtual bool begin(const unsigned long int &pollDelayMs=_StdPollDelay)
Attaches the instantiated object to a timer that monitors the input pins and updates the object statu...
Definition ButtonToSwitch.cpp:160
DbncdMPBttn::resetDbncTime
void resetDbncTime()
Resets the debounce process time of the object to the value used at instantiation.
Definition ButtonToSwitch.cpp:482
DbncdMPBttn::setFVPPWhnTrnOn
void setFVPPWhnTrnOn(fncVdPtrPrmPtrType newFVPPWhnTrnOn, void *argPtr=nullptr)
Sets a function to be executed every time the object enters the On State.
Definition ButtonToSwitch.cpp:589
DbncdMPBttn::getFVPPWhnTrnOn
fncVdPtrPrmPtrType getFVPPWhnTrnOn()
Returns a pointer to a function that is set to execute every time the object enters the On State.
Definition ButtonToSwitch.cpp:267
DbncdMPBttn::DbncdMPBttn
DbncdMPBttn()
Default class constructor.
Definition ButtonToSwitch.cpp:99
DbncdMPBttn::disable
void disable()
Disables the input signal processing, ignoring the changes of its values.
Definition ButtonToSwitch.cpp:216
DbncdMPBttn::resume
bool resume()
Restarts the software timer updating the calculation of the object internal flags.
Definition ButtonToSwitch.cpp:496
DbncdMPBttn::getIsEnabled
const bool getIsEnabled() const
Returns the value of the isEnabled attribute flag, indicating the Enabled or Disabled status of the o...
Definition ButtonToSwitch.cpp:277
DbncdMPBttn::getLstPollTime
const unsigned long int getLstPollTime()
Returns the time stamp of the last state update for the object.
Definition ButtonToSwitch.cpp:297
DbncdMPBttn::getIsOnDisabled
const bool getIsOnDisabled() const
Returns the value of the isOnDisabled attribute.
Definition ButtonToSwitch.cpp:287
DbncdMPBttn::getFVPPWhnTrnOnArgPtr
void * getFVPPWhnTrnOnArgPtr()
Returns a pointer to the argument to be passed to the function set to execute every time the object e...
Definition ButtonToSwitch.cpp:272
DbncdMPBttn::setFVPPWhnTrnOnArgPtr
void setFVPPWhnTrnOnArgPtr(void *newFVPPWhnTrnOnArgPtr)
Sets a pointer to an argument to be passed to the function set to execute every time the object enter...
Definition ButtonToSwitch.cpp:598
DbncdMPBttn::getFVPPWhnTrnOffArgPtr
void * getFVPPWhnTrnOffArgPtr()
Returns a pointer to the argument to be passed to the function set to execute every time the object e...
Definition ButtonToSwitch.cpp:262
DbncdMPBttn::setFnWhnTrnOffPtr
void setFnWhnTrnOffPtr(void(*newFnWhnTrnOff)())
Sets the function that will be called to execute every time the object enters the Off State.
Definition ButtonToSwitch.cpp:559
DbncdMPBttn::getOutputsChange
const bool getOutputsChange() const
Returns the value of the outputsChange attribute flag.
Definition ButtonToSwitch.cpp:307
DbncdMPBttn::getIsOn
const bool getIsOn() const
Returns the value of the isOn attribute flag.
Definition ButtonToSwitch.cpp:282
DbncdMPBttn::setFVPPWhnTrnOffArgPtr
void setFVPPWhnTrnOffArgPtr(void *newFVPPWhnTrnOffArgPtr)
Sets a pointer to an argument to be passed to the function set to execute every time the object enter...
Definition ButtonToSwitch.cpp:582
DbncdMPBttn::getUpdTmrAttchd
bool getUpdTmrAttchd()
Returns the value of the Attached to the update timer attribute.
Definition ButtonToSwitch.cpp:322
DbncdMPBttn::setFnWhnTrnOnPtr
void setFnWhnTrnOnPtr(void(*newFnWhnTrnOn)())
Sets the function that will be called to execute every time the object enters the On State.
Definition ButtonToSwitch.cpp:566
DbncdMPBttn::getStrtDelay
unsigned long int getStrtDelay()
Returns the current value of strtDelay attribute.
Definition ButtonToSwitch.cpp:317
DbncdMPBttn::getOtptsSttsPkgd
const uint32_t getOtptsSttsPkgd()
Returns the relevant attribute flags values for the object state encoded as a 32 bits value.
Definition ButtonToSwitch.cpp:302
DbncdMPBttn::getFnWhnTrnOff
fncPtrType getFnWhnTrnOff()
Returns the function that is set to execute every time the object enters the Off State.
Definition ButtonToSwitch.cpp:247
DbncdMPBttn::setOutputsChange
void setOutputsChange(bool newOutputsChange)
Sets the value of the attribute flag indicating if a change took place in any of the output attribute...
Definition ButtonToSwitch.cpp:645
DbncdMPBttn::setDbncTime
bool setDbncTime(const unsigned long int &newDbncTime)
Sets the debounce process time.
Definition ButtonToSwitch.cpp:544
HntdTmLtchMPBttn::setSrvcTime
bool setSrvcTime(const unsigned long int &newSvcTime)
See TmLtchMPBttn::setSrvcTime(const unsigned long int)
Definition ButtonToSwitch.cpp:1631
HntdTmLtchMPBttn::getFVPPWhnTrnOffWrnng
fncVdPtrPrmPtrType getFVPPWhnTrnOffWrnng()
Returns a pointer to a function that is set to execute every time the object enters the Warning Off S...
Definition ButtonToSwitch.cpp:1464
HntdTmLtchMPBttn::getFVPPWhnTrnOffWrnngArgPtr
void * getFVPPWhnTrnOffWrnngArgPtr()
Returns a pointer to the argument to be passed to the function set to execute every time the object e...
Definition ButtonToSwitch.cpp:1469
HntdTmLtchMPBttn::getFnWhnTrnOnPilot
fncPtrType getFnWhnTrnOnPilot()
Returns the function that is set to execute every time the object's Pilot attribute flag enters the O...
Definition ButtonToSwitch.cpp:1434
HntdTmLtchMPBttn::getFVPPWhnTrnOnWrnngArgPtr
void * getFVPPWhnTrnOnWrnngArgPtr()
Returns a pointer to the argument to be passed to the function set to execute every time the object e...
Definition ButtonToSwitch.cpp:1479
HntdTmLtchMPBttn::getFVPPWhnTrnOnWrnng
fncVdPtrPrmPtrType getFVPPWhnTrnOnWrnng()
Returns a pointer to a function that is set to execute every time the object enters the Warning On St...
Definition ButtonToSwitch.cpp:1474
HntdTmLtchMPBttn::setFnWhnTrnOffWrnngPtr
void setFnWhnTrnOffWrnngPtr(void(*newFnWhnTrnOff)())
Sets the function that will be called to execute every time the object's Warning is reset.
Definition ButtonToSwitch.cpp:1535
HntdTmLtchMPBttn::setFVPPWhnTrnOnWrnngArgPtr
void setFVPPWhnTrnOnWrnngArgPtr(void *newFVPPWhnTrnOnArgPtr)
Sets a pointer to an argument to be passed to the function set to execute every time the object enter...
Definition ButtonToSwitch.cpp:1616
HntdTmLtchMPBttn::getFnWhnTrnOffWrnng
fncPtrType getFnWhnTrnOffWrnng()
Returns the function that is set to execute every time the object's Warning attribute flag enters the...
Definition ButtonToSwitch.cpp:1429
HntdTmLtchMPBttn::setFVPPWhnTrnOffPilotArgPtr
void setFVPPWhnTrnOffPilotArgPtr(void *newFVPPWhnTrnOffArgPtr)
Sets a pointer to an argument to be passed to the function set to execute every time the object enter...
Definition ButtonToSwitch.cpp:1565
HntdTmLtchMPBttn::getFVPPWhnTrnOnPilot
fncVdPtrPrmPtrType getFVPPWhnTrnOnPilot()
Returns a pointer to a function that is set to execute every time the object enters the Pilot On Stat...
Definition ButtonToSwitch.cpp:1454
HntdTmLtchMPBttn::getWrnngOn
const bool getWrnngOn() const
Returns the current value of the warningOn attribute flag.
Definition ButtonToSwitch.cpp:1489
HntdTmLtchMPBttn::setFnWhnTrnOnPilotPtr
void setFnWhnTrnOnPilotPtr(void(*newFnWhnTrnOn)())
Sets the function that will be called to execute every time the object's Pilot is set.
Definition ButtonToSwitch.cpp:1542
HntdTmLtchMPBttn::getPilotOn
const bool getPilotOn() const
Returns the current value of the pilotOn attribute flag.
Definition ButtonToSwitch.cpp:1484
HntdTmLtchMPBttn::setFVPPWhnTrnOffPilot
void setFVPPWhnTrnOffPilot(fncVdPtrPrmPtrType newFVPPWhnTrnOff, void *argPtr=nullptr)
Sets a function to be executed every time the object enters the Pilot Off State.
Definition ButtonToSwitch.cpp:1556
HntdTmLtchMPBttn::getFVPPWhnTrnOffPilotArgPtr
void * getFVPPWhnTrnOffPilotArgPtr()
Returns a pointer to the argument to be passed to the function set to execute every time the object e...
Definition ButtonToSwitch.cpp:1449
HntdTmLtchMPBttn::clrStatus
void clrStatus(bool clrIsOn=true)
see DbncdMPBttn::clrStatus(bool)
Definition ButtonToSwitch.cpp:1407
HntdTmLtchMPBttn::getFnWhnTrnOffPilot
fncPtrType getFnWhnTrnOffPilot()
Returns the function that is set to execute every time the object's Pilot attribute flag enters the O...
Definition ButtonToSwitch.cpp:1424
HntdTmLtchMPBttn::setFVPPWhnTrnOnPilotArgPtr
void setFVPPWhnTrnOnPilotArgPtr(void *newFVPPWhnTrnOnArgPtr)
Sets a pointer to an argument to be passed to the function set to execute every time the object enter...
Definition ButtonToSwitch.cpp:1582
HntdTmLtchMPBttn::HntdTmLtchMPBttn
HntdTmLtchMPBttn()
Default constructor.
Definition ButtonToSwitch.cpp:1368
HntdTmLtchMPBttn::setFnWhnTrnOnWrnngPtr
void setFnWhnTrnOnWrnngPtr(void(*newFnWhnTrnOn)())
Sets the function that will be called to execute every time the object's Wrnng is set.
Definition ButtonToSwitch.cpp:1549
HntdTmLtchMPBttn::getFVPPWhnTrnOnPilotArgPtr
void * getFVPPWhnTrnOnPilotArgPtr()
Returns a pointer to the argument to be passed to the function set to execute every time the object e...
Definition ButtonToSwitch.cpp:1459
HntdTmLtchMPBttn::setFVPPWhnTrnOffWrnng
void setFVPPWhnTrnOffWrnng(fncVdPtrPrmPtrType newFVPPWhnTrnOff, void *argPtr=nullptr)
Sets a function to be executed every time the object enters the Warning Off State.
Definition ButtonToSwitch.cpp:1590
HntdTmLtchMPBttn::setWrnngPrctg
bool setWrnngPrctg(const unsigned int &newWrnngPrctg)
Sets the value for the percentage of service time for calculating the warningOn flag value.
Definition ButtonToSwitch.cpp:1643
HntdTmLtchMPBttn::getFnWhnTrnOnWrnng
fncPtrType getFnWhnTrnOnWrnng()
Returns the function that is set to execute every time the object's Warning attribute flag enters the...
Definition ButtonToSwitch.cpp:1439
HntdTmLtchMPBttn::setFVPPWhnTrnOffWrnngArgPtr
void setFVPPWhnTrnOffWrnngArgPtr(void *newFVPPWhnTrnOffArgPtr)
Sets a pointer to an argument to be passed to the function set to execute every time the object enter...
Definition ButtonToSwitch.cpp:1599
HntdTmLtchMPBttn::getFVPPWhnTrnOffPilot
fncVdPtrPrmPtrType getFVPPWhnTrnOffPilot()
Returns a pointer to a function that is set to execute every time the object enters the Pilot Off Sta...
Definition ButtonToSwitch.cpp:1444
HntdTmLtchMPBttn::begin
virtual bool begin(const unsigned long int &pollDelayMs=_StdPollDelay)
See DbncdMPBttn::begin(const unsigned long int)
Definition ButtonToSwitch.cpp:1399
HntdTmLtchMPBttn::setFnWhnTrnOffPilotPtr
void setFnWhnTrnOffPilotPtr(void(*newFnWhnTrnOff)())
Sets the function that will be called to execute every time the object's Pilot is reset.
Definition ButtonToSwitch.cpp:1528
HntdTmLtchMPBttn::setFVPPWhnTrnOnWrnng
void setFVPPWhnTrnOnWrnng(fncVdPtrPrmPtrType newFVPPWhnTrnOn, void *argPtr=nullptr)
Sets a function to be executed every time the object enters the Warning On State.
Definition ButtonToSwitch.cpp:1607
HntdTmLtchMPBttn::setFVPPWhnTrnOnPilot
void setFVPPWhnTrnOnPilot(fncVdPtrPrmPtrType newFVPPWhnTrnOn, void *argPtr=nullptr)
Sets a function to be executed every time the object enters the Pilot On State.
Definition ButtonToSwitch.cpp:1573
HntdTmLtchMPBttn::setKeepPilot
void setKeepPilot(const bool &newKeepPilot)
Sets the configuration of the keepPilot service attribute.
Definition ButtonToSwitch.cpp:1624
HntdTmLtchMPBttn::~HntdTmLtchMPBttn
~HntdTmLtchMPBttn()
Class virtual destructor.
Definition ButtonToSwitch.cpp:1395
LtchMPBttn::getIsLatched
const bool getIsLatched() const
Returns the value of the isLatched attribute flag, indicating the Latched or Unlatched condition of t...
Definition ButtonToSwitch.cpp:979
LtchMPBttn::unlatch
bool unlatch()
Sets the values of the flags needed to unlatch a latched MPB.
Definition ButtonToSwitch.cpp:1035
LtchMPBttn::getUnlatchRlsPend
const bool getUnlatchRlsPend() const
Returns the value of the "Valid Unlatch Release Pending" attribute.
Definition ButtonToSwitch.cpp:994
LtchMPBttn::getUnlatchPend
const bool getUnlatchPend() const
Returns the value of the "Valid Unlatch Pending" attribute.
Definition ButtonToSwitch.cpp:989
LtchMPBttn::~LtchMPBttn
virtual ~LtchMPBttn()
Class virtual destructor.
Definition ButtonToSwitch.cpp:959
LtchMPBttn::setUnlatchPend
void setUnlatchPend(const bool &newVal)
Sets the value of the "Valid Unlatch Pending" attribute.
Definition ButtonToSwitch.cpp:1021
LtchMPBttn::setTrnOffASAP
void setTrnOffASAP(const bool &newVal)
Sets the value of the trnOffASAP attribute.
Definition ButtonToSwitch.cpp:1014
LtchMPBttn::getTrnOffASAP
bool getTrnOffASAP()
Returns the value of the trnOffASAP attribute flag.
Definition ButtonToSwitch.cpp:984
LtchMPBttn::setUnlatchRlsPend
void setUnlatchRlsPend(const bool &newVal)
Sets the value of the "Valid Unlatch Release Pending" attribute.
Definition ButtonToSwitch.cpp:1028
LtchMPBttn::begin
virtual bool begin(const unsigned long int &pollDelayMs=_StdPollDelay)
See DbncdMPBttn::begin(const unsigned long int)
Definition ButtonToSwitch.cpp:962
LtchMPBttn::clrStatus
void clrStatus(bool clrIsOn=true)
See DbncdMPBttn::clrStatus(bool)
Definition ButtonToSwitch.cpp:970
LtchMPBttn::LtchMPBttn
LtchMPBttn()
Default constructor.
Definition ButtonToSwitch.cpp:941
SldrDALtchMPBttn::clrStatus
void clrStatus(bool clrIsOn=true)
Definition ButtonToSwitch.cpp:2400
SldrDALtchMPBttn::setOtptSldrSpd
bool setOtptSldrSpd(const uint16_t &newVal)
Sets the output slider speed (otptSldrSpd) attribute.
Definition ButtonToSwitch.cpp:2471
SldrDALtchMPBttn::getOtptValMax
uint16_t getOtptValMax()
Returns the top output current value register setting.
Definition ButtonToSwitch.cpp:2436
SldrDALtchMPBttn::getOtptCurValIsMin
bool getOtptCurValIsMin()
Returns the result of comparing the Output Current Value to the Minimum value setting
Definition ButtonToSwitch.cpp:2420
SldrDALtchMPBttn::setSldrDirDn
bool setSldrDirDn()
Sets the value of the curSldrDirUp attribute to false.
Definition ButtonToSwitch.cpp:2554
SldrDALtchMPBttn::setOtptValMax
bool setOtptValMax(const uint16_t &newVal)
Sets the output current value register maximum value attribute (otptValMax attribute).
Definition ButtonToSwitch.cpp:2497
SldrDALtchMPBttn::swapSldrDir
bool swapSldrDir()
Inverts the current curSldrDirUp attribute value.
Definition ButtonToSwitch.cpp:2666
SldrDALtchMPBttn::~SldrDALtchMPBttn
~SldrDALtchMPBttn()
Virtual class destructor.
Definition ButtonToSwitch.cpp:2396
SldrDALtchMPBttn::setOtptCurVal
bool setOtptCurVal(const uint16_t &newVal)
Sets the output current value register.
Definition ButtonToSwitch.cpp:2458
SldrDALtchMPBttn::getOtptCurVal
uint16_t getOtptCurVal()
Returns the Output Current Value (otpCurVal) attribute.
Definition ButtonToSwitch.cpp:2409
SldrDALtchMPBttn::setSldrDirUp
bool setSldrDirUp()
Sets the value of the curSldrDirUp attribute to true.
Definition ButtonToSwitch.cpp:2559
SldrDALtchMPBttn::SldrDALtchMPBttn
SldrDALtchMPBttn()
Default constructor.
Definition ButtonToSwitch.cpp:2386
SldrDALtchMPBttn::getSldrDirUp
bool getSldrDirUp()
Returns the value of the curSldrDirUp attribute.
Definition ButtonToSwitch.cpp:2446
SldrDALtchMPBttn::setOtptSldrStpSize
bool setOtptSldrStpSize(const uint16_t &newVal)
Sets the output slider step size (otptSldrStpSize) attribute value.
Definition ButtonToSwitch.cpp:2484
SldrDALtchMPBttn::getOtptCurValIsMax
bool getOtptCurValIsMax()
Returns a boolean value indicating if the "Output Current Value" equals the maximum limit.
Definition ButtonToSwitch.cpp:2414
SldrDALtchMPBttn::setSwpDirOnPrss
void setSwpDirOnPrss(const bool &newVal)
Sets the value of the "Auto-Swap Direction On Press" (autoSwpDirOnPrss) attribute.
Definition ButtonToSwitch.cpp:2571
SldrDALtchMPBttn::setOtptValMin
bool setOtptValMin(const uint16_t &newVal)
Sets the output current value register minimum value attribute (otptValMin attribute).
Definition ButtonToSwitch.cpp:2516
SldrDALtchMPBttn::getOtptValMin
uint16_t getOtptValMin()
Returns the bottom output current value register setting.
Definition ButtonToSwitch.cpp:2441
SldrDALtchMPBttn::getOtptSldrSpd
unsigned long getOtptSldrSpd()
Returns the current setting for the Output Slider Speed value.
Definition ButtonToSwitch.cpp:2426
SldrDALtchMPBttn::getOtptSldrStpSize
uint16_t getOtptSldrStpSize()
Returns the current setting for the Output Slider Step Size value.
Definition ButtonToSwitch.cpp:2431
SldrDALtchMPBttn::setSwpDirOnEnd
void setSwpDirOnEnd(const bool &newVal)
Sets the value of the "Auto-Swap Direction on Ends" (autoSwpDirOnEnd) attribute.
Definition ButtonToSwitch.cpp:2564
SnglSrvcVdblMPBttn::begin
virtual bool begin(const unsigned long int &pollDelayMs=_StdPollDelay)
See DbncdMPBttn::begin(const unsigned long int)
Definition ButtonToSwitch.cpp:3262
SnglSrvcVdblMPBttn::~SnglSrvcVdblMPBttn
virtual ~SnglSrvcVdblMPBttn()
Class virtual destructor.
Definition ButtonToSwitch.cpp:3258
SnglSrvcVdblMPBttn::SnglSrvcVdblMPBttn
SnglSrvcVdblMPBttn()
Default constructor.
Definition ButtonToSwitch.cpp:3246
TgglLtchMPBttn::TgglLtchMPBttn
TgglLtchMPBttn()
Default constructor.
Definition ButtonToSwitch.cpp:1236
TgglLtchMPBttn::~TgglLtchMPBttn
virtual ~TgglLtchMPBttn()
Class virtual destructor.
Definition ButtonToSwitch.cpp:1251
TmLtchMPBttn::TmLtchMPBttn
TmLtchMPBttn()
Default constructor.
Definition ButtonToSwitch.cpp:1283
TmLtchMPBttn::getSrvcTime
const unsigned long int getSrvcTime() const
Returns the configured Service Time.
Definition ButtonToSwitch.cpp:1313
TmLtchMPBttn::setTmerRstbl
void setTmerRstbl(const bool &newIsRstbl)
Configures the timer for the Service Time to be reseted before it reaches unlatching time.
Definition ButtonToSwitch.cpp:1331
TmLtchMPBttn::setSrvcTime
bool setSrvcTime(const unsigned long int &newSrvcTime)
Sets a new value to the Service Time attribute.
Definition ButtonToSwitch.cpp:1318
TmLtchMPBttn::clrStatus
void clrStatus(bool clrIsOn=true)
see DbncdMPBttn::clrStatus(bool)
Definition ButtonToSwitch.cpp:1306
TmLtchMPBttn::~TmLtchMPBttn
virtual ~TmLtchMPBttn()
Class virtual destructor.
Definition ButtonToSwitch.cpp:1302
TmVdblMPBttn::TmVdblMPBttn
TmVdblMPBttn()
Default constructor.
Definition ButtonToSwitch.cpp:3159
TmVdblMPBttn::~TmVdblMPBttn
virtual ~TmVdblMPBttn()
Class virtual destructor.
Definition ButtonToSwitch.cpp:3168
TmVdblMPBttn::clrStatus
void clrStatus()
See DbncdMPBttn::clrStatus(bool)
Definition ButtonToSwitch.cpp:3180
TmVdblMPBttn::begin
virtual bool begin(const unsigned long int &pollDelayMs=_StdPollDelay)
See DbncdMPBttn::begin(const unsigned long int)
Definition ButtonToSwitch.cpp:3172
TmVdblMPBttn::getVoidTime
const unsigned long int getVoidTime() const
Returns the voidTime attribute current value.
Definition ButtonToSwitch.cpp:3187
TmVdblMPBttn::setVoidTime
bool setVoidTime(const unsigned long int &newVoidTime)
Sets a new value to the Void Time attribute.
Definition ButtonToSwitch.cpp:3192
VdblMPBttn::setIsVoided
bool setIsVoided()
Sets the value of the isVoided attribute flag to true.
Definition ButtonToSwitch.cpp:2900
VdblMPBttn::setFVPPWhnTrnOffVddArgPtr
void setFVPPWhnTrnOffVddArgPtr(void *newFVPPWhnTrnOffArgPtr)
Sets a pointer to an argument to be passed to the function set to execute every time the object enter...
Definition ButtonToSwitch.cpp:2872
VdblMPBttn::getIsVoided
const bool getIsVoided() const
Returns the current value of the isVoided attribute flag.
Definition ButtonToSwitch.cpp:2807
VdblMPBttn::getFnWhnTrnOnVdd
fncPtrType getFnWhnTrnOnVdd()
Returns the function that is set to execute every time the object enters the Voided or "Voided On" St...
Definition ButtonToSwitch.cpp:2777
VdblMPBttn::clrStatus
void clrStatus(bool clrIsOn=true)
See DbncdMPBttn::clrStatus(bool)
Definition ButtonToSwitch.cpp:2763
VdblMPBttn::setFnWhnTrnOnVddPtr
void setFnWhnTrnOnVddPtr(void(*newFnWhnTrnOn)())
Sets the function that will be called to execute every time the object's isVoided attribute flag is s...
Definition ButtonToSwitch.cpp:2849
VdblMPBttn::setFVPPWhnTrnOffVdd
void setFVPPWhnTrnOffVdd(fncVdPtrPrmPtrType newFVPPWhnTrnOff, void *argPtr=nullptr)
Sets a function to be executed every time the object enters the Voided Off State a....
Definition ButtonToSwitch.cpp:2863
VdblMPBttn::getFVPPWhnTrnOffVddArgPtr
void * getFVPPWhnTrnOffVddArgPtr()
Returns a pointer to the argument to be passed to the function set to execute every time the object e...
Definition ButtonToSwitch.cpp:2792
VdblMPBttn::setFVPPWhnTrnOnVddArgPtr
void setFVPPWhnTrnOnVddArgPtr(void *newFVPPWhnTrnOnArgPtr)
Sets a pointer to an argument to be passed to the function set to execute every time the object enter...
Definition ButtonToSwitch.cpp:2888
VdblMPBttn::~VdblMPBttn
virtual ~VdblMPBttn()
Default virtual destructor.
Definition ButtonToSwitch.cpp:2759
VdblMPBttn::VdblMPBttn
VdblMPBttn()
Default constructor.
Definition ButtonToSwitch.cpp:2749
VdblMPBttn::getFnWhnTrnOffVdd
fncPtrType getFnWhnTrnOffVdd()
Returns the function that is set to execute every time the object exits the Voided State.
Definition ButtonToSwitch.cpp:2772
VdblMPBttn::setFnWhnTrnOffVddPtr
void setFnWhnTrnOffVddPtr(void(*newFnWhnTrnOff)())
Sets the function that will be called to execute every time the object's isVoided attribute flag is r...
Definition ButtonToSwitch.cpp:2842
VdblMPBttn::getFrcOtptLvlWhnVdd
bool getFrcOtptLvlWhnVdd()
Returns the value of the frcOtptLvlWhnVdd attribute.
Definition ButtonToSwitch.cpp:2782
VdblMPBttn::getStOnWhnOtpFrcd
bool getStOnWhnOtpFrcd()
Returns the value of the frcOtptLvlWhnVdd attribute.
Definition ButtonToSwitch.cpp:2812
VdblMPBttn::getFVPPWhnTrnOnVdd
fncVdPtrPrmPtrType getFVPPWhnTrnOnVdd()
Returns a pointer to a function that is set to execute every time the object enters the Voided On Sta...
Definition ButtonToSwitch.cpp:2797
VdblMPBttn::getFVPPWhnTrnOnVddArgPtr
void * getFVPPWhnTrnOnVddArgPtr()
Returns a pointer to the argument to be passed to the function set to execute every time the object e...
Definition ButtonToSwitch.cpp:2802
VdblMPBttn::setFVPPWhnTrnOnVdd
void setFVPPWhnTrnOnVdd(fncVdPtrPrmPtrType newFVPPWhnTrnOn, void *argPtr=nullptr)
Sets a function to be executed every time the object enters the Voided On State a....
Definition ButtonToSwitch.cpp:2879
VdblMPBttn::setIsNotVoided
bool setIsNotVoided()
Sets the value of the isVoided attribute flag to false.
Definition ButtonToSwitch.cpp:2895
VdblMPBttn::getFVPPWhnTrnOffVdd
fncVdPtrPrmPtrType getFVPPWhnTrnOffVdd()
Returns a pointer to a function that is set to execute every time the object enters the Voided Off St...
Definition ButtonToSwitch.cpp:2787
XtrnUnltchMPBttn::clrStatus
void clrStatus(bool clrIsOn=true)
See DbncdMPBttn::clrStatus(bool)
Definition ButtonToSwitch.cpp:1878
XtrnUnltchMPBttn::XtrnUnltchMPBttn
XtrnUnltchMPBttn()
Default constructor.
Definition ButtonToSwitch.cpp:1846
XtrnUnltchMPBttn::begin
virtual bool begin(const unsigned long int &pollDelayMs=_StdPollDelay)
See DbncdMPBttn::begin(const unsigned long int)
Definition ButtonToSwitch.cpp:1862
MpbOtpts_t
Type to hold the complete set of output attribute flags from any DbncdMPBttn class and subclasses obj...
Definition ButtonToSwitch.h:78