added more code
This commit is contained in:
BIN
CPE435/Lab12/Lab12.pdf
Normal file
BIN
CPE435/Lab12/Lab12.pdf
Normal file
Binary file not shown.
14
CPE435/Lab12/test.c
Normal file
14
CPE435/Lab12/test.c
Normal file
@ -0,0 +1,14 @@
|
||||
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");
|
||||
}
|
Reference in New Issue
Block a user