Add UART Read function
This commit is contained in:
parent
6cabffb9d2
commit
1050494f56
9
main.c
9
main.c
|
@ -23,6 +23,15 @@ void UART1_WRITE(char data)
|
||||||
while (UART1_FR_R & 0x20); // Wait until TX FIFO is not full
|
while (UART1_FR_R & 0x20); // Wait until TX FIFO is not full
|
||||||
UART1_DR_R = data; // Write data to UART data register
|
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
|
void GPIOF_interruptHandler(void) // Interrupt handler for GPIO Port F
|
||||||
{
|
{
|
||||||
//delay(200000); // Debounce delay
|
//delay(200000); // Debounce delay
|
||||||
|
|
Loading…
Reference in New Issue