![]() |
ButtonToSwitch Library for STM32 v4.1.0
A library that provides elaborated switch mechanism behavior simulation for digital signals inputs
|
Models an External Unlatch LDD-MPB, a.k.a. Emergency Latched Switch (XULDD-MPB) More...
#include <ButtonToSwitch_STM32.h>
Public Member Functions | |
XtrnUnltchMPBttn (GPIO_TypeDef *mpbttnPort, const uint16_t &mpbttnPin, DbncdDlydMPBttn *unLtchBttn, const bool &pulledUp=true, const bool &typeNO=true, const unsigned long int &dbncTimeOrigSett=0, const unsigned long int &strtDelay=0) | |
Class constructor. | |
XtrnUnltchMPBttn (gpioPinId_t mpbttnPinStrct, DbncdDlydMPBttn *unLtchBttn, const bool &pulledUp=true, const bool &typeNO=true, const unsigned long int &dbncTimeOrigSett=0, const unsigned long int &strtDelay=0) | |
Class constructor. | |
XtrnUnltchMPBttn (GPIO_TypeDef *mpbttnPort, const uint16_t &mpbttnPin, const bool &pulledUp=true, const bool &typeNO=true, const unsigned long int &dbncTimeOrigSett=0, const unsigned long int &strtDelay=0) | |
Class constructor. | |
XtrnUnltchMPBttn (gpioPinId_t mpbttnPinStrct, const bool &pulledUp=true, const bool &typeNO=true, const unsigned long int &dbncTimeOrigSett=0, const unsigned long int &strtDelay=0) | |
Class constructor. | |
virtual bool | begin (const unsigned long int &pollDelayMs=_StdPollDelay) |
See DbncdMPBttn::begin(const unsigned long int) | |
void | clrStatus (bool clrIsOn=true) |
See DbncdMPBttn::clrStatus(bool) | |
![]() | |
LtchMPBttn (GPIO_TypeDef *mpbttnPort, const uint16_t &mpbttnPin, const bool &pulledUp=true, const bool &typeNO=true, const unsigned long int &dbncTimeOrigSett=0, const unsigned long int &strtDelay=0) | |
Class constructor. | |
LtchMPBttn (gpioPinId_t mpbttnPinStrct, const bool &pulledUp=true, const bool &typeNO=true, const unsigned long int &dbncTimeOrigSett=0, const unsigned long int &strtDelay=0) | |
Class constructor. | |
void | clrStatus (bool clrIsOn=true) |
See DbncdMPBttn::clrStatus(bool) | |
const bool | getIsLatched () const |
Returns the value of the isLatched attribute flag, indicating the Latched or Unlatched condition of the object. | |
bool | getTrnOffASAP () |
Returns the value of the trnOffASfAP class attribute flag. | |
const bool | getUnlatchPend () const |
Returns the value of the validUnlatchPending attribute. | |
const bool | getUnlatchRlsPend () const |
Returns the value of the validUnlatchReleasePending attribute. | |
bool | resetFda () |
See DbncdMPBttn::resetFda() | |
void | setTrnOffASAP (const bool &newVal) |
Sets the value of the trnOffASAP attribute flag. | |
void | setUnlatchPend (const bool &newVal) |
Sets the value of the validUnlatchPending attribute. | |
void | setUnlatchRlsPend (const bool &newVal) |
Sets the value of the validUnlatchRlsPending attribute. | |
bool | unlatch () |
Sets the values of the flags needed to unlatch a latched MPB. | |
![]() | |
DbncdDlydMPBttn () | |
Default constructor. | |
DbncdDlydMPBttn (GPIO_TypeDef *mpbttnPort, const uint16_t &mpbttnPin, const bool &pulledUp=true, const bool &typeNO=true, const unsigned long int &dbncTimeOrigSett=0, const unsigned long int &strtDelay=0) | |
Class constructor. | |
DbncdDlydMPBttn (gpioPinId_t mpbttnPinStrct, const bool &pulledUp=true, const bool &typeNO=true, const unsigned long int &dbncTimeOrigSett=0, const unsigned long int &strtDelay=0) | |
Class constructor. | |
bool | init (GPIO_TypeDef *mpbttnPort, const uint16_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(GPIO_TypeDef*, const uint16_t, const bool, const bool, const unsigned long int) | |
bool | init (gpioPinId_t mpbttnPinStrct, const bool &pulledUp=true, const bool &typeNO=true, const unsigned long int &dbncTimeOrigSett=0, const unsigned long int &strtDelay=0) |
see DbncdMPBttn::init(gpioPinId_t, const bool, const bool, const unsigned long int) | |
void | setStrtDelay (const unsigned long int &newStrtDelay) |
Sets a new value to the delay attribute. | |
![]() | |
DbncdMPBttn () | |
Default class constructor. | |
DbncdMPBttn (GPIO_TypeDef *mpbttnPort, const uint16_t &mpbttnPin, const bool &pulledUp=true, const bool &typeNO=true, const unsigned long int &dbncTimeOrigSett=0) | |
Class constructor. | |
DbncdMPBttn (gpioPinId_t mpbttnPinStrct, const bool &pulledUp=true, const bool &typeNO=true, const unsigned long int &dbncTimeOrigSett=0) | |
Class constructor. | |
virtual | ~DbncdMPBttn () |
Default virtual destructor. | |
void | clrStatus (bool clrIsOn=true) |
Clears and resets flags, timers and counters modified through the object's signals processing. | |
void | disable () |
Disables the input signal processing, ignoring the changes of its values. | |
void | enable () |
Enables the input signal processing. | |
bool | end () |
Detaches the object from the timer that monitors the input pins, compute and updates the object's status. The timer daemon entry is deleted for the object. | |
const unsigned long int | getCurDbncTime () const |
Returns the current debounce period time set for the object. | |
fncPtrType | getFnWhnTrnOff () |
Returns the function that is set to execute every time the object enters the Off State. | |
fncPtrType | getFnWhnTrnOn () |
Returns the function that is set to execute every time the object enters the On State. | |
const bool | getIsEnabled () const |
Returns the value of the isEnabled attribute flag, indicating the Enabled or Disabled status of the object. | |
const bool | getIsOn () const |
Returns the value of the isOn attribute flag. | |
const bool | getIsOnDisabled () const |
Returns the value of the isOnDisabled attribute flag. | |
const uint32_t | getOtptsSttsPkgd () |
Returns the relevant attribute flags values for the object state encoded as a 32 bits value, required to pass current state of the object to another thread/task managing the outputs. | |
const bool | getOutputsChange () const |
Returns the value of the outputsChange attribute flag. | |
unsigned long int | getStrtDelay () |
Returns the current value of strtDelay attribute. | |
const TaskHandle_t | getTaskToNotify () const |
Returns the task to be notified by the object when its output flags changes. | |
const TaskHandle_t | getTaskWhileOn () |
Returns the task to be run (resumed) while the object is in the On state. | |
bool | init (GPIO_TypeDef *mpbttnPort, const uint16_t &mpbttnPin, const bool &pulledUp=true, const bool &typeNO=true, const unsigned long int &dbncTimeOrigSett=0) |
Initializes an object instantiated by the default constructor. | |
bool | init (gpioPinId_t mpbttnPinStrct, const bool &pulledUp=true, const bool &typeNO=true, const unsigned long int &dbncTimeOrigSett=0) |
Initializes an object instantiated by the default constructor. | |
bool | pause () |
Pauses the software timer updating the computation of the object's internal flags value. | |
void | resetDbncTime () |
Resets the debounce process time of the object to the value used at instantiation. | |
void | resetFda () |
Resets the MPB behavior automaton to it's Initial or Start State | |
bool | resume () |
Restarts the software timer updating the calculation of the object internal flags. | |
bool | setDbncTime (const unsigned long int &newDbncTime) |
Sets the debounce process time. | |
void | setFnWhnTrnOffPtr (void(*newFnWhnTrnOff)()) |
Sets the function that will be called to execute every time the object enters the Off State. | |
void | setFnWhnTrnOnPtr (void(*newFnWhnTrnOn)()) |
Sets the function that will be called to execute every time the object enters the On State. | |
void | setIsOnDisabled (const bool &newIsOnDisabled) |
Sets the value of the isOnDisabled attribute. | |
void | setOutputsChange (bool newOutputChange) |
Sets the value of the attribute flag indicating if a change took place in any of the output attribute flags (IsOn included). | |
void | setTaskToNotify (const TaskHandle_t &newTaskHandle) |
Sets the pointer to the task to be notified by the object when its output attribute flags changes. | |
virtual void | setTaskWhileOn (const TaskHandle_t &newTaskHandle) |
Sets the handle to the task to be run while the object is in the On state. | |
Models an External Unlatch LDD-MPB, a.k.a. Emergency Latched Switch (XULDD-MPB)
The External released toggle switch (a.k.a. Emergency latched), keeps the On state since the moment the signal is stable (debounced & delayed), and until an external signal is received. This kind of switch is used when an "abnormal situation" demands the push of the switch On, but a higher authority is needed to reset it to Off from a different signal source. The On State will then not only start a response to the exception arisen, but will be kept to flag the triggering event. Smoke, flood, intrusion alarms and "last man locks" are some examples of the use of this switch. As the external release signal can be physical or logical generated it can be implemented to be received from a switch or a remote signal of any usual kind.
class XtrnUnltchMPBttn
XtrnUnltchMPBttn::XtrnUnltchMPBttn | ( | GPIO_TypeDef * | mpbttnPort, |
const uint16_t & | mpbttnPin, | ||
DbncdDlydMPBttn * | unLtchBttn, | ||
const bool & | pulledUp = true, | ||
const bool & | typeNO = true, | ||
const unsigned long int & | dbncTimeOrigSett = 0, | ||
const unsigned long int & | strtDelay = 0 ) |
Class constructor.
This class constructor makes specific reference to a source for the unlatch signal by including a parameter referencing an object that implements the needed getIsOn() method to get the external unlatch signal.
unLtchBttn | Pointer to a DbncdDlydMPBttn object that will provide the unlatch source signal through it's getIsOn() method. |
XtrnUnltchMPBttn::XtrnUnltchMPBttn | ( | gpioPinId_t | mpbttnPinStrct, |
DbncdDlydMPBttn * | unLtchBttn, | ||
const bool & | pulledUp = true, | ||
const bool & | typeNO = true, | ||
const unsigned long int & | dbncTimeOrigSett = 0, | ||
const unsigned long int & | strtDelay = 0 ) |
Class constructor.
This class constructor makes specific reference to a source of the unlatch signal by including a parameter referencing an object that implements the needed getIsOn() method to get the external unlatch signal.
mpbttnPinStrct | GPIO port and Pin identification defined as a single gpioPinId_t parameter. |
unLtchBttn | Pointer to a DbncdDlydMPBttn object that will provide the unlatch source signal through it's getIsOn() method. |
XtrnUnltchMPBttn::XtrnUnltchMPBttn | ( | GPIO_TypeDef * | mpbttnPort, |
const uint16_t & | mpbttnPin, | ||
const bool & | pulledUp = true, | ||
const bool & | typeNO = true, | ||
const unsigned long int & | dbncTimeOrigSett = 0, | ||
const unsigned long int & | strtDelay = 0 ) |
Class constructor.
This class constructor instantiates an object that relies on the unlatch() method invocation to release the latched MPB
XtrnUnltchMPBttn::XtrnUnltchMPBttn | ( | gpioPinId_t | mpbttnPinStrct, |
const bool & | pulledUp = true, | ||
const bool & | typeNO = true, | ||
const unsigned long int & | dbncTimeOrigSett = 0, | ||
const unsigned long int & | strtDelay = 0 ) |
Class constructor.
This class constructor instantiates an object that relies on the unlatch() method invocation to release the latched MPB
mpbttnPinStrct | GPIO port and Pin identification defined as a single gpioPinId_t parameter. |