AnsweredAssumed Answered

STM32CubeMX GPIO Defined initial level after initialization

Question asked by mennekes.rolf on Aug 11, 2014
Latest reply on Aug 29, 2014 by STM32Cube-T
To avoid glitches at the output, we initialize in the following order:
1. GPIOx clock enable
2. Set output registers to defined value
3. Perform initialization
Now we would like to use STM32CubeMX.
Is it possible when initializing the GPIO to initialize the output level?

Example of implementation:
InitGPIO.PNG

In source:
  /*Configure GPIO pins : PE2 PE3 PE4 PE5
                           PE6 PE8 PE9 PE10
                           PE11 PE12 PE14 PE15
                           PE0 PE1 */
  HAL_GPIO_WritePin(GPIOE,GPIO_PIN_2|GPIO_PIN_3|GPIO_PIN_4|GPIO_PIN_5
                          |GPIO_PIN_6|GPIO_PIN_8,GPIO_PIN_RESET);
  HAL_GPIO_WritePin(GPIOE,GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10
                          |GPIO_PIN_11|GPIO_PIN_12|GPIO_PIN_14|GPIO_PIN_15
                          |GPIO_PIN_0|GPIO_PIN_1,GPIO_PIN_SET);
  GPIO_InitStruct.Pin = GPIO_PIN_2|GPIO_PIN_3|GPIO_PIN_4|GPIO_PIN_5
                          |GPIO_PIN_6|GPIO_PIN_8|GPIO_PIN_9|GPIO_PIN_10
                          |GPIO_PIN_11|GPIO_PIN_12|GPIO_PIN_14|GPIO_PIN_15
                          |GPIO_PIN_0|GPIO_PIN_1;
  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
  GPIO_InitStruct.Pull = GPIO_NOPULL;
  GPIO_InitStruct.Speed = GPIO_SPEED_LOW;
  HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);

Outcomes