12345678910111213141516171819202122232425 |
- #include "IncrementalEncoder.h"
-
- #include "Timer.h"
- #include "GPIO.h"
-
- void IncrementalEncoder_conf(TIM_TypeDef * timer, GPIO_TypeDef * gpio, int pin)
- {
- Timer_encoder_conf(timer);
- GPIO_conf(gpio, pin, LL_GPIO_MODE_INPUT, LL_GPIO_OUTPUT_PUSHPULL, LL_GPIO_PULL_UP);
- }
-
- void IncrementalEncoder_start(TIM_TypeDef * timer)
- {
- Timer_start(timer);
- }
-
- int IncrementalEncoder_getAngle(TIM_TypeDef * timer)
- {
- return Timer_encoder_getAngle(timer);
- }
-
- enum CounterDirection IncrementalEncoder_getDirection(TIM_TypeDef * timer)
- {
- return Timer_encoder_getDirection(timer);
- }
|