/* * UART putchar */ void putch(char x) { while (!(*pUART0_LSR&(1 << 5))) ; *pUART0_THR = x; } void write(char *p) { while(*p) putch(*(p++)); } fejezet: 13-25 UARTx_LSR Registers The UARTx_LSR registers contain UART status information as shown in Figure 13-9. UART Line Status Registers (UARTx_LSR) 0 - Full 1 - Both empty 0 - THR not empty 1 - THR empty 0 - No break interrupt 1 - Break interrupt; this indicates RX was held low for more than the maximum word length BI (Break Interrupt) THRE (THR Empty) FE (Framing Error) 0 - No new data 1 - UARTx_RBR holds new data OE (Overrun Error) 0 - No overrun 1 - UARTx_RBR overwritten before read PE (Parity Error) 0 - No parity error 1 - Parity error 0 - No error 1 - Invalid stop bit error Reset = 0x0060 RO UART0: 0xFFC0 0414 UART1: 0xFFC0 2014