A simple class to assign functions to gpio pins e.g. to implement a simple navigation control or volume control with buttons.
More...
#include <AudioActions.h>
|
enum | ActiveLogic : uint8_t { ActiveLow
, ActiveHigh
, ActiveChange
, ActiveTouch
} |
|
|
| 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 | setTouchLimit (int value) |
| Defines the touch limit (Default 20)
|
|
void | setUsePinInterrupt (bool active) |
| Use interrupts instead of processActions() call in loop.
|
|
|
void | insertAction (Action &action) |
|
void | setupPin (int pin, ActiveLogic logic) |
|
|
static void | audioActionsISR () |
|
|
Vector< Action * > | actions {0} |
|
int | debounceDelayValue = 500 |
|
int | touchLimit = 20 |
|
bool | use_pin_interrupt = false |
|
bool | use_pin_mode = true |
|
A simple class to assign functions to gpio pins e.g. to implement a simple navigation control or volume control with buttons.
The documentation for this class was generated from the following file: