STM32 HAL_GPIO Configuration

  • HAL_GPIO_Init (GPIO_TypeDef * GPIOx, GPIO_InitTypeDef * GPIO_Init)

Definition of the structure variable

GPIO_InitTypeDef GPIO_InitStructure;

Enable clock

__HAL_RCC_GPIOA_CLK_ENABLE()
__HAL_RCC_GPIOB_CLK_ENABLE();
GPIO_InitStructure.Mode = GPIO_MODE_AF_PP;
GPIO_InitStructure.Pull = GPIO_PULLUP;
GPIO_InitStructure.Speed = GPIO_SPEED_FREQ_HIGH;
Published 37 original articles · won praise 16 · views 20000 +

Guess you like

Origin blog.csdn.net/ben_xiao_hai_123/article/details/105186157