How do I use a uart instance declared in main.c from another custom .c file I created for my project?
I am trying to learn the in and outs of the STM32 Nucleo. I made my own .h and .c files to control an LCD screen atteched to my nucleo. However in these files I am trying to use HAL_UART_Transmit to write to the screen. I included the HAL.h file but the uart1 instance is declared in the main.c file. Is there a way other than passing the instance to every function I'm calling to use uart1 instance?
An example of what I am trying to do is included in a code snippet below.
void Clear_Screen()
{
HAL_UART_Transmit(&huart1, clear_screen, sizeof(clear_screen), Timeout);
}I get the error: "'huart1' undeclared (first use in this function)".
Thank you