Hi Everyone,
I am using NRF52840 in my project and compiling my code using sdk 17.0.2. My application requires 7 interrupt pins to be enabled. However when I am enabling all the interrupts i get an error. I observed that the sdk is allowing only 4 interrupts to be enabled. If I enable the 5th pin, it gets an error. Is there any way I can increase the count of interrupts to be enabled??
The pins which I want to be enabled as interrupts are as follows:-
//INTERRUPTS
#define INTERRUPT_1 NRF_GPIO_PIN_MAP(0,19)
#define INTERRUPT_2 NRF_GPIO_PIN_MAP(0,29)
#define INTERRUPT_3 NRF_GPIO_PIN_MAP(1,2)
#define INTERRUPT_4 NRF_GPIO_PIN_MAP(1,7)
#define INTERRUPT_5 NRF_GPIO_PIN_MAP(1,8)
#define INTERRUPT_6 NRF_GPIO_PIN_MAP(1,15)
#define INTERRUPT_7 NRF_GPIO_PIN_MAP(0,31)
I am enabling them in the code as follows:-
void gpio_init(void)
{
ret_code_t err_code;
err_code = nrf_drv_gpiote_init();
APP_ERROR_CHECK(err_code);
nrf_drv_gpiote_in_config_t in_config = GPIOTE_CONFIG_IN_SENSE_HITOLO(false);// GPIOTE_CONFIG_IN_SENSE_HITOLO//GPIOTE_CONFIG_IN_SENSE_TOGGLE
in_config.pull = NRF_GPIO_PIN_PULLUP;
err_code = nrf_drv_gpiote_in_init(INTERRUPT_1, &in_config, in_pin_handler);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_gpiote_in_init(INTERRUPT_2, &in_config, in_pin_handler);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_gpiote_in_init(INTERRUPT_3, &in_config, in_pin_handler);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_gpiote_in_init(INTERRUPT_4, &in_config, in_pin_handler);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_gpiote_in_init(INTERRUPT_5, &in_config, in_pin_handler);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_gpiote_in_init(INTERRUPT_6, &in_config, in_pin_handler);
APP_ERROR_CHECK(err_code);
err_code = nrf_drv_gpiote_in_init(INTERRUPT_7, &in_config, in_pin_handler);
APP_ERROR_CHECK(err_code);
nrf_drv_gpiote_in_event_enable(INTERRUPT_1, true);
nrf_drv_gpiote_in_event_enable(INTERRUPT_2, true);
nrf_drv_gpiote_in_event_enable(INTERRUPT_3, true);
nrf_drv_gpiote_in_event_enable(INTERRUPT_4, true);
nrf_drv_gpiote_in_event_enable(INTERRUPT_5, true);
nrf_drv_gpiote_in_event_enable(INTERRUPT_6, true);
nrf_drv_gpiote_in_event_enable(INTERRUPT_7, true);
}
Please help me on how we can use more than 7 interrupts.
Thank you.