Exemplo n.º 1
0
//SPL_STATIC_FUNC
void serial_putc(const char c)
{
    if (c == '\n')
    {
        while ((readl(P_UART_STATUS(UART_PORT_CONS)) & UART_STAT_MASK_TFIFO_FULL));
        writel('\r', P_UART_WFIFO(UART_PORT_CONS));
    }
    /* Wait till dataTx register is not full */
    while ((readl(P_UART_STATUS(UART_PORT_CONS)) & UART_STAT_MASK_TFIFO_FULL));
    writel(c, P_UART_WFIFO(UART_PORT_CONS));
    /* Wait till dataTx register is empty */
}
Exemplo n.º 2
0
/*
 * Output a single byte to the serial port.
 */
void serial_putc_port (int port,const char c)
{
	unsigned port_base = port_base_addrs[port];
    if (c == '\n') 
        serial_putc_port(port,'\r');
    
    /* Wait till dataTx register is not full */
    while ((readl(P_UART_STATUS(port_base)) & UART_STAT_MASK_TFIFO_FULL));
 // while(!(readl(P_UART_STATUS(port_base)) & UART_STAT_MASK_TFIFO_EMPTY));  
    writel(c, P_UART_WFIFO(port_base));
    /* Wait till dataTx register is empty */
    while(!(readl(P_UART_STATUS(port_base)) & UART_STAT_MASK_TFIFO_EMPTY));

}