AnsweredAssumed Answered

State of GPIOs after AF pin setup, but before peripheral init?

Question asked by MWP on Sep 26, 2017
Latest reply on Sep 30, 2017 by Clive One

Greetings all,

 

Does anyone know what the state of IO pins is after they have been setup by HAL, but before the the peripheral has been started?

 

For example:


The pins are initialised as AF-PP for SPI peripheral use...

 GPIO_InitStruct.Pin = SPI_SS_Pin|SPI_CLK_Pin|SPI_MISO_Pin|SPI_MOSI_Pin;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
GPIO_InitStruct.Alternate = GPIO_AF0_SPI2;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);

 

then after some large delay...

 

HAL_SPI_Init(&hspi2) ;

 

What are the pin states going to be between the HAL GPIO init call and the HAL SPI init call?

I gather they will be push/pull, but will they be high or low?

And will other peripherals act in a similar manor?

 

Thanks in advance!

Outcomes