Question
How to work with GPIO
Please advise where I'm doing wrong, I need to create variables with GPIO output with variable assignment and I don't know how to make it work correctly. 'my_gpio_port' reports as undeclared, but the declaration is without errors. Thanx
GPIO_TypeDef* my_gpio_port;
uint16_t my_gpio_pin;
if (Device_Config == Device_A)
{
my_gpio_port = GPIOA;
my_gpio_pin = GPIO_PIN_7;
}
else
{
my_gpio_port = GPIOG;
my_gpio_pin = GPIO_PIN_4;
}
HAL_GPIO_Write(my_gpio_port, my_gpio_pin, 1);
