Bela
Real-time, ultra-low-latency audio and sensor processing system for BeagleBone Black
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Classes | Public Member Functions | List of all members
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

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.

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: