summaryrefslogtreecommitdiff
path: root/nuttx/arch/arm/src/lpc17xx
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-03-14 20:50:46 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2011-03-14 20:50:46 +0000
commit0e24b0de612ad596103e4e01d250f0be12278783 (patch)
tree6ddb2ebc5c6cc9b94cc88baa085901046a345861 /nuttx/arch/arm/src/lpc17xx
parent9264b754565c550afad96d4ef5ad1a76e6e8c233 (diff)
downloadpx4-nuttx-0e24b0de612ad596103e4e01d250f0be12278783.tar.gz
px4-nuttx-0e24b0de612ad596103e4e01d250f0be12278783.tar.bz2
px4-nuttx-0e24b0de612ad596103e4e01d250f0be12278783.zip
Add apps/poweroff lpc17 hardware handshake
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3380 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/arm/src/lpc17xx')
-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 d58ce7c03..63687038f 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 3446c4997..9fca96219 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.