Not able to configure P4_6 pin as input interrupt on mcxn947

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Not able to configure P4_6 pin as input interrupt on mcxn947

跳至解决方案
396 次查看
sstcor
Contributor II

#define CINT_GPIO GPIO4
#define CINT_PORT PORT4
#define CINT_PIN 6U
#define CINT_IRQ GPIO40_IRQn
#define CINT_IRQ_HANDLER GPIO40_IRQHandler

CLOCK_EnableClock(kCLOCK_Gpio4);
CLOCK_EnableClock(kCLOCK_Port4);
GPIO_SetPinInterruptConfig(CINT_GPIO, CINT_PIN, kGPIO_InterruptFallingEdge);
NVIC_EnableIRQ(CINT_IRQ);
gpio_pin_config_t sw1_config =
{
kGPIO_DigitalInput,
0,
};
/* Sets the input pin configuration */
GPIO_PinInit(CINT_GPIO, CINT_PIN, &sw1_config);
PRINTF("Init CINT\r\n");

void CINT_IRQ_HANDLER(void)
{
GPIO_GpioClearInterruptFlags(CINT_GPIO, 1U << CINT_PIN);
g_touch = true;
SDK_ISR_EXIT_BARRIER;
}

 

Does GPIO00_IRQn maps to port 0 pins 0-15 and GPIO01_IRQn to 16-31?

标签 (2)
0 项奖励
回复
1 解答
376 次查看
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @sstcor,

That is correct. Each GPIO has two interrupt vectors; one for each half of the 32 pins per port.

 

在原帖中查看解决方案

0 项奖励
回复
2 回复数
377 次查看
EdwinHz
NXP TechSupport
NXP TechSupport

Hi @sstcor,

That is correct. Each GPIO has two interrupt vectors; one for each half of the 32 pins per port.

 

0 项奖励
回复
372 次查看
sstcor
Contributor II
Hi @EdwinHz,
Thanks for confirming.
I'm having an issue setting up the P4_6 pin as an input interrupt. The same code works fine when I configure it for Port 0 pins, but it doesn't seem to work for P4_6.
Can all pins on the MCXN947 be configured as GPIO input interrupts?
Any assistance would be appreciated.
0 项奖励
回复