Example #1
0
unsigned char
serial_getc(void)
{
	if (initial == 0) {
		serial_init();
		initial = 1;
	}
	while((UART16550_READ(UART_LSR) & 0x1) == 0);
	return UART16550_READ(UART_RX);
}
Example #2
0
uint8 getDebugChar(void)
{
	if (!remoteDebugInitialized) {
		remoteDebugInitialized = 1;
		debugInit(UART16550_BAUD_115200,
			  UART16550_DATA_8BIT,
			  UART16550_PARITY_NONE, UART16550_STOP_1BIT);
	}

	while ((UART16550_READ(OFS_LINE_STATUS) & 0x1) == 0);
	return UART16550_READ(OFS_RCV_BUFFER);
}
Example #3
0
uint8 getDebugChar(void)
{
	if (!remoteDebugInitialized) {
		remoteDebugInitialized = 1;
		debugInit(UART16550_BAUD_115200,
			  UART16550_DATA_8BIT,
			  UART16550_PARITY_NONE,
			  UART16550_STOP_1BIT);
	}

	while((UART16550_READ(UART_LSR) & 0x1) == 0);
	return UART16550_READ(UART_RX);
}
Example #4
0
void
serial_putc(unsigned char c)
{
	if (initial == 0) {
		serial_init();
		initial = 1;
	}
	while ((UART16550_READ(UART_LSR)&0x40) == 0);
	UART16550_WRITE(UART_TX, c);
	return ;
}
Example #5
0
int putDebugChar(uint8 byte)
{
	if (!remoteDebugInitialized) {
		remoteDebugInitialized = 1;
		debugInit(UART16550_BAUD_115200,
			  UART16550_DATA_8BIT,
			  UART16550_PARITY_NONE, UART16550_STOP_1BIT);
	}

	while ((UART16550_READ(OFS_LINE_STATUS) & 0x20) == 0);
	UART16550_WRITE(OFS_SEND_BUFFER, byte);
	return 1;
}
Example #6
0
File: dbg_io.c Project: 274914765/C
int putDebugChar(u8 byte)
{
    if (!remoteDebugInitialized) {
        remoteDebugInitialized = 1;
        debugInit(UART16550_BAUD_115200,
                  UART16550_DATA_8BIT,
                  UART16550_PARITY_NONE,
                  UART16550_STOP_1BIT);
    }

    while ((UART16550_READ(UART_LSR) & 0x40) == 0);
    UART16550_WRITE(UART_TX, byte);

    return 1;
}
Example #7
0
File: dbg_io.c Project: 274914765/C
void debugInit(u32 baud, u8 data, u8 parity, u8 stop)
{
    if (UART16550_READ(UART_MOD_CNTRL) != 0x3)
        UART16550_WRITE(UART_MOD_CNTRL, 3);
    calc_clock();

    /* disable interrupts */
    UART16550_WRITE(UART_IER, 0);

    /* set up baud rate */
    {
        u32 divisor;

        /* set divisor */
        divisor = get_au1x00_uart_baud_base() / baud;
        UART16550_WRITE(UART_CLK, divisor & 0xffff);
    }

    /* set data format */
    UART16550_WRITE(UART_LCR, (data | parity | stop));
}
Example #8
0
static inline uint8 readDebugChar(int line)
{
	return UART16550_READ(line,OFS_RCV_BUFFER);
}
Example #9
0
File: serial.c Project: kisom/pmon
static uint8 testDebugChar(int line)
{

	return (UART16550_READ(line,OFS_LINE_STATUS) & 0x1) ;
}
Example #10
0
int
serial_tstc(volatile struct NS16550 *com_port)
{
        return((UART16550_READ(UART_LSR) & LSR_DR) != 0);
}
Example #11
0
unsigned char
serial_getc(volatile struct NS16550 *com_port)
{
        while((UART16550_READ(UART_LSR) & 0x1) == 0);
        return UART16550_READ(UART_RX);
}
Example #12
0
void
serial_putc(volatile struct NS16550 *com_port, unsigned char c)
{
        while ((UART16550_READ(UART_LSR)&0x40) == 0);
        UART16550_WRITE(UART_TX, c);
}
Example #13
0
/* platform serial_putc */
static void _ath_serial_putc(char byte)
{
	if (byte == '\n') _ath_serial_putc ('\r');
	while (((UART16550_READ(OFS_LINE_STATUS)) & 0x20) == 0x0);
	UART16550_WRITE(OFS_SEND_BUFFER, byte);
}
Example #14
0
void Uart16550Put(uint8 byte)
{
    while ((UART16550_READ(OFS_LINE_STATUS) &0x20) == 0);
    UART16550_WRITE(OFS_SEND_BUFFER, byte);
}
Example #15
0
uint8 Uart16550GetPoll()
{
    while((UART16550_READ(OFS_LINE_STATUS) & 0x1) == 0);
    return UART16550_READ(OFS_RCV_BUFFER);
}
Example #16
0
static inline uint8 getDebugstate(int line)
{

	return UART16550_READ(line,OFS_LINE_STATUS) ;
}
Example #17
0
int
serial_tstc(void)
{
	return ((UART16550_READ(UART_LSR) & LSR_DR) != 0);
}
Example #18
0
File: serial.c Project: kisom/pmon
static int putDebugChar(int line,uint8 byte)
{
	while ((UART16550_READ(line,OFS_LINE_STATUS) & 0x20) == 0);
	UART16550_WRITE(line,OFS_SEND_BUFFER, byte);
	return 1;
}
Example #19
0
File: serial.c Project: kisom/pmon
static uint8 getDebugChar(int line)
{

	while ((UART16550_READ(line,OFS_LINE_STATUS) & 0x1) == 0);
	return UART16550_READ(line,OFS_RCV_BUFFER);
}