AnsweredAssumed Answered

No Clear interrupt for EINTx in 17xx_40xx in lpcOpen- Show Stopper

Question asked by Walter Buttazzo on Feb 28, 2017
Latest reply on Feb 28, 2017 by Walter Buttazzo

Huge lack in GPIOINT lpcopen library

 

I searched really a lot but I did not find any function or setting in order to clear external interrupt.

 

Every example and application note shows how to set e GPIO as external interrupt using EINT3 as collector, but if you want to use EINT0,1,2 as dedicated pin per external interrupt, there is no way to clear interupt flag at the bottom of interrupt routine.

 

 

Function Chip_GPIOINT_ClearIntStatus does NOT work because pin is not GPIO but EINT (Function 1 in IOCONF).

 

Very simple code:

#define INT_PORT 2
#define INT_PIN 12

void EINT2_IRQHandler(void)
{
Chip_GPIOINT_ClearIntStatus(LPC_GPIOINT, INT_PORT, (1 << INT_PIN));
}

 

int main(void)
{
Chip_IOCON_PinMuxSet(LPC_IOCON, INT_PORT, INT_PIN, IOCON_FUNC1); //EINT2
Chip_GPIO_SetPinDIRInput(LPC_GPIO, INT_PORT, INT_PIN);
/* Configure channel interrupt as edge sensitive and falling edge interrupt */
Chip_GPIOINT_SetIntFalling(LPC_GPIOINT, INT_PORT, INT_PIN);
/* Clear Interrupt */
Chip_GPIOINT_ClearIntStatus(LPC_GPIOINT, INT_PORT, (1 << INT_PIN));
NVIC_EnableIRQ(EINT2_IRQn);

while(1);

}

 

Running code is in loop inside EINT2_IRQHandler because (once again) interrupt flag is not clear.

This is valid for every EINT0,1,2

 

 

Please, I need help to fix this serious problem.

 

Thank you so muck

Outcomes