URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Go to most recent revision |
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);
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.