void GPIO_int(void) { /* Enable AHB clock to the GPIO domain. */ LPC_SYSCON->SYSAHBCLKCTRL |= (1<<6); /* Enable AHB clock to the FlexInt, GroupedInt domain. */ LPC_SYSCON->SYSAHBCLKCTRL |= (1<<19) | (1<<24); LPC_GPIO_PORT->DIR[1] &= ~(1<<1); //Port 1, pin 1 LPC_SYSCON->PINSEL[0] = 1 + 32; //Interrupt Port 1, pin 1 LPC_GPIO_PIN_INT->ISEL &= ~(1<<0); //Edge sensitive LPC_GPIO_PIN_INT->IENR |= (1<<0); /*Enable edge or rising level interrupt */ //Enable registers LPC_GPIO_PIN_INT->SIENR |= (1<<0); /*Enable Rising edge interrupt */ LPC_GPIO_PIN_INT->IST = (1<<0); NVIC_EnableIRQ(PIN_INT0_IRQn); } void PIN_INT0_IRQHandler(void) { LPC_GPIO_PORT->SET[0] = 0x10000; if ( LPC_GPIO_PIN_INT->IST & (0x1<<0) ) LPC_GPIO_PIN_INT->IST = 0x1<<0; } |
LPC_SYSCON->PINSEL[0] = xx |