summaryrefslogtreecommitdiffstats
path: root/nuttx/arch/arm/src
diff options
context:
space:
mode:
authorpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2011-03-14 20:50:46 +0000
committerpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2011-03-14 20:50:46 +0000
commit8c49dc8219a9d3c3477f58528383e518e355cfdf (patch)
tree6ddb2ebc5c6cc9b94cc88baa085901046a345861 /nuttx/arch/arm/src
parent7fd981d1e3ce894baafac8b0326c1b9ec18eba9b (diff)
Add apps/poweroff lpc17 hardware handshake
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@3380 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx/arch/arm/src')
-rwxr-xr-xnuttx/arch/arm/src/lpc17xx/lpc17_serial.c16
-rwxr-xr-xnuttx/arch/arm/src/lpc17xx/lpc17_serial.h9
2 files changed, 23 insertions, 2 deletions
diff --git a/nuttx/arch/arm/src/lpc17xx/lpc17_serial.c b/nuttx/arch/arm/src/lpc17xx/lpc17_serial.c
index d58ce7c037..63687038f1 100755
--- a/nuttx/arch/arm/src/lpc17xx/lpc17_serial.c
+++ b/nuttx/arch/arm/src/lpc17xx/lpc17_serial.c
@@ -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;
}
diff --git a/nuttx/arch/arm/src/lpc17xx/lpc17_serial.h b/nuttx/arch/arm/src/lpc17xx/lpc17_serial.h
index 3446c4997b..9fca96219d 100755
--- a/nuttx/arch/arm/src/lpc17xx/lpc17_serial.h
+++ b/nuttx/arch/arm/src/lpc17xx/lpc17_serial.h
@@ -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.