mirror of
https://github.com/apache/nuttx.git
synced 2026-05-22 05:42:05 +08:00
Changes from review of last PR
This commit is contained in:
@@ -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---
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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 <gnutt@nuttx.org>
|
||||
*
|
||||
* 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 <nuttx/config.h>
|
||||
#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 */
|
||||
|
||||
Reference in New Issue
Block a user