Encoder input using timers.
Encoder status.
Encoder direction.
Encoder mode. See TIMx_SMCR.SMS item in datasheet.
TIMx_SMCR.SMS