Solved
PA0_C GPIO PIN
I have stm32h745i-disco for my project and use PA0_C and PC_3 for output. and when i use usual HAL_GPIO_WritePin() it is not working. Should i change something to make it work? Please help
I have stm32h745i-disco for my project and use PA0_C and PC_3 for output. and when i use usual HAL_GPIO_WritePin() it is not working. Should i change something to make it work? Please help
Hello
Make sure you configured the GPIO pins, enabled GPIOA, GPIOC
Your code should look something like this :
/* Enable GPIOA and GPIOC clock */
__HAL_RCC_GPIOA_CLK_ENABLE();
__HAL_RCC_GPIOC_CLK_ENABLE();
/* Configure PA0 and PC3 as outputs */
GPIO_InitTypeDef GPIO_InitStruct = {0};
GPIO_InitStruct.Pin = GPIO_PIN_0;
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
GPIO_InitStruct.Pin = GPIO_PIN_3;
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
/* Set the output value of PA0 and PC3 */
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_0, GPIO_PIN_SET);
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_3, GPIO_PIN_RESET);
Hope that helps!
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.