Bela
Real-time, ultra-low-latency audio and sensor processing system for BeagleBone Black
Loading...
Searching...
No Matches
GpioDebounce Class Reference

#include <GpioDebounce.h>

Inheritance diagram for GpioDebounce:
Debounce

Public Member Functions

 GpioDebounce (unsigned int interval, unsigned int channel)
int setup (unsigned int interval, unsigned int channel)
bool process ()
Public Member Functions inherited from Debounce
 Debounce (unsigned int interval)
 Debounce (const Settings &settings)
void setup (unsigned int interval)
void setup (const Settings &settings)
bool process (bool input)
bool get ()
Edge edgeDetected ()

Additional Inherited Members

Public Types inherited from Debounce
enum  Edge { FALLING = -1 , NONE = 0 , RISING = 1 }
Static Public Member Functions inherited from Debounce
static Edge detectEdge (bool oldState, bool newState)
Protected Attributes inherited from Debounce
bool state
bool oldState

Detailed Description

A debounced reading from a Gpio.

Constructor & Destructor Documentation

◆ GpioDebounce()

GpioDebounce::GpioDebounce ( unsigned int interval,
unsigned int channel )

Same as setup(), but throws on error.

Member Function Documentation

◆ setup()

int GpioDebounce::setup ( unsigned int interval,
unsigned int channel )

Set up the Gpio and debouncer.

Parameters
debouncethe number of calls to process() during which changes are ignored after a change in the input vaulue has been detected.
channelthe GPIO channel, as passed to Gpio::open()
Returns
0 on success or an error code otherwise.

◆ process()

bool GpioDebounce::process ( )
inline

Read an input from the Gpio and provide an output.


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