mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-10 21:55:10 -05:00
M:Robe 500: Initialize UART1 pins with pin setup function
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23988 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
537832d3c6
commit
86dd88c86e
1 changed files with 9 additions and 5 deletions
|
|
@ -38,15 +38,20 @@ static volatile int uart1_receive_count, uart1_receive_read, uart1_receive_write
|
||||||
|
|
||||||
void uart_init(void)
|
void uart_init(void)
|
||||||
{
|
{
|
||||||
|
/* Setup UART 1 pins:
|
||||||
|
* 27 - input, uart1 rx
|
||||||
|
* 28 - output, uart1 tx */
|
||||||
|
/* 27: input , non-inverted, no-irq, falling edge, no-chat, UART RX */
|
||||||
|
dm320_set_io(27, true, false, false, false, false, 0x01);
|
||||||
|
|
||||||
|
/* 28: output, non-inverted, no-irq, falling edge, no-chat, UART TX */
|
||||||
|
dm320_set_io(28, false, false, false, false, false, 0x01);
|
||||||
|
|
||||||
// 8-N-1
|
// 8-N-1
|
||||||
IO_UART1_MSR = 0xC400;
|
IO_UART1_MSR = 0xC400;
|
||||||
IO_UART1_BRSR = 0x0057;
|
IO_UART1_BRSR = 0x0057;
|
||||||
IO_UART1_RFCR = 0x8020; /* Trigger later */
|
IO_UART1_RFCR = 0x8020; /* Trigger later */
|
||||||
IO_UART1_TFCR = 0x0000; /* Trigger level */
|
IO_UART1_TFCR = 0x0000; /* Trigger level */
|
||||||
/* gio 27 is input, uart1 rx
|
|
||||||
gio 28 is output, uart1 tx */
|
|
||||||
IO_GIO_DIR1 |= (1<<11); /* gio 27 */
|
|
||||||
IO_GIO_DIR1 &= ~(1<<12); /* gio 28 */
|
|
||||||
|
|
||||||
/* init the receive buffer */
|
/* init the receive buffer */
|
||||||
uart1_receive_count=0;
|
uart1_receive_count=0;
|
||||||
|
|
@ -62,7 +67,6 @@ void uart_init(void)
|
||||||
IO_INTC_EINT0 |= INTR_EINT0_UART1;
|
IO_INTC_EINT0 |= INTR_EINT0_UART1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* This function is not interrupt driven */
|
/* This function is not interrupt driven */
|
||||||
void uart1_putc(char ch)
|
void uart1_putc(char ch)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue