I was going through ST Microelectronics code and found the following code
/*Configure GPIO pin Output Level */
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_1, GPIO_PIN_RESET);
/*Configure GPIO pin : PA1 */
GPIO_InitStruct.Pin = GPIO_PIN_1;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
The pin 1 of port A is set to low before initializing the pin.
I was wondering if this method is allowed? Not specific to ST Microelectronics but any vendor offering similar solutions.
If method isn't allowed what will be the state of the GPIO pin?
I went through these questions but they don't answer my query this and this.