OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [newlib-1.18.0/] [libgloss/] [or32/] [uart.c] - Diff between revs 527 and 557

Show entire file | Details | Blame | View Log

Rev 527 Rev 557
Line 83... Line 83...
 
 
        /* Set 8 bit char, 1 stop bit, no parity */
        /* Set 8 bit char, 1 stop bit, no parity */
        UREG8 (UART_LCR) = UART_LCR_WLEN8 & ~(UART_LCR_STOP | UART_LCR_PARITY);
        UREG8 (UART_LCR) = UART_LCR_WLEN8 & ~(UART_LCR_STOP | UART_LCR_PARITY);
 
 
        /* Set baud rate */
        /* Set baud rate */
        divisor = _board_clk_freq / (16 * _board_uart_baud);
        divisor = (_board_clk_freq / _board_uart_baud + 8) / 16;
 
 
        UREG8 (UART_LCR) |= UART_LCR_DLAB;
        UREG8 (UART_LCR) |= UART_LCR_DLAB;
        UREG8 (UART_DLL)  = divisor & 0x000000ff;
        UREG8 (UART_DLL)  = divisor & 0x000000ff;
        UREG8 (UART_DLM)  = (divisor >> 8) & 0x000000ff;
        UREG8 (UART_DLM)  = (divisor >> 8) & 0x000000ff;
        UREG8 (UART_LCR) &= ~(UART_LCR_DLAB);
        UREG8 (UART_LCR) &= ~(UART_LCR_DLAB);

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.