A simple class to assign functions to gpio pins e.g. to implement a simple navigation control or volume control with buttons.
More...
|
| | AudioActions (bool useInterrupt=false) |
| | Default constructor.
|
| |
| virtual | ~AudioActions () |
| | deletes all actions
|
| |
| void | add (Action &action) |
| | Adds an Action.
|
| |
| void | add (int pin, void(*actionOn)(bool pinStatus, int pin, void *ref), ActiveLogic activeLogic=ActiveLow, void *ref=nullptr) |
| | Adds an action.
|
| |
| void | add (int pin, void(*actionOn)(bool pinStatus, int pin, void *ref), void(*actionOff)(bool pinStatus, int pin, void *ref), ActiveLogic activeLogicPar=ActiveLow, void *ref=nullptr) |
| | Adds an action.
|
| |
| void | clear () |
| |
| Action * | findAction (int id) |
| | Determines the action for the pin/id.
|
| |
| int | findActionIdx (int id) |
| | Determines the action for the pin/id.
|
| |
| void | processActions () |
| | Execute all actions if the corresponding pin is low To minimize the runtime: With each call we process a different pin.
|
| |
| void | processAllActions () |
| | Execute all actions.
|
| |
| void | setDebounceDelay (int value) |
| | Defines the debounce delay.
|
| |
| void | setEnabled (int pin, bool enabled) |
| | enable/disable pin actions
|
| |
| void | setPinMode (bool active) |
| | setup pin mode when true
|
| |
| void | setReadCallback (std::function< bool(int)> read_cb_par) |
| | Sets a callback function to read the pin state.
|
| |
| void | setTouchLimit (int value) |
| | Defines the touch limit (Default 20)
|
| |
| void | setUsePinInterrupt (bool active) |
| | Use interrupts instead of processActions() call in loop.
|
| |
A simple class to assign functions to gpio pins e.g. to implement a simple navigation control or volume control with buttons.