diff --git a/main.c b/main.c index 6259aae..90f635a 100644 --- a/main.c +++ b/main.c @@ -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 +}