Update main.c

Add UART write function
This commit is contained in:
Uttam Bhavimani Bhavimani 2024-10-10 19:33:05 +05:30
parent 9a0ce204b3
commit cd828e7048
1 changed files with 6 additions and 0 deletions

6
main.c
View File

@ -17,3 +17,9 @@ void GPIO_PORT_F_init(void)
GPIO_PORTF_IEV_R = 0x00; // Falling edge event
GPIO_PORTF_IM_R |= 0x11; // Unmask interrupts for PF0 and PF4
}
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
}