As far as I know Mbed hasn’t provided any API for a quadrature decoder for any supported target yet. Nevertheless, a Quadrature Encoder Interface library is available published by Aaron Berk. The library is based on the InterruptIn API.
According to the high density STM32F103xC STM32F103xD STM32F103xE datasheet those MCUs are equipped with four 16-bit timers, each with up to 4 IC/OC/PWM or pulse counter and quadrature (incremental) encoder input. However, the low and mid density STM32F103x6 STM32F103x8 STM32F103xB datasheet does not mention such feature. Anyway, to utilize the builtin quadrature encoder you’ll most likely have to use STM’s HAL API. For more info have a look also at STM’s Reference Manual RM0008 - Chapter 14.3.16 Encoder interface mode.
1 Like