Code for UART 7 write
This commit is contained in:
parent
f7bff77f4e
commit
3ab1c54fad
15
main.c
15
main.c
|
@ -50,9 +50,20 @@ void UART7_init(void)
|
|||
|
||||
}
|
||||
|
||||
char UART0_Read(void) {
|
||||
char UART0_Read(void)
|
||||
{
|
||||
|
||||
while((UART0_FR_R & 0x10) != 0); // Wait until RXFE is 0 (receive FIFO not empty)
|
||||
return UART0_DR_R & 0xFF; // Read the received character
|
||||
|
||||
}
|
||||
|
||||
void UART0_Write(char data)
|
||||
{
|
||||
|
||||
while((UART0_FR_R & 0x20) != 0); // Wait until TXFF is 0 (transmit FIFO not full)
|
||||
UART0_DR_R = data; // Transmit the data
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -62,5 +73,3 @@ char UART0_Read(void) {
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue