diff --git a/main.c b/main.c index 1e5048a..90e9ec7 100644 --- a/main.c +++ b/main.c @@ -23,6 +23,15 @@ void UART1_WRITE(char data) while (UART1_FR_R & 0x20); // Wait until TX FIFO is not full UART1_DR_R = data; // Write data to UART data register } + +char UART1_READ(void) +{ + while (UART1_FR_R & 0x10); // Wait until RX FIFO is not empty + return (char)UART1_DR_R; // Return received data +} + + + void GPIOF_interruptHandler(void) // Interrupt handler for GPIO Port F { //delay(200000); // Debounce delay