From cd828e704869928bb5fe06863cadb35edd33bb31 Mon Sep 17 00:00:00 2001 From: Uttam Bhavimani Bhavimani Date: Thu, 10 Oct 2024 19:33:05 +0530 Subject: [PATCH] Update main.c Add UART write function --- main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main.c b/main.c index 45781cd..3447a4e 100644 --- a/main.c +++ b/main.c @@ -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 +}