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

Connect a quadrature rotary encoder, and handle it at audio rate from Bela. More...

#include <BelaEncoder.h>

Inheritance diagram for BelaEncoder:
Encoder

Classes

struct  Pins
struct  Settings

Public Member Functions

 BelaEncoder (const Settings &settings)
int setup (const Settings &settings)
Rotation process (BelaContext *context)
Rotation process (BelaContext *context, unsigned int frame)
Public Member Functions inherited from Encoder
 Encoder (unsigned int debounce, Polarity polarity=ANY)
void setup (unsigned int debounce, Polarity polarity=ANY)
void reset (int position=0)
Rotation process (bool a, bool b)
int get ()

Additional Inherited Members

Public Types inherited from Encoder
enum  Rotation { CCW = -1 , NONE = 0 , CW = 1 }
enum  Polarity { ANY , ACTIVE_LOW , ACTIVE_HIGH }

Detailed Description

Connect a quadrature rotary encoder, and handle it at audio rate from Bela.

This class is a Bela-specific wrapper for Encoder, which is Bela-agnostic. All the methods of BelaEncoder map to those of Encoder, and so only the differences between the two are documented here.

Member Function Documentation

◆ process() [1/2]

Encoder::Rotation BelaEncoder::process ( BelaContext * context)

Call this method once per block.

If more than one rotation happens during a block, the internal counter is updated for each rotation, but only the direction of the last one is returned.

◆ process() [2/2]

Rotation BelaEncoder::process ( BelaContext * context,
unsigned int frame )
inline

Call this method once per frame.


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