7template <
unsigned NumISR>
9 return interrupt == NumISR - 1
11 : get_isr<NumISR - 1>(interrupt);
15inline auto AHEncoder::get_isr<0>(
unsigned) ->
isr_func_t {
63 uint8_t s =
state & 0b11;
#define CS_ENCODER_ISR_ATTR
#define BEGIN_CS_NAMESPACE
AtomicPosition< int32_t > position
void(*)() isr_func_t
The type of a handler function.
static isr_func_t get_isr(unsigned interrupt)
Get a pointer to the interrupt handler function for the given interrupt.
static AHEncoder * instance_table[NUM_DIGITAL_PINS]
Array of pointers to all instances with active interrupts.
void write(int32_t p)
Set the absolute position to the given value.
uint8_t interrupts_in_use
int32_t read()
Read the current absolute position of the encoder.
int32_t readAndReset(int32_t newpos=0)
Read the current absolute position of the encoder and reset it to zero afterwards.
DirectPinRead direct_pins[2]
void update()
Private handler function that is called from the ISR.