diff --git a/Services/IncrementalEncoder.c b/Services/IncrementalEncoder.c index cefd96c..b963f52 100644 --- a/Services/IncrementalEncoder.c +++ b/Services/IncrementalEncoder.c @@ -1,11 +1,12 @@ #include "IncrementalEncoder.h" #include "Timer.h" +#include "GPIO.h" -void IncrementalEncoder_conf(TIM_TypeDef * timer) +void IncrementalEncoder_conf(TIM_TypeDef * timer, GPIO_TypeDef * gpio, int pin) { Timer_encoder_conf(timer); - // TODO GPIO config + GPIO_conf(gpio, pin, LL_GPIO_MODE_INPUT, LL_GPIO_OUTPUT_PUSHPULL, LL_GPIO_PULL_UP); } void IncrementalEncoder_start(TIM_TypeDef * timer) diff --git a/Services/IncrementalEncoder.h b/Services/IncrementalEncoder.h index 3137432..5882333 100644 --- a/Services/IncrementalEncoder.h +++ b/Services/IncrementalEncoder.h @@ -9,7 +9,7 @@ * @param TIM_TypeDef Timer : indique le timer à utiliser : TIM1, TIM2, TIM3 ou TIM4 * @retval None */ -void IncrementalEncoder_conf(TIM_TypeDef * timer); +void IncrementalEncoder_conf(TIM_TypeDef * timer, GPIO_TypeDef * gpio, int pin); /** * @brief Démarre le codeur incrémental associé au timer donné