- Thu Aug 19, 2010 6:34 am
#107734
I have setup a board with a momentary button on Port 2.10; I setup the code as a gpio interrupt on falling edge, it doesn't interrupt.
Maybe this is because I'm confused about the difference between an external interrupt and a gpio interrupt
.
I looked at lpc17xx.h and it looks like there is no irq for a gpio interrupt (I am utilizing CMSIS), only for external interrupt 0 through 3. What is the correct irq to use?
Maybe this is because I'm confused about the difference between an external interrupt and a gpio interrupt
.
I looked at lpc17xx.h and it looks like there is no irq for a gpio interrupt (I am utilizing CMSIS), only for external interrupt 0 through 3. What is the correct irq to use?
Code: Select all
// ***** EINT2 Initialization function *****
// Setup External Interrupt
void EINT2_init (void)
{
// Set PINSEL4 [21:20] = 00 for P2.10 as GPIO
LPC_PINCON->PINSEL4 &= ~(0x11 << 20);
//set the interrupt 2.10 for falling edge
LPC_GPIOINT->IO2IntEnF &= ~(1<<10);
// Enable External Interrupt 2
NVIC_EnableIRQ(EINT2_IRQn );
}
// ***** EINT2 Interrupt Handler*****
void EINT2_IRQHandler(void)
{
//clear the interrupt
LPC_GPIOINT->IO2IntClr |= (1<<10);
leds_invert(); //this has no relevance in this discussion
}