34#include <Settings/NamespaceSettings.hpp>
42#define ENCODER_ARGLIST_SIZE CORE_NUM_INTERRUPT
103 void write(int32_t p);
#define ENCODER_ARGLIST_SIZE
volatile IO_REG_TYPE * pin1_register
volatile IO_REG_TYPE * pin2_register
All the data needed by interrupts is consolidated into this ugly struct to facilitate assembly langua...
#define BEGIN_CS_NAMESPACE
Class for reading quadrature encoders, based on http://www.pjrc.com/teensy/td_libs_Encoder....
Encoder(uint8_t pin1, uint8_t pin2)
Constructor.
Encoder(const Encoder &)=delete
Copy constructor: copying an Encoder object is semantically meaningless, so it has been deleted.
Encoder_internal_state_t encoder
int32_t readAndReset()
Read the current absolute position of the encoder and reset it to zero afterwards.
void attachInterruptCtx(int interrupt)
void write(int32_t p)
Set the absolute position to the given value.
void detachInterruptCtx(int interrupt)
static Encoder_internal_state_t * interruptArgs[CORE_NUM_INTERRUPT]
Similarly to update(), don't use these interrupt handler arguments from your sketch.
static void update(Encoder_internal_state_t *arg)
update() is not meant to be called from outside Encoder, but it is public to allow static interrupt r...
uint8_t interrupts_in_use
int32_t read()
Read the current absolute position of the encoder.
void end()
Disable the interrupts used by this encoder.
void begin()
Initialize this encoder by enabling the pull-up resistors and attaching the interrupts handlers (if i...
Encoder & operator=(const Encoder &)=delete
Copy assignment: copying an Encoder object is semantically meaningless, so it has been deleted.