9#ifdef ARDUINO_ARCH_RP2040
25 Pio::StateMachine stateMachine;
31 EncoderPico(uint8_t pinA, uint8_t pinB)
43 if (abs(pinA - pinB) != 1)
49 if (
const auto sm = Pio::AllocateStateMachine(Pio::Encoder::quadrature_encoder_program))
59 const auto pin = min(pinA, pinB);
62 Pio::Encoder::quadrature_encoder_program_init(stateMachine.pio, stateMachine.index, stateMachine.offset, pin, 0);
71 return Pio::Encoder::quadrature_encoder_get_count(stateMachine.pio, stateMachine.index);