mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
cpu/lpc1768: fixed UART PCLK selection
This commit is contained in:
parent
695d702b4f
commit
31a6e81bd9
@ -88,11 +88,9 @@ int uart_init_blocking(uart_t uart, uint32_t baudrate)
|
|||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* power on UART device */
|
/* power on UART device and select peripheral clock */
|
||||||
UART_0_CLKEN();
|
UART_0_CLKEN();
|
||||||
/* set peripheral clock to CCLK / 4 */
|
UART_0_CLKSEL();
|
||||||
LPC_SC->PCLKSEL1 &= (0x3 << 18);
|
|
||||||
|
|
||||||
/* set mode to 8N1 and enable access to divisor latch */
|
/* set mode to 8N1 and enable access to divisor latch */
|
||||||
UART_0_DEV->LCR = ((0x3 << 0) | (1 << 7));
|
UART_0_DEV->LCR = ((0x3 << 0) | (1 << 7));
|
||||||
/* set baud rate registers (fixed for now) */
|
/* set baud rate registers (fixed for now) */
|
||||||
@ -121,10 +119,9 @@ int uart_init_blocking(uart_t uart, uint32_t baudrate)
|
|||||||
return -2;
|
return -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* power on UART device */
|
/* power on UART device and select peripheral clock */
|
||||||
UART_1_CLKEN();
|
UART_1_CLKEN();
|
||||||
/* set peripheral clock to CCLK / 4 */
|
UART_1_CLKSEL();
|
||||||
LPC_SC->PCLKSEL1 &= (0x3 << 18);
|
|
||||||
/* set mode to 8N1 and enable access to divisor latch */
|
/* set mode to 8N1 and enable access to divisor latch */
|
||||||
UART_1_DEV->LCR = ((0x3 << 0) | (1 << 7));
|
UART_1_DEV->LCR = ((0x3 << 0) | (1 << 7));
|
||||||
/* set baud rate registers (fixed for now) */
|
/* set baud rate registers (fixed for now) */
|
||||||
|
Loading…
Reference in New Issue
Block a user