mirror of
https://github.com/apache/nuttx.git
synced 2026-05-29 04:19:37 +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"
|
menu "LPC43xx Peripheral Support"
|
||||||
|
|
||||||
|
|
||||||
config GPIO_IRQ
|
config LPC43_GPIO_IRQ
|
||||||
bool "GPIO interrupt support"
|
bool "GPIO interrupt support"
|
||||||
default n
|
default n
|
||||||
---help---
|
---help---
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ ifeq ($(CONFIG_LPC43_GPDMA),y)
|
|||||||
CHIP_CSRCS += lpc43_gpdma.c
|
CHIP_CSRCS += lpc43_gpdma.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_GPIO_IRQ),y)
|
ifeq ($(CONFIG_LPC43_GPIO_IRQ),y)
|
||||||
CHIP_CSRCS += lpc43_gpioint.c
|
CHIP_CSRCS += lpc43_gpioint.c
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
#include "up_arch.h"
|
#include "up_arch.h"
|
||||||
#include "lpc43_gpio.h"
|
#include "lpc43_gpio.h"
|
||||||
|
|
||||||
#ifdef CONFIG_GPIO_IRQ
|
#ifdef CONFIG_LPC43_GPIO_IRQ
|
||||||
#include "lpc43_gpioint.h"
|
#include "lpc43_gpioint.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -185,14 +185,14 @@ int lpc43_gpio_config(uint16_t gpiocfg)
|
|||||||
|
|
||||||
case GPIO_MODE_PININTR: /* GPIO pin interrupt */
|
case GPIO_MODE_PININTR: /* GPIO pin interrupt */
|
||||||
lpc43_configinput(gpiocfg, port, pin);
|
lpc43_configinput(gpiocfg, port, pin);
|
||||||
#ifdef CONFIG_GPIO_IRQ
|
#ifdef CONFIG_LPC43_GPIO_IRQ
|
||||||
ret = lpc43_gpioint_pinconfig(gpiocfg);
|
ret = lpc43_gpioint_pinconfig(gpiocfg);
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GPIO_MODE_GRPINTR: /* GPIO group interrupt */
|
case GPIO_MODE_GRPINTR: /* GPIO group interrupt */
|
||||||
lpc43_configinput(gpiocfg, port, pin);
|
lpc43_configinput(gpiocfg, port, pin);
|
||||||
#ifdef CONFIG_GPIO_IRQ
|
#ifdef CONFIG_LPC43_GPIO_IRQ
|
||||||
ret = lpc43_gpioint_grpconfig(gpiocfg);
|
ret = lpc43_gpioint_grpconfig(gpiocfg);
|
||||||
#endif
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -71,7 +71,7 @@
|
|||||||
#include "lpc43_gpio.h"
|
#include "lpc43_gpio.h"
|
||||||
#include "lpc43_gpioint.h"
|
#include "lpc43_gpioint.h"
|
||||||
|
|
||||||
#ifdef CONFIG_GPIO_IRQ
|
#ifdef CONFIG_LPC43_GPIO_IRQ
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
@@ -226,9 +226,11 @@ int lpc43_gpioint_pinconfig(uint16_t gpiocfg)
|
|||||||
|
|
||||||
putreg32(regval, LPC43_GPIOINT_ISEL);
|
putreg32(regval, LPC43_GPIOINT_ISEL);
|
||||||
|
|
||||||
/* Configure the active high level or rising edge */
|
/* 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 */
|
* TODO: this works for edge sensitive, but not level sensitive, active
|
||||||
|
* level is only controlled in IENF.
|
||||||
|
*/
|
||||||
|
|
||||||
regval = getreg32(LPC43_GPIOINT_IENR);
|
regval = getreg32(LPC43_GPIOINT_IENR);
|
||||||
if (GPIO_IS_ACTIVE_HI(gpiocfg))
|
if (GPIO_IS_ACTIVE_HI(gpiocfg))
|
||||||
@@ -342,10 +344,11 @@ int lpc43_gpioint_ack(uint8_t intnumber)
|
|||||||
{
|
{
|
||||||
uint32_t regval;
|
uint32_t regval;
|
||||||
|
|
||||||
regval = getreg32(LPC43_GPIOINT_IST);
|
regval = getreg32(LPC43_GPIOINT_IST);
|
||||||
regval |= (1 << intnumber);
|
regval |= (1 << intnumber);
|
||||||
putreg32(regval, LPC43_GPIOINT_IST);
|
putreg32(regval, LPC43_GPIOINT_IST);
|
||||||
|
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_GPIO_IRQ */
|
#endif /* CONFIG_LPC43_GPIO_IRQ */
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* arch/arm/src/lpc43xx/lpc43_gpioint.h
|
* 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>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* 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
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* GPIO pin interrupts
|
/* GPIO pin interrupts
|
||||||
*
|
*
|
||||||
* From all available GPIO pins, up to eight pins can be selected in the system
|
* 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
|
#ifndef __ARCH_ARM_SRC_LPC43XX_LPC43_GPIOINT_H
|
||||||
#define __ARCH_ARM_SRC_LPC43XX_LPC43_GPIOINT_H
|
#define __ARCH_ARM_SRC_LPC43XX_LPC43_GPIOINT_H
|
||||||
|
|
||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
#include "chip.h"
|
#include "chip.h"
|
||||||
#include "chip/lpc43_gpio.h"
|
#include "chip/lpc43_gpio.h"
|
||||||
|
|
||||||
#ifdef CONFIG_GPIO_IRQ
|
#ifdef CONFIG_LPC43_GPIO_IRQ
|
||||||
|
|
||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Public Function Prototypes
|
||||||
************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
|
||||||
* Public Types
|
|
||||||
************************************************************************************/
|
|
||||||
|
|
||||||
/************************************************************************************
|
|
||||||
* Public Data
|
|
||||||
************************************************************************************/
|
|
||||||
|
|
||||||
/************************************************************************************
|
|
||||||
* Public Functions
|
|
||||||
************************************************************************************/
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: lpc43_gpioint_grpinitialize
|
* Name: lpc43_gpioint_grpinitialize
|
||||||
@@ -152,5 +141,5 @@ int lpc43_gpioint_grpconfig(uint16_t gpiocfg);
|
|||||||
|
|
||||||
int lpc43_gpioint_ack(uint8_t intnumber);
|
int lpc43_gpioint_ack(uint8_t intnumber);
|
||||||
|
|
||||||
#endif /* CONFIG_GPIO_IRQ */
|
#endif /* CONFIG_LPC43_GPIO_IRQ */
|
||||||
#endif /* __ARCH_ARM_SRC_LPC43XX_LPC43_GPIOINT_H */
|
#endif /* __ARCH_ARM_SRC_LPC43XX_LPC43_GPIOINT_H */
|
||||||
|
|||||||
Reference in New Issue
Block a user