This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Handling multiple GPIO pin interrupts

Hello,

I am working on pin interrupts and was able to handle with 1 pin interrupt. I used GPIOTE port interrupt. This is the code snippet for initialising:

	NRF_GPIO->PIN_CNF[Pin_Key] = (GPIO_PIN_CNF_DRIVE_S0S1 << GPIO_PIN_CNF_DRIVE_Pos)
                             | (NRF_GPIO_PIN_PULLUP << GPIO_PIN_CNF_PULL_Pos)
                             | (GPIO_PIN_CNF_INPUT_Connect << GPIO_PIN_CNF_INPUT_Pos)
                             | (GPIO_PIN_CNF_DIR_Input << GPIO_PIN_CNF_DIR_Pos);
NRF_GPIO->PIN_CNF[Pin_Key] |=
(PIN_SENSE_ENABLE | key_status) << GPIO_PIN_CNF_SENSE_Pos;
NRF_GPIOTE->INTENSET = GPIOTE_INTENSET_PORT_Set << GPIOTE_INTENSET_PORT_Pos;
NVIC_EnableIRQ(GPIOTE_IRQn);
NVIC_SetPriority(GPIOTE_IRQn, APP_IRQ_PRIORITY_LOW);

Here is the IRQ:

	if (NRF_GPIOTE->EVENTS_PORT == 0)		// Do we received port event?
{
	return;
}
NRF_GPIOTE->EVENTS_PORT = 0;			// Clear the port event

Now I need one more key to handle and configured in the same way as above. But I am not able to get for which pin interrupt, the ISR is called? Is there a pin interrupt flag bit in nRF51822?

Regards,
Sowmya

Parents Reply Children
No Data
Related