projet_voilier/MyDrivers/GPIO.c

18 lines
No EOL
605 B
C

#include "GPIO.h"
#include "stm32f1xx_ll_gpio.h"
void GPIO_conf(GPIO_TypeDef * GPIOx, uint32_t PINx, uint32_t mode, uint32_t outputType, uint32_t pullMode){
LL_GPIO_InitTypeDef init;
//Activation de l'horloge
if (GPIOx == GPIOA) LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOA);
else if (GPIOx == GPIOB) LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOB);
else if (GPIOx == GPIOC) LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOC);
else if (GPIOx == GPIOD) LL_APB2_GRP1_EnableClock(LL_APB2_GRP1_PERIPH_GPIOD);
//Configuration de la PIN
LL_GPIO_StructInit(&init);
init.Pin = PINx;
}