1
0
UAHCode/CPE435/Lab12/test.c

14 lines
397 B
C
Raw Permalink Normal View History

2022-08-28 21:12:16 +00:00
volatile unsigned int * const UART0DR = (unsigned int *)0x101f1000;
// UART0 is the terminal running at 0x101f1000
// UART0DR is the register used to transmit and receive bytes
void print_uart0(const char *s) {
while(*s != '\0') { /* Loop until end of string */
*UART0DR = (unsigned int)(*s); /* Transmit char */
s++; /* Next char */
}
}
void c_entry() {
print_uart0("Hello world!\n");
}