int tx_rdy(void) { if (uart_tx_ready (DEBUG_UART_PORT)) return 1; else return 0; }
void uart_write_str(char *str) { while (*str != '\0') { while (!uart_tx_ready()); uart_write_char(*str); str++; } }
void uart_write_char(char c) { /* Wait for space in transmit FIFO. */ while (!uart_tx_ready()) ; GR_UART_WDATA(0) = c; }
static int panic_txchar(void *context, int c) { if (c == '\n') panic_txchar(context, '\r'); /* Wait for space in transmit FIFO */ while (!uart_tx_ready()) ; /* Write the character directly to the transmit FIFO */ uart_write_char(c); return 0; }
bool uart_send_byte (unsigned dev, char ch) { /* wait for transmit buffer empty */ while (!uart_tx_ready(dev)) ; switch (dev) { case 0: UTXH0 = ch; break; case 1: UTXH1 = ch; break; case 2: UTXH2 = ch; break; } return true; }
void uart_transmit_data(unsigned char data) { while(!uart_tx_ready()); UCA0TXBUF = data; }