diff --git a/configs/olimex-lpc1766stk/README.txt b/configs/olimex-lpc1766stk/README.txt index 9edbfc513b..4a00f0e36a 100755 --- a/configs/olimex-lpc1766stk/README.txt +++ b/configs/olimex-lpc1766stk/README.txt @@ -879,6 +879,20 @@ Where is one of the following: +CONFIG_GPIO_IRQ=y +CONFIG_ARCH_IRQBUTTONS=y + 4. This example supports the CAN loopback test (apps/examples/can) but this + must be manually enabled by selecting: + + CONFIG_CAN=y : Enable the generic CAN infrastructure + CONFIG_LPC17_CAN1=y : Enable CAN1 + CONFIG_CAN_LOOPBACK=y : Enable CAN loopback mode + + See also apps/examples/README.txt + + Special CAN-only debug options: + + CONFIG_DEBUG_CAN + CONFIG_CAN_REGDEBUG + nx: An example using the NuttX graphics system (NX). This example uses the Nokia 6100 LCD driver. NOTE: The Nokia 6100 driver does not diff --git a/configs/olimex-lpc1766stk/nsh/appconfig b/configs/olimex-lpc1766stk/nsh/appconfig index a2f7f9f262..e9af6d3b20 100644 --- a/configs/olimex-lpc1766stk/nsh/appconfig +++ b/configs/olimex-lpc1766stk/nsh/appconfig @@ -55,3 +55,8 @@ ifeq ($(CONFIG_ARCH_BUTTONS),y) CONFIGURED_APPS += examples/buttons endif +ifeq ($(CONFIG_CAN),y) +CONFIGURED_APPS += examples/can +endif + + diff --git a/configs/olimex-lpc1766stk/nsh/defconfig b/configs/olimex-lpc1766stk/nsh/defconfig index 404e7c7f3c..fb163ef410 100755 --- a/configs/olimex-lpc1766stk/nsh/defconfig +++ b/configs/olimex-lpc1766stk/nsh/defconfig @@ -337,6 +337,8 @@ CONFIG_DEBUG_VERBOSE=n CONFIG_DEBUG_SYMBOLS=n CONFIG_DEBUG_NET=n CONFIG_DEBUG_USB=n +CONFIG_DEBUG_GPIO=n +CONFIG_DEBUG_CAN=n CONFIG_MM_REGIONS=2 CONFIG_ARCH_LOWPUTC=y CONFIG_RR_INTERVAL=200 @@ -624,6 +626,28 @@ CONFIG_NET_BROADCAST=n CONFIG_NET_DHCP_LIGHT=n CONFIG_NET_RESOLV_ENTRIES=4 +# +# CAN device driver settings +# +# CONFIG_CAN - Enables CAN support (one or both of CONFIG_LPC17_CAN1 or +# CONFIG_LPC17_CAN2 must also be defined) +# CONFIG_CAN_FIFOSIZE - The size of the circular buffer of CAN messages. +# Default: 8 +# CONFIG_CAN_NPENDINGRTR - The size of the list of pending RTR requests. +# Default: 4 +# CONFIG_CAN_LOOPBACK - A CAN driver may or may not support a loopback +# mode for testing. The STM32 CAN driver does support loopback mode. +# CONFIG_CAN1_BAUD - CAN1 BAUD rate. Required if CONFIG_LPC17_CAN1 is defined. +# CONFIG_CAN2_BAUD - CAN1 BAUD rate. Required if CONFIG_LPC17_CAN2 is defined. +# +CONFIG_CAN=n +#CONFIG_CAN_FIFOSIZE +#CONFIG_CAN_NPENDINGRTR +CONFIG_CAN_LOOPBACK=n +CONFIG_CAN_REGDEBUG=n +CONFIG_CAN1_BAUD=700000 +CONFIG_CAN2_BAUD=700000 + # # USB Device Configuration # diff --git a/configs/olimex-lpc1766stk/src/Makefile b/configs/olimex-lpc1766stk/src/Makefile index f006461bc3..a2bdab303b 100755 --- a/configs/olimex-lpc1766stk/src/Makefile +++ b/configs/olimex-lpc1766stk/src/Makefile @@ -1,7 +1,7 @@ ############################################################################ # configs/olimex-lpc1766stk/src/Makefile # -# Copyright (C) 2010 Gregory Nutt. All rights reserved. +# Copyright (C) 2010, 2012 Gregory Nutt. All rights reserved. # Author: Gregory Nutt # # Redistribution and use in source and binary forms, with or without @@ -56,6 +56,10 @@ ifeq ($(CONFIG_ARCH_BUTTONS),y) CSRCS += up_buttons.c endif +ifeq ($(CONFIG_CAN),y) +CSRCS += up_can.c +endif + AOBJS = $(ASRCS:.S=$(OBJEXT)) COBJS = $(CSRCS:.c=$(OBJEXT)) diff --git a/configs/stm3240g-eval/src/up_can.c b/configs/stm3240g-eval/src/up_can.c index eafcec0bf5..713a5325a2 100644 --- a/configs/stm3240g-eval/src/up_can.c +++ b/configs/stm3240g-eval/src/up_can.c @@ -139,4 +139,4 @@ int can_devinit(void) return OK; } -#endif /* CONFIG_STM32_CAN || CONFIG_STM32_CAN2 || CONFIG_STM32_CAN3 */ +#endif /* CONFIG_CAN && (CONFIG_STM32_CAN2 || CONFIG_STM32_CAN3) */