GPIO Pin Assignment
I am trying to understand how to configure a custom GPIO pin via the CubeMX/CubeIDE. I am using the STM32H7B3I-EVAL. Through the CubeMX, I am trying to assign PA13 to a GPIO (in output mode). I enabled PA13 via the CubeMX without issue.
Now I want to configure the GPIO in the CubeIDE and use it. In the GPIO Example for my STM32H7B3I-EVAl board, they configure it as follows:
/* Configure IO in output push-pull mode to drive external LEDs */
gpio_init_structure.Mode = GPIO_MODE_OUTPUT_PP;
gpio_init_structure.Pull = GPIO_PULLUP;
gpio_init_structure.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
gpio_init_structure.Pin = GPIO_PIN_13;
HAL_GPIO_Init(GPIOG, &gpio_init_structure);What I don't understand is how they knew that gpio_init_structure.Pin = GPIO_PIN_13.
How did the example know to use PIN_13? How do I know which pin PA15 should be?
