Add apps/poweroff lpc17 hardware handshake

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3380 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2011-03-14 20:50:46 +00:00
parent 81c39b334f
commit e58d1dcbde
2 changed files with 23 additions and 2 deletions

View File

@ -664,13 +664,15 @@ static inline void lpc17_uart1config(uint32_t clkdiv)
lpc17_configgpio(GPIO_UART1_TXD);
lpc17_configgpio(GPIO_UART1_RXD);
#ifdef CONFIG_UART0_FLOWCONTROL
#ifdef CONFIG_UART1_FLOWCONTROL
lpc17_configgpio(GPIO_UART1_CTS);
lpc17_configgpio(GPIO_UART1_RTS);
lpc17_configgpio(GPIO_UART1_DCD);
lpc17_configgpio(GPIO_UART1_DSR);
lpc17_configgpio(GPIO_UART1_DTR);
#ifdef CONFIG_UART1_RINGINDICATOR
lpc17_configgpio(GPIO_UART1_RI);
lpc17_configgpio(GPIO_UART1_RTS);
#endif
#endif
irqrestore(flags);
};
@ -849,6 +851,16 @@ static int up_setup(struct uart_dev_s *dev)
up_serialout(priv, LPC17_UART_FCR_OFFSET,
(UART_FCR_RXTRIGGER_8|UART_FCR_TXRST|UART_FCR_RXRST|UART_FCR_FIFOEN));
/* Enable Auto-RTS and Auto-CS Flow Control in the Modem Control Register */
#ifdef CONFIG_UART1_FLOWCONTROL
if (priv->uartbase == LPC17_UART1_BASE)
{
up_serialout(priv, LPC17_UART_MCR_OFFSET, (UART_MCR_RTSEN|UART_MCR_CTSEN));
}
#endif
#endif
return OK;
}

View File

@ -92,6 +92,15 @@
# undef HAVE_CONSOLE
#endif
/* Check UART flow control (Only supported by UART1) */
# undef CONFIG_UART0_FLOWCONTROL
# undef CONFIG_UART2_FLOWCONTROL
# undef CONFIG_UART3_FLOWCONTROL
#ifndef CONFIG_LPC17_UART1
# undef CONFIG_UART1_FLOWCONTROL
#endif
/* We cannot allow the DLM/DLL divisor to become to small or will will lose too
* much accuracy. This following is a "fudge factor" that represents the minimum
* value of the divisor that we will permit.