9 /* To use the UARTs, the peripheral clock must be enabled by setting the UART0, UART1, or UART2
10 bits in the RCGC1 register. (section 12.4: Initialization and Configuration */
12 *SYSCTRL_RCGC1 = *SYSCTRL_RCGC1 | 0x0003;
16 1. Disable the UART by clearing the UARTEN bit in the UARTCTL register.
17 2. Write the integer portion of the BRD to the UARTIBRD register.
18 3. Write the fractional portion of the BRD to the UARTFBRD register.
19 4. Write the desired serial parameters to the UARTLCRH register
20 5. Enable the UART by setting the UARTEN bit in the UARTCTL register.
23 /* TODO: bitrate: How fast is CPU running?*/
40 extern void uart_putc(unsigned char ch) {
43 while ((*UART0_FLAG & 0x8)); // busy bit
44 *UART0_DATA = 0x0D; // return line
47 while ((*UART0_FLAG & 0x8)); // busy bit
51 extern void uart_puts(unsigned char *str)
56 for (i = 0; i < strlen(str); i++)