Add UART1 read function to get GNSS data

This commit is contained in:
Sanyog Nevase Nevase 2024-11-07 13:19:16 +05:30
parent e52ff2bad3
commit e5b64e746e
1 changed files with 6 additions and 0 deletions

6
main.c
View File

@ -39,3 +39,9 @@ void GPIO_PORT_B_init(void)
UART1_CTL_R |= 0x301; // Enable UART1, RX, and TX
}
char UART1_READ(void)
{
while (UART1_FR_R & 0x10); // Wait until RX FIFO is not empty
return (char)UART1_DR_R; // Return received data
}