![]() |
ButtonToSwitch Library for Arduino v4.6.0
A library that provides elaborated switch mechanism behavior simulation for digital signals inputs
|
Models a Slider Double Action LDD-MPB combo switch, a.k.a. off/on/dimmer, a.k.a. off/on/volume radio switch)(S-DALDD-MPB) More...
#include <ButtonToSwitch.h>
Public Member Functions | |
SldrDALtchMPBttn () | |
Default constructor. | |
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) | |
Class constructor. | |
~SldrDALtchMPBttn () | |
Virtual class destructor. | |
void | clrStatus (bool clrIsOn=true) |
fncPtrType | getFnWhnTrnOffSldrDirUp () |
Returns the function set to be called when the slider direction is set to be decrementing (down). | |
fncPtrType | getFnWhnTrnOnSldrDirUp () |
Returns the function set to be called when the slider direction is set to be incrementing (up). | |
fncPtrType | getFnWhnTrnOffSldrMax () |
Returns the function that is set to be executed every time the object's Output Current Value (otptCurVal) attribute changes after being equal to the Maximum Output Value attribute setting (otptValMax). | |
fncPtrType | getFnWhnTrnOffSldrMin () |
Returns the function that is set to execute every time the object's Output Current Value (otptCurVal) attribute changes after being equal to the Minimum Output Current Value attribute setting (otptValMin). | |
fncPtrType | getFnWhnTrnOnSldrMax () |
Returns the function that is set to execute every time the object's Output Current Value (otptCurVal) attribute reaches the Maximum Output Current Value attribute setting (otptValMax). | |
fncPtrType | getFnWhnTrnOnSldrMin () |
Returns the function that is set to execute every time the object's Output Current Value (otptCurVal) attribute reaches the Minimum Output Current Value attribute setting (otptValMin). | |
fncVdPtrPrmPtrType | getFVPPWhnTrnOffSldrDirUp () |
Returns a pointer to the function that is set to be executed every time the slider direction is set to be decrementing (down). | |
void * | getFVPPWhnTrnOffSldrDirUpArgPtr () |
Returns a pointer to the argument to be passed to the function set to execute every time the slider direction is set to be decrementing (down). | |
fncVdPtrPrmPtrType | getFVPPWhnTrnOnSldrDirUp () |
Returns a pointer to the function that is set to be executed every time the slider direction is set to be incrementing (up). | |
void * | getFVPPWhnTrnOnSldrDirUpArgPtr () |
Returns a pointer to the argument to be passed to the function set to execute every time the slider direction is set to be incrementing (up). | |
fncVdPtrPrmPtrType | getFVPPWhnTrnOffSldrMax () |
Returns the function that is set to be executed every time the object's Output Current Value (otptCurVal) attribute changes after being equal to the Maximum Output Value attribute setting (otptValMax). | |
void * | getFVPPWhnTrnOffSldrMaxArgPtr () |
Returns a pointer to the argument to be passed to the function set to execute every time the object's Output Current Value (otptCurVal) attribute changes after being equal to the Maximum Output Current Value attribute setting (otptValMax). | |
fncVdPtrPrmPtrType | getFVPPWhnTrnOnSldrMax () |
Returns the function that is set to execute every time the object's Output Current Value (otptCurVal) attribute reaches the Maximum Output Current Value attribute setting (otptValMax). | |
void * | getFVPPWhnTrnOnSldrMaxArgPtr () |
Returns a pointer to the argument to be passed to the function set to execute every time the object's Output Current Value (otptCurVal) attribute reaches the Maximum Output Current Value attribute setting (otptValMax). | |
fncVdPtrPrmPtrType | getFVPPWhnTrnOffSldrMin () |
Returns the function that is set to execute every time the object's Output Current Value (otptCurVal) attribute changes after being equal to the Minimum Output Current Value attribute setting (otptValMin). | |
void * | getFVPPWhnTrnOffSldrMinArgPtr () |
Returns a pointer to the argument to be passed to the function set to execute every time the object's Output Current Value (otptCurVal) attribute exits the Minimum Output Current Value attribute setting (otptValMin). | |
fncVdPtrPrmPtrType | getFVPPWhnTrnOnSldrMin () |
Returns the function that is set to execute every time the object's Output Current Value (otptCurVal) attribute reaches the Minimum Output Current Value attribute setting (otptValMin). | |
void * | getFVPPWhnTrnOnSldrMinArgPtr () |
Returns a pointer to the argument to be passed to the function set to execute every time the object's Output Current Value (otptCurVal) attribute reaches the Minimum Output Current Value attribute setting (otptValMin). | |
uint16_t | getOtptCurVal () |
Returns the Output Current Value (otpCurVal) attribute. | |
bool | getOtptCurValIsMax () |
Returns a boolean value indicating if the "Output Current Value" equals the maximum limit. | |
bool | getOtptCurValIsMin () |
Returns the result of comparing the Output Current Value to the Minimum value setting | |
unsigned long | getOtptSldrSpd () |
Returns the current setting for the Output Slider Speed value. | |
uint16_t | getOtptSldrStpSize () |
Returns the current setting for the Output Slider Step Size value. | |
uint16_t | getOtptValMax () |
Returns the top output current value register setting. | |
uint16_t | getOtptValMin () |
Returns the bottom output current value register setting. | |
bool | getSldrDirUp () |
Returns the value of the curSldrDirUp attribute. | |
void | setFnWhnTrnOffSldrDirUp (void(*newFnWhnTrnOff)()) |
Sets the function that will be called every time the slider direction is set to be decrementing (down). | |
void | setFnWhnTrnOnSldrDirUp (void(*newFnWhnTrnOn)()) |
Sets the function that will be called every time the slider direction is set to be incrementing (up). | |
void | setFnWhnTrnOffSldrMaxPtr (void(*newFnWhnTrnOff)()) |
Sets a function that will be called every time the object's Output Current Value (otptCurVal) attribute changes after being equal to the Maximum Output Value attribute setting (otptValMax). | |
void | setFnWhnTrnOffSldrMinPtr (void(*newFnWhnTrnOff)()) |
Sets a function that will be called every time the object's Output Current Value (otptCurVal) attribute changes after being equal to the Minimum Output Value attribute setting (otptValMin). | |
void | setFnWhnTrnOnSldrMaxPtr (void(*newFnWhnTrnOn)()) |
Sets a function that will be called every time the object's Output Current Value (otptCurVal) reaches the Maximum Output Value attribute setting (otptValMax). | |
void | setFnWhnTrnOnSldrMinPtr (void(*newFnWhnTrnOn)()) |
Sets a function that will be called every time the object's Output Current Value (otptCurVal) attribute reaches the Minimum Output Current Value attribute setting (otptValMin). | |
void | setFVPPWhnTrnOffSldrDirUp (fncVdPtrPrmPtrType newFVPPWhnTrnOff, void *argPtr=nullptr) |
Sets a function that will be called every time the slider direction is set to be decrementing (down). | |
void | setFVPPWhnTrnOffSldrDirUpArgPtr (void *newFVPPWhnTrnOffArgPtr) |
Sets a pointer to an argument to be passed to the function set by the setFVPPWhnTrnOffSldrDirUp() method. | |
void | setFVPPWhnTrnOnSldrDirUp (fncVdPtrPrmPtrType newFVPPWhnTrnOn, void *argPtr=nullptr) |
Sets a function that will be called every time the slider direction is set to be incrementing (up). | |
void | setFVPPWhnTrnOnSldrDirUpArgPtr (void *newFVPPWhnTrnOnArgPtr) |
Sets a pointer to an argument to be passed to the function set by the setFVPPWhnTrnOnSldrDirUp() method. | |
void | setFVPPWhnTrnOffSldrMax (fncVdPtrPrmPtrType newFVPPWhnTrnOff, void *argPtr=nullptr) |
Sets a function that will be called every time the object's Output Current Value (otptCurVal) attribute changes after being equal to the Maximum Output Value attribute setting (otptValMax). | |
void | setFVPPWhnTrnOffSldrMaxArgPtr (void *newFVPPWhnTrnOffArgPtr) |
Sets a pointer to an argument to be passed to the function set by the setFVPPWhnTrnOffSldrMax() method. | |
void | setFVPPWhnTrnOnSldrMax (fncVdPtrPrmPtrType newFVPPWhnTrnOn, void *argPtr=nullptr) |
Sets a function that will be called every time the object's Output Current Value (otptCurVal) attribute reaches the Maximum Output Value attribute setting (otptValMax). | |
void | setFVPPWhnTrnOnSldrMaxArgPtr (void *newFVPPWhnTrnOnArgPtr) |
Sets a pointer to an argument to be passed to the function set by the setFVPPWhnTrnOnSldrMax() method. | |
void | setFVPPWhnTrnOffSldrMin (fncVdPtrPrmPtrType newFVPPWhnTrnOff, void *argPtr=nullptr) |
Sets a function that will be called every time the object's Output Current Value (otptCurVal) attribute changes after being equal to the Minimum Output Value attribute setting (otptValMin). | |
void | setFVPPWhnTrnOffSldrMinArgPtr (void *newFVPPWhnTrnOffArgPtr) |
Sets a pointer to an argument to be passed to the function set by the setFVPPWhnTrnOffSldrMin() method. | |
void | setFVPPWhnTrnOnSldrMin (fncVdPtrPrmPtrType newFVPPWhnTrnOn, void *argPtr=nullptr) |
Sets a function that will be called every time the object's Output Current Value (otptCurVal) attribute reaches the Minimum Output Value attribute setting (otptValMin). | |
void | setFVPPWhnTrnOnSldrMinArgPtr (void *newFVPPWhnTrnOnArgPtr) |
Sets a pointer to an argument to be passed to the function set by the setFVPPWhnTrnOnSldrMin() method. | |
bool | setOtptCurVal (const uint16_t &newVal) |
Sets the output current value register. | |
bool | setOtptSldrSpd (const uint16_t &newVal) |
Sets the output slider speed (otptSldrSpd) attribute. | |
bool | setOtptSldrStpSize (const uint16_t &newVal) |
Sets the output slider step size (otptSldrStpSize) attribute value. | |
bool | setOtptValMax (const uint16_t &newVal) |
Sets the output current value register maximum value attribute (otptValMax attribute). | |
bool | setOtptValMin (const uint16_t &newVal) |
Sets the output current value register minimum value attribute (otptValMin attribute). | |
bool | setSldrDirDn () |
Sets the value of the curSldrDirUp attribute to false. | |
bool | setSldrDirUp () |
Sets the value of the curSldrDirUp attribute to true. | |
void | setSwpDirOnEnd (const bool &newVal) |
Sets the value of the "Auto-Swap Direction on Ends" (autoSwpDirOnEnd) attribute. | |
void | setSwpDirOnPrss (const bool &newVal) |
Sets the value of the "Auto-Swap Direction On Press" (autoSwpDirOnPrss) attribute. | |
bool | swapSldrDir () |
Inverts the current curSldrDirUp attribute value. | |
Public Member Functions inherited from DblActnLtchMPBttn | |
DblActnLtchMPBttn () | |
Abstract Class default constructor. | |
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) | |
Abstract Class constructor. | |
~DblActnLtchMPBttn () | |
Virtual destructor. | |
virtual bool | begin (const unsigned long int &pollDelayMs=_StdPollDelay) |
See DbncdMPBttn::begin(const unsigned long int) | |
void | clrStatus (bool clrIsOn=true) |
See DbncddMPBttn::clrStatus(bool) | |
fncPtrType | getFnWhnTrnOffScndry () |
returns the function that is set to execute every time the object enters the Secondary Off State. | |
fncPtrType | getFnWhnTrnOnScndry () |
Returns the function that is set to execute every time the object enters the Secondary On State. | |
fncVdPtrPrmPtrType | getFVPPWhnTrnOffScndry () |
Returns a pointer to a function that is set to execute every time the object enters the Secondary Mode Off State. | |
void * | getFVPPWhnTrnOffScndryArgPtr () |
Returns a pointer to the argument to be passed to the function set to execute every time the object enters the Secondary Mode Off State. | |
fncVdPtrPrmPtrType | getFVPPWhnTrnOnScndry () |
Returns a pointer to a function that is set to execute every time the object enters the Secondary Mode On State. | |
void * | getFVPPWhnTrnOnScndryArgPtr () |
Returns a pointer to the argument to be passed to the function set to execute every time the object enters the Secondary Mode On State. | |
bool | getIsOnScndry () |
Returns the current value of the isOnScndry attribute flag. | |
unsigned long | getScndModActvDly () |
Returns the current value of the scndModActvDly class attribute. | |
void | setFnWhnTrnOffScndryPtr (void(*newFnWhnTrnOff)()) |
Sets the function that will be called to execute every time the object enters the Secondary Off State. | |
void | setFnWhnTrnOnScndryPtr (void(*newFnWhnTrnOn)()) |
Sets the function that will be called to execute every time the object enters the Secondary On State. | |
void | setFVPPWhnTrnOffScndry (fncVdPtrPrmPtrType newFVPPWhnTrnOff, void *argPtr=nullptr) |
Sets a function to be executed every time the object enters the Secondary Mode Off State. | |
void | setFVPPWhnTrnOffScndryArgPtr (void *newFVPPWhnTrnOffArgPtr) |
Sets a pointer to an argument to be passed to the function set to execute every time the object enters the Secondary Mode Off State. | |
void | setFVPPWhnTrnOnScndry (fncVdPtrPrmPtrType newFVPPWhnTrnOn, void *argPtr=nullptr) |
Sets a function to be executed every time the object enters the Secondary Mode On State. | |
void | setFVPPWhnTrnOnScndryArgPtr (void *newFVPPWhnTrnOnArgPtr) |
Sets a pointer to an argument to be passed to the function set to execute every time the object enters the Secondary Mode On State. | |
bool | setScndModActvDly (const unsigned long &newVal) |
Sets a new value for the scndModActvDly class attribute. | |
Public Member Functions inherited from LtchMPBttn | |
LtchMPBttn () | |
Default constructor. | |
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) | |
Class constructor. | |
LtchMPBttn (const LtchMPBttn &other) | |
Copy constructor. | |
virtual | ~LtchMPBttn () |
Class virtual destructor. | |
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 trnOffASAP attribute flag. | |
const bool | getUnlatchPend () const |
Returns the value of the "Valid Unlatch Pending" attribute. | |
const bool | getUnlatchRlsPend () const |
Returns the value of the "Valid Unlatch Release Pending" attribute. | |
void | setTrnOffASAP (const bool &newVal) |
Sets the value of the trnOffASAP attribute. | |
void | setUnlatchPend (const bool &newVal) |
Sets the value of the "Valid Unlatch Pending" attribute. | |
void | setUnlatchRlsPend (const bool &newVal) |
Sets the value of the "Valid Unlatch Release Pending" attribute. | |
bool | unlatch () |
Sets the values of the flags needed to unlatch a latched MPB. | |
Public Member Functions inherited from DbncdDlydMPBttn | |
DbncdDlydMPBttn () | |
Default constructor. | |
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) | |
Class constructor. | |
DbncdDlydMPBttn (const DbncdDlydMPBttn &other) | |
Copy constructor. | |
virtual | ~DbncdDlydMPBttn () |
Class destructor. | |
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) | |
void | setStrtDelay (const unsigned long int &newStrtDelay) |
Sets a new value to the "Start Delay" strtDelay attribute. | |
Public Member Functions inherited from DbncdMPBttn | |
DbncdMPBttn () | |
Default class constructor. | |
DbncdMPBttn (const uint8_t &mpbttnPin, const bool &pulledUp=true, const bool &typeNO=true, const unsigned long int &dbncTimeOrigSett=0) | |
Class constructor. | |
DbncdMPBttn (const DbncdMPBttn &other) | |
Copy 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. | |
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. | |
fncVdPtrPrmPtrType | getFVPPWhnTrnOff () |
Returns a pointer to a function that is set to execute every time the object enters the Off State. | |
void * | getFVPPWhnTrnOffArgPtr () |
Returns a pointer to the argument to be passed to the function set to execute every time the object enters the Off State. | |
fncVdPtrPrmPtrType | getFVPPWhnTrnOn () |
Returns a pointer to a function that is set to execute every time the object enters the On State. | |
void * | getFVPPWhnTrnOnArgPtr () |
Returns a pointer to the argument to be passed to the function 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. | |
const unsigned long int | getLstPollTime () |
Returns the time stamp of the last state update for the object. | |
const uint32_t | getOtptsSttsPkgd () |
Returns the relevant attribute flags values for the object state encoded as a 32 bits value. | |
const bool | getOutputsChange () const |
Returns the value of the outputsChange attribute flag. | |
const unsigned long int | getPollPeriodMs () |
Returns the poll period time setting attribute's value. | |
unsigned long int | getStrtDelay () |
Returns the current value of strtDelay attribute. | |
bool | getUpdTmrAttchd () |
Returns the value of the Attached to the update timer attribute. | |
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. | |
bool | pause () |
Pauses the software timer updating the computation of the object's internal flags value (object's state). | |
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. | |
void | setBeginDisabled (const bool &newBeginDisabled=false) |
Sets the starting isDisabled state. | |
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 | setFVPPWhnTrnOff (fncVdPtrPrmPtrType newFVPPWhnTrnOff, void *argPtr=nullptr) |
Sets a function to be executed every time the object enters the Off State. | |
void | setFVPPWhnTrnOffArgPtr (void *newFVPPWhnTrnOffArgPtr) |
Sets a pointer to an argument to be passed to the function set to execute every time the object enters the Off State. | |
void | setFVPPWhnTrnOn (fncVdPtrPrmPtrType newFVPPWhnTrnOn, void *argPtr=nullptr) |
Sets a function to be executed every time the object enters the On State. | |
void | setFVPPWhnTrnOnArgPtr (void *newFVPPWhnTrnOnArgPtr) |
Sets a pointer to an argument to be passed to the function set 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 newOutputsChange) |
Sets the value of the attribute flag indicating if a change took place in any of the output attribute flags (IsOn included). |
Models a Slider Double Action LDD-MPB combo switch, a.k.a. off/on/dimmer, a.k.a. off/on/volume radio switch)(S-DALDD-MPB)
This is a subclass of the DALDD-MPB whose secondary behavior is analog to that of a Digital potentiometer (DigiPot) or a Discreet values increment/decrement register. That means that when in the second mode, while the MPB remains pressed, an attribute set as a register changes its value -the otptCurVal register-. When the timer callback function used to keep the MPB status updated is called -while in the secondary mode state- the time since the last call is calculated and the time lapse in milliseconds is converted into Steps, using as configurable factor the outputSliderSpeed in a pre-scaler fashion. At instantiation the outputSliderSpeed is configured to 1 (step/millisecond, i.e. 1 step for each millisecond). The resulting value in "steps" is then factored by the outputSliderStepSize, which holds the value that each step will modify the otptCurVal register. The implemented embedded behavior mechanisms of the class determine how the modification of the otpCurVal register will be made, and the associated effects to the instantiated object's attribute, such as (but not limited to):
class SldrDALtchMPBttn
SldrDALtchMPBttn::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 ) |
Class constructor.
initVal | (Optional) Initial value of the wiper (taking the analogy of a potentiometer working parts), in this implementation the value corresponds to the Output Current Value (otpCurVal) attribute of the class. As the attribute type is uint16_t and the minimum and maximum limits are set to 0x0000 and 0xFFFF respectively, the initial value might be set to any value of the type. If no value is provided 0xFFFF will be the instantiation value. |
void SldrDALtchMPBttn::clrStatus | ( | bool | clrIsOn = true | ) |
fncPtrType SldrDALtchMPBttn::getFnWhnTrnOffSldrDirUp | ( | ) |
Returns the function set to be called when the slider direction is set to be decrementing (down).
The function to be executed is an attribute that might be modified by the setFnWhnTrnOffSldrDirUpPtr() method, and is a function pointer to a function with the signature void (fncPtr*) ().
nullptr | if there is no function set to be called when the slider direction is set to be decrementing (down). |
fncPtrType SldrDALtchMPBttn::getFnWhnTrnOffSldrMax | ( | ) |
Returns the function that is set to be executed every time the object's Output Current Value (otptCurVal) attribute changes after being equal to the Maximum Output Value attribute setting (otptValMax).
The function to be executed is an attribute that might be modified by the setFnWhnTrnOffSldrMaxPtr() method, and is a function pointer to a function with the signature void (fncPtr*) ().
nullptr | if there is no function set to execute when the object's otptCurVal changes from the otptValMax to a lesser value. |
fncPtrType SldrDALtchMPBttn::getFnWhnTrnOffSldrMin | ( | ) |
Returns the function that is set to execute every time the object's Output Current Value (otptCurVal) attribute changes after being equal to the Minimum Output Current Value attribute setting (otptValMin).
The function to be executed is an attribute that might be modified by the setFnWhnTrnOffSldrMinPtr() method, and is a function pointer to a function with the signature void (fncPtr*) ().
nullptr | if there is no function set to execute when the object's otptCurVal changes from the otptValMin to a lesser value. |
fncPtrType SldrDALtchMPBttn::getFnWhnTrnOnSldrDirUp | ( | ) |
Returns the function set to be called when the slider direction is set to be incrementing (up).
The function to be executed is an attribute that might be modified by the setFnWhnTrnOnSldrDirUpPtr() method, and is a function pointer to a function with the signature void (fncPtr*) ().
nullptr | if there is no function set to be called when the slider direction is set to be incrementing (up). |
fncPtrType SldrDALtchMPBttn::getFnWhnTrnOnSldrMax | ( | ) |
Returns the function that is set to execute every time the object's Output Current Value (otptCurVal) attribute reaches the Maximum Output Current Value attribute setting (otptValMax).
The function to be executed is an attribute that might be modified by the setFnWhnTrnOnSldrMaxPtr() method, and is a function pointer to a function with the signature void (fncPtr*) ().
nullptr | if there is no function set to execute when the object's otptCurVal reaches the otptValMax. |
fncPtrType SldrDALtchMPBttn::getFnWhnTrnOnSldrMin | ( | ) |
Returns the function that is set to execute every time the object's Output Current Value (otptCurVal) attribute reaches the Minimum Output Current Value attribute setting (otptValMin).
The function to be executed is an attribute that might be modified by the setFnWhnTrnOnSldrMinPtr() method, and is a function pointer to a function with the signature void (fncPtr*) ().
nullptr | if there is no function set to execute when the object's otptCurVal reaches the otptValMin. |
fncVdPtrPrmPtrType SldrDALtchMPBttn::getFVPPWhnTrnOffSldrDirUp | ( | ) |
Returns a pointer to the function that is set to be executed every time the slider direction is set to be decrementing (down).
The function to be executed is an attribute that might be modified by the setFVPPWhnTrnOffSldrDirUp() method, and is a function pointer to a function with the signature void (fncPtr*) (void*).
nullptr | if there is no function set to execute when the slider direction is set to be decrementing (down). |
void * SldrDALtchMPBttn::getFVPPWhnTrnOffSldrDirUpArgPtr | ( | ) |
Returns a pointer to the argument to be passed to the function set to execute every time the slider direction is set to be decrementing (down).
nullptr | if there is no argument for the function set to execute when the slider direction is set to be decrementing (down). |
fncVdPtrPrmPtrType SldrDALtchMPBttn::getFVPPWhnTrnOffSldrMax | ( | ) |
Returns the function that is set to be executed every time the object's Output Current Value (otptCurVal) attribute changes after being equal to the Maximum Output Value attribute setting (otptValMax).
The function to be executed is an attribute that might be modified by the setFVPPWhnTrnOffSldrMax() method, and is a function pointer to a function with the signature void (fncPtr*) (void*).
nullptr | if there is no function set to execute when the object's otptCurVal changes from the otptValMax to a lesser value. |
void * SldrDALtchMPBttn::getFVPPWhnTrnOffSldrMaxArgPtr | ( | ) |
Returns a pointer to the argument to be passed to the function set to execute every time the object's Output Current Value (otptCurVal) attribute changes after being equal to the Maximum Output Current Value attribute setting (otptValMax).
nullptr | if there is no argument for the function set to execute when the object's otptCurVal changes from the otptValMax to a lesser value. |
fncVdPtrPrmPtrType SldrDALtchMPBttn::getFVPPWhnTrnOffSldrMin | ( | ) |
Returns the function that is set to execute every time the object's Output Current Value (otptCurVal) attribute changes after being equal to the Minimum Output Current Value attribute setting (otptValMin).
The function to be executed is an attribute that might be modified by the setFnWhnTrnOffSldrMinPtr() method, and is a function pointer to a function with the signature void (fncPtr*) (void*).
nullptr | if there is no function set to execute when the object's otptCurVal changes from the otptValMin to a lesser value. |
void * SldrDALtchMPBttn::getFVPPWhnTrnOffSldrMinArgPtr | ( | ) |
Returns a pointer to the argument to be passed to the function set to execute every time the object's Output Current Value (otptCurVal) attribute exits the Minimum Output Current Value attribute setting (otptValMin).
nullptr | if there is no argument for the function set to execute when the object's otptCurVal exits the otptValMin setting. |
fncVdPtrPrmPtrType SldrDALtchMPBttn::getFVPPWhnTrnOnSldrDirUp | ( | ) |
Returns a pointer to the function that is set to be executed every time the slider direction is set to be incrementing (up).
The function to be executed is an attribute that might be modified by the setFVPPWhnTrnOnSldrDirUp() method, and is a function pointer to a function with the signature void (fncPtr*) (void*).
nullptr | if there is no function set to execute when the slider direction is set to be incrementing (up). |
void * SldrDALtchMPBttn::getFVPPWhnTrnOnSldrDirUpArgPtr | ( | ) |
Returns a pointer to the argument to be passed to the function set to execute every time the slider direction is set to be incrementing (up).
nullptr | if there is no argument for the function set to execute when the slider direction is set to be incrementing (up). |
fncVdPtrPrmPtrType SldrDALtchMPBttn::getFVPPWhnTrnOnSldrMax | ( | ) |
Returns the function that is set to execute every time the object's Output Current Value (otptCurVal) attribute reaches the Maximum Output Current Value attribute setting (otptValMax).
The function to be executed is an attribute that might be modified by the setFVPPWhnTrnOnSldrMax() method, and is a function pointer to a function with the signature void (fncPtr*) (void*).
nullptr | if there is no function set to execute when the object's otptCurVal reaches the otptValMax. |
void * SldrDALtchMPBttn::getFVPPWhnTrnOnSldrMaxArgPtr | ( | ) |
Returns a pointer to the argument to be passed to the function set to execute every time the object's Output Current Value (otptCurVal) attribute reaches the Maximum Output Current Value attribute setting (otptValMax).
nullptr | if there is no argument for the function set to execute when the object's otptCurVal reaches the otptValMax setting. |
fncVdPtrPrmPtrType SldrDALtchMPBttn::getFVPPWhnTrnOnSldrMin | ( | ) |
Returns the function that is set to execute every time the object's Output Current Value (otptCurVal) attribute reaches the Minimum Output Current Value attribute setting (otptValMin).
The function to be executed is an attribute that might be modified by the setFnWhnTrnOnSldrMinPtr() method, and is a function pointer to a function with the signature void (fncPtr*) (Void*).
nullptr | if there is no function set to execute when the object's otptCurVal reaches the otptValMin. |
void * SldrDALtchMPBttn::getFVPPWhnTrnOnSldrMinArgPtr | ( | ) |
Returns a pointer to the argument to be passed to the function set to execute every time the object's Output Current Value (otptCurVal) attribute reaches the Minimum Output Current Value attribute setting (otptValMin).
uint16_t SldrDALtchMPBttn::getOtptCurVal | ( | ) |
Returns the Output Current Value (otpCurVal) attribute.
bool SldrDALtchMPBttn::getOtptCurValIsMax | ( | ) |
Returns a boolean value indicating if the "Output Current Value" equals the maximum limit.
The value returned is the result of comparing the Output Current Value to the Maximum value setting
true | The Output Current Value is equal to the Maximum value setting, i.e. the otpCurVal has reached the "top" of the configured range of accepted values. |
false | The Output Current Value is not equal to the Maximum value setting. |
bool SldrDALtchMPBttn::getOtptCurValIsMin | ( | ) |
Returns the result of comparing the Output Current Value to the Minimum value setting
The value returned is the result of comparing the Output Current Value to the Minimum value setting
true | The Output Current Value is equal to the Minimum value setting, i.e. the otpCurVal has reached the "bottom" of the configured range of accepted values. |
false | The Output Current Value is not equal to the Minimum value setting. |
unsigned long SldrDALtchMPBttn::getOtptSldrSpd | ( | ) |
Returns the current setting for the Output Slider Speed value.
The outputSliderSpeed attribute is the configurable factor used to convert the time passed since the MPB entered it's secondary mode in milliseconds into Steps -Slider mode steps- in a pre-scaler fashion.
uint16_t SldrDALtchMPBttn::getOtptSldrStpSize | ( | ) |
Returns the current setting for the Output Slider Step Size value.
The outputSliderStepSize is the factor by which the change in steps is multiplied to calculate the total modification of the otpCurVal register. As the steps modification is calculated each time the timer callback function is called the variation is done in successive steps while the MPB is kept pressed, and not just when it is finally released.
uint16_t SldrDALtchMPBttn::getOtptValMax | ( | ) |
Returns the top output current value register setting.
uint16_t SldrDALtchMPBttn::getOtptValMin | ( | ) |
Returns the bottom output current value register setting.
bool SldrDALtchMPBttn::getSldrDirUp | ( | ) |
Returns the value of the curSldrDirUp attribute.
The curSldrDirUp attribute indicates the direction at which the outputCurrentValue register is being modified. If the current slider direction is up, means the change of value must be treated as an increment, while having the current slider direction down means it's value must be treated as a decrement.
true | The current slider direction is Up, the output current value will be incremented. |
false | The current slider direction is Down, the output current value will be decremented. |
void SldrDALtchMPBttn::setFnWhnTrnOffSldrDirUp | ( | void(* | newFnWhnTrnOff )() | ) |
Sets the function that will be called every time the slider direction is set to be decrementing (down).
The function to be executed is an attribute that might be modified by the setFnWhnTrnOffSldrDirUp() method, and is a function pointer to a function with the signature void (fncPtr*) ().
newFnWhnTrnOff | The function pointer to a function with the signature void (fncPtr*) (). |
void SldrDALtchMPBttn::setFnWhnTrnOffSldrMaxPtr | ( | void(* | newFnWhnTrnOff )() | ) |
Sets a function that will be called every time the object's Output Current Value (otptCurVal) attribute changes after being equal to the Maximum Output Value attribute setting (otptValMax).
newFnWhnTrnOff | The function pointer to a function with the signature void (fncPtr*) (). |
void SldrDALtchMPBttn::setFnWhnTrnOffSldrMinPtr | ( | void(* | newFnWhnTrnOff )() | ) |
Sets a function that will be called every time the object's Output Current Value (otptCurVal) attribute changes after being equal to the Minimum Output Value attribute setting (otptValMin).
newFnWhnTrnOff | The function pointer to a function with the signature void (fncPtr*) (). |
void SldrDALtchMPBttn::setFnWhnTrnOnSldrDirUp | ( | void(* | newFnWhnTrnOn )() | ) |
Sets the function that will be called every time the slider direction is set to be incrementing (up).
newFnWhnTrnOn | Pointer to a function with the signature void (fncPtr*) (). |
void SldrDALtchMPBttn::setFnWhnTrnOnSldrMaxPtr | ( | void(* | newFnWhnTrnOn )() | ) |
Sets a function that will be called every time the object's Output Current Value (otptCurVal) reaches the Maximum Output Value attribute setting (otptValMax).
newFnWhnTrnOn | The function pointer to a function with the signature void (fncPtr*) (). |
void SldrDALtchMPBttn::setFnWhnTrnOnSldrMinPtr | ( | void(* | newFnWhnTrnOn )() | ) |
Sets a function that will be called every time the object's Output Current Value (otptCurVal) attribute reaches the Minimum Output Current Value attribute setting (otptValMin).
newFnWhnTrnOn | The function pointer to a function with the signature void (fncPtr*) (). |
void SldrDALtchMPBttn::setFVPPWhnTrnOffSldrDirUp | ( | fncVdPtrPrmPtrType | newFVPPWhnTrnOff, |
void * | argPtr = nullptr ) |
Sets a function that will be called every time the slider direction is set to be decrementing (down).
The function is set as a pointer to a function with the signature void (fncPtr*) (void*).
newFVPPWhnTrnOff | Pointer to the function to be called. |
argPtr | (optional) void* pointer to the argument passed to the function, if no value is provided nullptr will be set. The function argument pointer might be changed independently by the use of the void setFVPPWhnTrnOffSldrDirUpArgPtr (void*) method. |
void SldrDALtchMPBttn::setFVPPWhnTrnOffSldrDirUpArgPtr | ( | void * | newFVPPWhnTrnOffArgPtr | ) |
Sets a pointer to an argument to be passed to the function set by the setFVPPWhnTrnOffSldrDirUp() method.
newFVPPWhnTrnOffArgPtr | Pointer to an argument to be passed to the function set by the setFVPPWhnTrnOffSldrDirUp() method. |
void SldrDALtchMPBttn::setFVPPWhnTrnOffSldrMax | ( | fncVdPtrPrmPtrType | newFVPPWhnTrnOff, |
void * | argPtr = nullptr ) |
Sets a function that will be called every time the object's Output Current Value (otptCurVal) attribute changes after being equal to the Maximum Output Value attribute setting (otptValMax).
The function is set as a pointer to a function with the signature void (fncPtr*) (void*).
newFVPPWhnTrnOff | Pointer to the function to be called. |
argPtr | (optional) void* pointer to the argument passed to the function, if no value is provided nullptr will be set. The function argument pointer might be changed independently by the use of the void setFVPPWhnTrnOffSldrMaxArgPtr (void*) method. |
void SldrDALtchMPBttn::setFVPPWhnTrnOffSldrMaxArgPtr | ( | void * | newFVPPWhnTrnOffArgPtr | ) |
Sets a pointer to an argument to be passed to the function set by the setFVPPWhnTrnOffSldrMax() method.
newFVPPWhnTrnOffArgPtr | Pointer to an argument to be passed to the function set by the setFVPPWhnTrnOffSldrMax() method. |
void SldrDALtchMPBttn::setFVPPWhnTrnOffSldrMin | ( | fncVdPtrPrmPtrType | newFVPPWhnTrnOff, |
void * | argPtr = nullptr ) |
Sets a function that will be called every time the object's Output Current Value (otptCurVal) attribute changes after being equal to the Minimum Output Value attribute setting (otptValMin).
The function is set as a pointer to a function with the signature void (fncPtr*) (void*).
newFVPPWhnTrnOff | Pointer to the function to be called. |
argPtr | (optional) void* pointer to the argument passed to the function, if no value is provided nullptr will be set. The function argument pointer might be changed independently by the use of the void setFVPPWhnTrnOffSldrMinArgPtr (void*) method. |
void SldrDALtchMPBttn::setFVPPWhnTrnOffSldrMinArgPtr | ( | void * | newFVPPWhnTrnOffArgPtr | ) |
Sets a pointer to an argument to be passed to the function set by the setFVPPWhnTrnOffSldrMin() method.
newFVPPWhnTrnOffArgPtr | Pointer to an argument to be passed to the function set by the setFVPPWhnTrnOffSldrMin() method. |
void SldrDALtchMPBttn::setFVPPWhnTrnOnSldrDirUp | ( | fncVdPtrPrmPtrType | newFVPPWhnTrnOn, |
void * | argPtr = nullptr ) |
Sets a function that will be called every time the slider direction is set to be incrementing (up).
The function is set as a pointer to a function with the signature void (fncPtr*) (void*).
newFVPPWhnTrnOn | Pointer to the function to be called. |
argPtr | (optional) void* pointer to the argument passed to the function, if no value is provided nullptr will be set. The function argument pointer might be changed independently by the use of the void setFVPPWhnTrnOnSldrDirUpArgPtr (void*) method. |
void SldrDALtchMPBttn::setFVPPWhnTrnOnSldrDirUpArgPtr | ( | void * | newFVPPWhnTrnOnArgPtr | ) |
Sets a pointer to an argument to be passed to the function set by the setFVPPWhnTrnOnSldrDirUp() method.
newFVPPWhnTrnOnArgPtr | Pointer to an argument to be passed to the function set by the setFVPPWhnTrnOnSldrDirUp() method. |
void SldrDALtchMPBttn::setFVPPWhnTrnOnSldrMax | ( | fncVdPtrPrmPtrType | newFVPPWhnTrnOn, |
void * | argPtr = nullptr ) |
Sets a function that will be called every time the object's Output Current Value (otptCurVal) attribute reaches the Maximum Output Value attribute setting (otptValMax).
The function is set as a pointer to a function with the signature void (fncPtr*) (void*).
newFVPPWhnTrnOff | Pointer to the function to be called. |
argPtr | (optional) void* pointer to the argument passed to the function, if no value is provided nullptr will be set. The function argument pointer might be changed independently by the use of the void setFVPPWhnTrnOnSldrMaxArgPtr (void*) method. |
void SldrDALtchMPBttn::setFVPPWhnTrnOnSldrMaxArgPtr | ( | void * | newFVPPWhnTrnOnArgPtr | ) |
Sets a pointer to an argument to be passed to the function set by the setFVPPWhnTrnOnSldrMax() method.
newFVPPWhnTrnOnArgPtr | Pointer to an argument to be passed to the function set by the setFVPPWhnTrnOnSldrMax() method. |
void SldrDALtchMPBttn::setFVPPWhnTrnOnSldrMin | ( | fncVdPtrPrmPtrType | newFVPPWhnTrnOn, |
void * | argPtr = nullptr ) |
Sets a function that will be called every time the object's Output Current Value (otptCurVal) attribute reaches the Minimum Output Value attribute setting (otptValMin).
The function is set as a pointer to a function with the signature void (fncPtr*) (void*).
newFVPPWhnTrnOff | Pointer to the function to be called. |
argPtr | (optional) void* pointer to the argument passed to the function, if no value is provided nullptr will be set. The function argument pointer might be changed independently by the use of the void setFVPPWhnTrnOnSldrMinArgPtr (void*) method. |
void SldrDALtchMPBttn::setFVPPWhnTrnOnSldrMinArgPtr | ( | void * | newFVPPWhnTrnOnArgPtr | ) |
Sets a pointer to an argument to be passed to the function set by the setFVPPWhnTrnOnSldrMin() method.
newFVPPWhnTrnOnArgPtr | Pointer to an argument to be passed to the function set by the setFVPPWhnTrnOnSldrMin() method. |
bool SldrDALtchMPBttn::setOtptCurVal | ( | const uint16_t & | newVal | ) |
Sets the output current value register.
The new value for the output current value register must be in the range otptValMin <= newVal <= otptValMax
newVal | The new value for the output current value register. |
true | The new value was within valid range, the output current value register is set to the parameter passed. |
false | The new value was outside valid range, the change was not made. |
bool SldrDALtchMPBttn::setOtptSldrSpd | ( | const uint16_t & | newVal | ) |
Sets the output slider speed (otptSldrSpd) attribute.
As described in the SldrDALtchMPBttn class definition, the otptSldrSpd value is the factor by which the time between two readings of the MPB pressing state in secondary mode is converted into "slider steps". At instantiation the value is set to 1, meaning 1 millisecond is equivalent to 1 step, the "**slowest**" speed configuration. Rising the value will make each millisecond represent more steps, making the change of current value faster.
newVal | The new value for the otptSldrSpd attribute. |
true | The parameter was a valid value, the attribute is set to the new value. |
false | The parameter is an invalid value, the attribute is not changed. |
bool SldrDALtchMPBttn::setOtptSldrStpSize | ( | const uint16_t & | newVal | ) |
Sets the output slider step size (otptSldrStpSize) attribute value.
newVal | The new value for the outputSliderStepSize attribute. |
true | If newVal <= (otptValMax - otptValMin), the value of the outputSliderStepSize attribute is changed. |
false | Otherwise, and the value of the outputSliderStepSize attribute is not changed. |
bool SldrDALtchMPBttn::setOtptValMax | ( | const uint16_t & | newVal | ) |
Sets the output current value register maximum value attribute (otptValMax attribute).
The new value for the otptValMax attribute must be in the range otptValMin < newVal <= 0xFFFF
newVal | The new value for the otptValMax attribute. |
true | The new value was within valid range, the otptValMax attribute change was made. |
false | The new value was outside valid range, the change was not made. |
bool SldrDALtchMPBttn::setOtptValMin | ( | const uint16_t & | newVal | ) |
Sets the output current value register minimum value attribute (otptValMin attribute).
The new value for the otptValMin attribute must be in the range 0x0000<= newVal < otptValMax.
newVal | The new value for the otptValMin attribute. |
true | The new value was within valid range, the otptValMin attribute change was made. |
false | The new value was outside valid range, the change was not made. |
bool SldrDALtchMPBttn::setSldrDirDn | ( | ) |
Sets the value of the curSldrDirUp attribute to false.
The curSldrDirUp attribute dictates how the calculated output value change -resulting from the time lapse between checks, the otptSldrSpd and the otptSldrStpSize attributes- will be applied to the otptCurVal attribute.
true | The change of direction was successful |
true | The change of direction failed as the otptCurVal was equal to the extreme value |
bool SldrDALtchMPBttn::setSldrDirUp | ( | ) |
Sets the value of the curSldrDirUp attribute to true.
The curSldrDirUp attribute dictates how the calculated output value change -resulting from the time lapse between checks, the otptSldrSpd and the otptSldrStpSize attributes- will be applied to the otptCurVal attribute.
true | The change of direction was successful |
true | The change of direction failed as the otptCurVal was equal to the extreme value |
void SldrDALtchMPBttn::setSwpDirOnEnd | ( | const bool & | newVal | ) |
Sets the value of the "Auto-Swap Direction on Ends" (autoSwpDirOnEnd) attribute.
The autoSwpDirOnEnd is one of the attributes that configures the slider behavior, setting what the MPB must do when reaching one of the output values range limits. If a limit -otptValMin or otptValMax- is reached while the MPBttn is kept pressed and in secondary mode, the otptCurVal register increment/decrement can be stopped until a change of direction is invoked through setSldrDirUp(), setSldrDirDn() or swpSldrDir() methods, or automatically through the "Auto-Swap Direction on Ends" (autoSwpDirOnEnd) and the "Swap Direction on MPB press" (autoSwpDirOnPrss). If the autoSwpDirOnEnd attribute is set (true) the increment direction of the otptCurVal will be automatically inverted when it reaches otptValMax or otptValMin. If it's not set the otptCurVal will not change value until one of the described alternative methods is invoked, or the MPB is released and pushed back if the autoSwpDirOnPrss is set -see setSwpDirOnPrss(const bool).
newVal | The new value for the autoSwpDirOnEnd attribute |
void SldrDALtchMPBttn::setSwpDirOnPrss | ( | const bool & | newVal | ) |
Sets the value of the "Auto-Swap Direction On Press" (autoSwpDirOnPrss) attribute.
The autoSwpDirOnPrss is one of the attributes that configures the slider behavior, setting what the MPB must do when the MPB object enters in secondary mode, referring to the increment or decrement directions. If the autoSwpDirOnPrss attribute is set (true) the increment direction of the otptCurVal will be automatically inverted every time the MPB is pressed back into secondary mode. If the otptCurVal was incrementing when the MPB was last released. the otptCurVal will start decrementing the next time is pressed to enter secondary mode, and vice versa. If it's not set the otptCurVal will not change direction until it reaches one the limit values, or until one of the described alternative methods is invoked, or the MPB's autoSwpDirOnEnd attribute is set -see setSwpDirOnEnd(const bool) for more details.
newVal | The new value for the autoSwpDirOnPrss attribute |
bool SldrDALtchMPBttn::swapSldrDir | ( | ) |
Inverts the current curSldrDirUp attribute value.
Whatever the previous value of the curSldrDirUp flag, the method invocation inverts it's value, and as a consequence the inverts the direction of the otptCurVal update. If it was incrementing it will start decrementing, and vice versa, considering all the other factors, attributes and attribute flags involved in the embedded object behavior (minimum and maximum settings, the direction changes if pressed, reaches limits, etc.)