andysworkshop / stm32plus

The C++ library for the STM32 F0, F100, F103, F107 and F4 microcontrollers

Home Page:http://www.andybrown.me.uk

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Encoder support for both edges

mikepurvis opened this issue · comments

stm32plus currently supports only rising or falling edge:

enum class EncoderPolarity {
Rising, ///! Rising edge transition
Falling ///! Falling edge transition
};

But the underlying fwlib has an option for TIM_ICPolarity_BothEdge:

#define TIM_ICPolarity_Rising ((uint16_t)0x0000)
#define TIM_ICPolarity_Falling ((uint16_t)0x0002)
#define TIM_ICPolarity_BothEdge ((uint16_t)0x000A)

Woot, thanks!