AwesomeStudioPedal
A programmable, multi-profile foot controller for DAWs, score readers, and studio automation
Loading...
Searching...
No Matches
IButton Class Referenceabstract

Interface for interrupt-driven button input. More...

#include <i_button.h>

Inheritance diagram for IButton:
Button Button

Public Member Functions

virtual ~IButton ()=default
 
virtual void setup ()=0
 Initializes the GPIO pin for button input.
 
virtual bool event ()=0
 Checks for a button press event and clears the flag.
 
virtual void reset ()=0
 Resets the pressed flag.
 
virtual bool releaseEvent ()
 Checks for a button release event and clears the flag.
 

Detailed Description

Interface for interrupt-driven button input.

Abstracts button press detection so that PedalLogic is independent of the concrete hardware ISR mechanism. Implementations live in the platform-specific hardware packages.

Definition at line 11 of file i_button.h.

Constructor & Destructor Documentation

◆ ~IButton()

virtual IButton::~IButton ( )
virtualdefault

Member Function Documentation

◆ event()

virtual bool IButton::event ( )
pure virtual

Checks for a button press event and clears the flag.

Returns
true if the button was pressed since the last call, false otherwise

Implemented in Button, and Button.

◆ releaseEvent()

virtual bool IButton::releaseEvent ( )
inlinevirtual

Checks for a button release event and clears the flag.

Returns true exactly once per release edge (HIGH after press), then resets. Uses the ISR's awaitingRelease flag — safe to call from the main loop.

Reimplemented in Button, and Button.

Definition at line 45 of file i_button.h.

◆ reset()

virtual void IButton::reset ( )
pure virtual

Resets the pressed flag.

Called before attaching interrupts to ensure no stale press is processed immediately after the interrupt handler is installed.

Implemented in Button, and Button.

◆ setup()

virtual void IButton::setup ( )
pure virtual

Initializes the GPIO pin for button input.

Configures the pin as input with pull-up and any platform-specific GPIO setup required before interrupts can be attached.

Implemented in Button, and Button.


The documentation for this class was generated from the following file: