/* Quadrature encoder on GP10 (A) / GP11 (B), pull-ups, decoded in the GPIO interrupt with a state table. The bench encoder gives 4 edges per click and rests with both contacts open (A = B = 1). As wired, the raw count runs down when turned clockwise, so the driver flips it: + = clockwise. A click counts when the shaft comes back to rest, so jitter around a detent doesn't count. */ #ifndef SEEDBOX_ENCODER_H #define SEEDBOX_ENCODER_H #include void encoder_init(void); int32_t encoder_count(void); /* clicks, + = clockwise */ int32_t encoder_steps(void); /* raw edges, for the bench */ int encoder_ab(void); /* current A << 1 | B */ #endif