diff --git a/arch/arm/src/lpc43xx/Kconfig b/arch/arm/src/lpc43xx/Kconfig index c6df85ae351..d29fe32781f 100644 --- a/arch/arm/src/lpc43xx/Kconfig +++ b/arch/arm/src/lpc43xx/Kconfig @@ -151,7 +151,7 @@ endchoice # LPC43XX Boot Configuration menu "LPC43xx Peripheral Support" -config GPIO_IRQ +config LPC43_GPIO_IRQ bool "GPIO interrupt support" default n ---help--- diff --git a/arch/arm/src/lpc43xx/Make.defs b/arch/arm/src/lpc43xx/Make.defs index 018b929d4d4..60e0ad3ed0f 100644 --- a/arch/arm/src/lpc43xx/Make.defs +++ b/arch/arm/src/lpc43xx/Make.defs @@ -118,7 +118,7 @@ ifeq ($(CONFIG_LPC43_GPDMA),y) CHIP_CSRCS += lpc43_gpdma.c endif -ifeq ($(CONFIG_GPIO_IRQ),y) +ifeq ($(CONFIG_LPC43_GPIO_IRQ),y) CHIP_CSRCS += lpc43_gpioint.c endif diff --git a/arch/arm/src/lpc43xx/lpc43_gpio.c b/arch/arm/src/lpc43xx/lpc43_gpio.c index 49b7f9b27f2..cda1757cd37 100644 --- a/arch/arm/src/lpc43xx/lpc43_gpio.c +++ b/arch/arm/src/lpc43xx/lpc43_gpio.c @@ -49,7 +49,7 @@ #include "up_arch.h" #include "lpc43_gpio.h" -#ifdef CONFIG_GPIO_IRQ +#ifdef CONFIG_LPC43_GPIO_IRQ #include "lpc43_gpioint.h" #endif @@ -185,14 +185,14 @@ int lpc43_gpio_config(uint16_t gpiocfg) case GPIO_MODE_PININTR: /* GPIO pin interrupt */ lpc43_configinput(gpiocfg, port, pin); -#ifdef CONFIG_GPIO_IRQ +#ifdef CONFIG_LPC43_GPIO_IRQ ret = lpc43_gpioint_pinconfig(gpiocfg); #endif break; case GPIO_MODE_GRPINTR: /* GPIO group interrupt */ lpc43_configinput(gpiocfg, port, pin); -#ifdef CONFIG_GPIO_IRQ +#ifdef CONFIG_LPC43_GPIO_IRQ ret = lpc43_gpioint_grpconfig(gpiocfg); #endif break; diff --git a/arch/arm/src/lpc43xx/lpc43_gpioint.c b/arch/arm/src/lpc43xx/lpc43_gpioint.c index 029e2aec20a..39d664aabe3 100644 --- a/arch/arm/src/lpc43xx/lpc43_gpioint.c +++ b/arch/arm/src/lpc43xx/lpc43_gpioint.c @@ -71,7 +71,7 @@ #include "lpc43_gpio.h" #include "lpc43_gpioint.h" -#ifdef CONFIG_GPIO_IRQ +#ifdef CONFIG_LPC43_GPIO_IRQ /**************************************************************************** * Pre-processor Definitions @@ -226,9 +226,11 @@ int lpc43_gpioint_pinconfig(uint16_t gpiocfg) putreg32(regval, LPC43_GPIOINT_ISEL); - /* Configure the active high level or rising edge */ - - /* TODO: this works for edge sensitive, but not level sensitive, active level is only controlled in IENF */ + /* Configure the active high level or rising edge + * + * TODO: this works for edge sensitive, but not level sensitive, active + * level is only controlled in IENF. + */ regval = getreg32(LPC43_GPIOINT_IENR); if (GPIO_IS_ACTIVE_HI(gpiocfg)) @@ -342,10 +344,11 @@ int lpc43_gpioint_ack(uint8_t intnumber) { uint32_t regval; - regval = getreg32(LPC43_GPIOINT_IST); + regval = getreg32(LPC43_GPIOINT_IST); regval |= (1 << intnumber); putreg32(regval, LPC43_GPIOINT_IST); + return OK; } -#endif /* CONFIG_GPIO_IRQ */ +#endif /* CONFIG_LPC43_GPIO_IRQ */ diff --git a/arch/arm/src/lpc43xx/lpc43_gpioint.h b/arch/arm/src/lpc43xx/lpc43_gpioint.h index ec34649455b..ae479f83c67 100644 --- a/arch/arm/src/lpc43xx/lpc43_gpioint.h +++ b/arch/arm/src/lpc43xx/lpc43_gpioint.h @@ -1,7 +1,7 @@ -/************************************************************************************ +/**************************************************************************** * arch/arm/src/lpc43xx/lpc43_gpioint.h * - * Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved. + * Copyright (C) 2012, 2014, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -31,7 +31,8 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************************************/ + ****************************************************************************/ + /* GPIO pin interrupts * * From all available GPIO pins, up to eight pins can be selected in the system @@ -52,31 +53,19 @@ #ifndef __ARCH_ARM_SRC_LPC43XX_LPC43_GPIOINT_H #define __ARCH_ARM_SRC_LPC43XX_LPC43_GPIOINT_H -/************************************************************************************ +/**************************************************************************** * Included Files - ************************************************************************************/ + ****************************************************************************/ #include #include "chip.h" #include "chip/lpc43_gpio.h" -#ifdef CONFIG_GPIO_IRQ +#ifdef CONFIG_LPC43_GPIO_IRQ -/************************************************************************************ - * Pre-processor Definitions - ************************************************************************************/ - -/************************************************************************************ - * Public Types - ************************************************************************************/ - -/************************************************************************************ - * Public Data - ************************************************************************************/ - -/************************************************************************************ - * Public Functions - ************************************************************************************/ +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ /**************************************************************************** * Name: lpc43_gpioint_grpinitialize @@ -152,5 +141,5 @@ int lpc43_gpioint_grpconfig(uint16_t gpiocfg); int lpc43_gpioint_ack(uint8_t intnumber); -#endif /* CONFIG_GPIO_IRQ */ +#endif /* CONFIG_LPC43_GPIO_IRQ */ #endif /* __ARCH_ARM_SRC_LPC43XX_LPC43_GPIOINT_H */