diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-07-20 18:32:16 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2012-07-20 18:32:16 +0000 |
commit | ec9c693a8fbabde333c2a022c12476a12ca5f9b8 (patch) | |
tree | 2482d9d86be5c9caab9e456430706c269688baaf /nuttx/arch/arm/src/lpc43xx/lpc43_config.h | |
parent | aaab49d3299b2f2ebbbbb35bcfc5a027da8ed4a6 (diff) | |
download | px4-nuttx-ec9c693a8fbabde333c2a022c12476a12ca5f9b8.tar.gz px4-nuttx-ec9c693a8fbabde333c2a022c12476a12ca5f9b8.tar.bz2 px4-nuttx-ec9c693a8fbabde333c2a022c12476a12ca5f9b8.zip |
Add completed but untested support for RS-485 on the LPC43xx
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4959 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/arm/src/lpc43xx/lpc43_config.h')
-rw-r--r-- | nuttx/arch/arm/src/lpc43xx/lpc43_config.h | 41 |
1 files changed, 36 insertions, 5 deletions
diff --git a/nuttx/arch/arm/src/lpc43xx/lpc43_config.h b/nuttx/arch/arm/src/lpc43xx/lpc43_config.h index c969553cb..fb5773682 100644 --- a/nuttx/arch/arm/src/lpc43xx/lpc43_config.h +++ b/nuttx/arch/arm/src/lpc43xx/lpc43_config.h @@ -66,26 +66,49 @@ # define HAVE_UART 1 #endif +/* Make sure all features are disabled for diabled U[S]ARTs. This simplifies + * checking later. + */ + +#ifndef CONFIG_LPC43_USART0 +# undef CONFIG_USART0_SERIAL_CONSOLE +# undef CONFIG_USART0_RS485MODE +#endif + +#ifndef CONFIG_LPC43_UART1 +# undef CONFIG_UART1_SERIAL_CONSOLE +#endif + +#ifndef CONFIG_LPC43_USART2 +# undef CONFIG_USART2_SERIAL_CONSOLE +# undef CONFIG_USART2_RS485MODE +#endif + +#ifndef CONFIG_LPC43_USART3 +# undef CONFIG_USART3_SERIAL_CONSOLE +# undef CONFIG_USART3_RS485MODE +#endif + /* Is there a serial console? There should be at most one defined. It could be on - * any UARTn, n=0,1,2,3 + * any UARTn, n=0,1,2,3 - OR - there might not be any serial console at all. */ -#if defined(CONFIG_USART0_SERIAL_CONSOLE) && defined(CONFIG_LPC43_USART0) +#if defined(CONFIG_USART0_SERIAL_CONSOLE) # undef CONFIG_UART1_SERIAL_CONSOLE # undef CONFIG_USART2_SERIAL_CONSOLE # undef CONFIG_USART3_SERIAL_CONSOLE # define HAVE_CONSOLE 1 -#elif defined(CONFIG_UART1_SERIAL_CONSOLE) && defined(CONFIG_LPC43_UART1) +#elif defined(CONFIG_UART1_SERIAL_CONSOLE) # undef CONFIG_USART0_SERIAL_CONSOLE # undef CONFIG_USART2_SERIAL_CONSOLE # undef CONFIG_USART3_SERIAL_CONSOLE # define HAVE_CONSOLE 1 -#elif defined(CONFIG_USART2_SERIAL_CONSOLE) && defined(CONFIG_LPC43_USART2) +#elif defined(CONFIG_USART2_SERIAL_CONSOLE) # undef CONFIG_USART0_SERIAL_CONSOLE # undef CONFIG_UART1_SERIAL_CONSOLE # undef CONFIG_USART3_SERIAL_CONSOLE # define HAVE_CONSOLE 1 -#elif defined(CONFIG_USART3_SERIAL_CONSOLE) && defined(CONFIG_LPC43_USART3) +#elif defined(CONFIG_USART3_SERIAL_CONSOLE) # undef CONFIG_USART0_SERIAL_CONSOLE # undef CONFIG_UART1_SERIAL_CONSOLE # undef CONFIG_USART2_SERIAL_CONSOLE @@ -107,6 +130,14 @@ # undef CONFIG_UART1_FLOWCONTROL #endif +/* Check for RS-485 support (USART0,2,3 only) */ + +#undef HAVE_RS485 +#if defined(CONFIG_USART0_RS485MODE) || defined(CONFIG_USART2_RS485MODE) || \ + defined(CONFIG_USART3_RS485MODE) +# define HAVE_RS485 1 +#endif + /************************************************************************************ * Public Types ************************************************************************************/ |