Search code examples
stm32gpiohal

what's the defualt value of GPIO_InitTypeDef


enter image description here enter image description here I have checked stm32f4xx_hal_gpio.c or .h, but I can't find out by Alternate is 0 defualtly

Alternate is not 0 defualtly


Solution

  • Armandas has explained what the value will be if you do not assign to it.

    The legal values that can be assigned to the member Alternate are listed under GPIO_Alternate_function_selection in the file stm32f4xx_hal_gpio_ex.h, for example GPIO_AF9_TIM12.

    If you are not using alternate function mode, leave the value undefined or set it to zero.