Projet voilier 4IRA1 Arnaud Vergnet Marino Benassai Bastien Picco Yohan Simard
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

IncrementalEncoder.c 565B

12345678910111213141516171819202122232425
  1. #include "IncrementalEncoder.h"
  2. #include "Timer.h"
  3. #include "GPIO.h"
  4. void IncrementalEncoder_conf(TIM_TypeDef * timer, GPIO_TypeDef * gpio, int pin)
  5. {
  6. Timer_encoder_conf(timer);
  7. GPIO_conf(gpio, pin, LL_GPIO_MODE_INPUT, LL_GPIO_OUTPUT_PUSHPULL, LL_GPIO_PULL_UP);
  8. }
  9. void IncrementalEncoder_start(TIM_TypeDef * timer)
  10. {
  11. Timer_start(timer);
  12. }
  13. int IncrementalEncoder_getAngle(TIM_TypeDef * timer)
  14. {
  15. return Timer_encoder_getAngle(timer);
  16. }
  17. enum CounterDirection IncrementalEncoder_getDirection(TIM_TypeDef * timer)
  18. {
  19. return Timer_encoder_getDirection(timer);
  20. }