Browse Source

add gpio config

Arnaud Vergnet 3 years ago
parent
commit
6ded190d3d
2 changed files with 4 additions and 3 deletions
  1. 3
    2
      Services/IncrementalEncoder.c
  2. 1
    1
      Services/IncrementalEncoder.h

+ 3
- 2
Services/IncrementalEncoder.c View File

@@ -1,11 +1,12 @@
1 1
 #include "IncrementalEncoder.h"
2 2
 
3 3
 #include "Timer.h"
4
+#include "GPIO.h"
4 5
 
5
-void IncrementalEncoder_conf(TIM_TypeDef * timer)
6
+void IncrementalEncoder_conf(TIM_TypeDef * timer, GPIO_TypeDef * gpio, int pin)
6 7
 {
7 8
 	Timer_encoder_conf(timer);
8
-	// TODO GPIO config
9
+	GPIO_conf(gpio, pin, LL_GPIO_MODE_INPUT, LL_GPIO_OUTPUT_PUSHPULL, LL_GPIO_PULL_UP);
9 10
 }
10 11
 
11 12
 void IncrementalEncoder_start(TIM_TypeDef * timer)

+ 1
- 1
Services/IncrementalEncoder.h View File

@@ -9,7 +9,7 @@
9 9
 	* @param  TIM_TypeDef Timer : indique le timer à utiliser : TIM1, TIM2, TIM3 ou TIM4
10 10
   * @retval None
11 11
   */
12
-void IncrementalEncoder_conf(TIM_TypeDef * timer);
12
+void IncrementalEncoder_conf(TIM_TypeDef * timer, GPIO_TypeDef * gpio, int pin);
13 13
 
14 14
 /**
15 15
 	* @brief  Démarre le codeur incrémental associé au timer donné

Loading…
Cancel
Save