AnsweredAssumed Answered

STM32Cube, GPIO and GPIO_InitStruct.Alternate initialization

Question asked by Barta.Hank on Jan 23, 2015
Latest reply on Jan 23, 2015 by Amel N
I've used STMCube to generate initialization code for a project using the STM32F429I-DISCO board. In MX_GPIO_Init() I find the following code:

/*Configure GPIO pins : PD3 PD6 */
GPIO_InitStruct.Pin = GPIO_PIN_3|GPIO_PIN_6;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_LOW;
GPIO_InitStruct.Alternate = GPIO_AF14_LTDC;
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
/*Configure GPIO pin : PD5 */
GPIO_InitStruct.Pin = GPIO_PIN_5;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);

I'm curious about the lack of initialization of  GPIO_InitStruct.Alternate for PD5. I expect that there should be a default value for that or something other than GPIO_AF14_LTDC which is set when initializing PD3 and PD6. Or is the value for GPIO_AF14_LTDC a 'don't care' when initializing PD5? I looked at the header that defines GPIO_AF14_LTDC and it was not at all obvious what a default value should be if GPIO_InitStruct was not previously initialized.