|
@@ -1,2 +1,18 @@
|
1
|
1
|
#include "GPIO.h"
|
|
2
|
+#include "stm32f1xx_ll_gpio.h"
|
2
|
3
|
|
|
4
|
+void GPIO_conf(GPIO_TypeDef * GPIOx, uint32_t PINx, uint32_t mode, uint32_t outputType, uint32_t pullMode){
|
|
5
|
+
|
|
6
|
+ LL_GPIO_InitTypeDef init;
|
|
7
|
+
|
|
8
|
+ //Activation de l'horloge
|
|
9
|
+ if (GPIOx == GPIOA) LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOA);
|
|
10
|
+ else if (GPIOx == GPIOB) LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOB);
|
|
11
|
+ else if (GPIOx == GPIOC) LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOC);
|
|
12
|
+ else if (GPIOx == GPIOD) LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOD);
|
|
13
|
+
|
|
14
|
+ //Configuration de la PIN
|
|
15
|
+ LL_GPIO_StructInit(&init);
|
|
16
|
+ init.Pin = PINx;
|
|
17
|
+
|
|
18
|
+}
|