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

GPIOTE interrupt not trigered

It seems GPIOTE interrupt do not trigger when multiple IN signals are defined as GPIOTE_CONFIG_IN_SENSE_XXX(false). It works when GPIOTE_CONFIG_IN_SENSE_XXX(true)

I am using sdk14.0.0 with 10040 kit for this example.

It is a modified "pin_change_int" SDK example : Commented 1 signal : works Uncommented 2 signals : do not work 2 signals with SENSE "true" : works

void in_pin_handler0(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action)
{
    nrf_drv_gpiote_out_toggle(PIN_OUT0);
}


void in_pin_handler1(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action)
{
    nrf_drv_gpiote_out_toggle(PIN_OUT1);
}

/**
 * @brief Function for configuring: PIN_IN0 pin for input, PIN_OUT0 pin for output,
 * and configures GPIOTE to give an interrupt on pin change.
 */
static void gpio_init(void)
{
    ret_code_t err_code;

    err_code = nrf_drv_gpiote_init();
    APP_ERROR_CHECK(err_code);

    nrf_drv_gpiote_out_config_t out_config = GPIOTE_CONFIG_OUT_SIMPLE(false);

	
    err_code = nrf_drv_gpiote_out_init(PIN_OUT0, &out_config);
    APP_ERROR_CHECK(err_code);
	
    err_code = nrf_drv_gpiote_out_init(PIN_OUT1, &out_config);
    APP_ERROR_CHECK(err_code);

	
	
    nrf_drv_gpiote_in_config_t in_config = GPIOTE_CONFIG_IN_SENSE_TOGGLE(false);
    in_config.pull = NRF_GPIO_PIN_PULLUP;

	
	
    err_code = nrf_drv_gpiote_in_init(PIN_IN0, &in_config, in_pin_handler0);
    APP_ERROR_CHECK(err_code);
	
    //err_code = nrf_drv_gpiote_in_init(PIN_IN1, &in_config, in_pin_handler0);
    //APP_ERROR_CHECK(err_code);

	
    nrf_drv_gpiote_in_event_enable(PIN_IN0, true);
    //nrf_drv_gpiote_in_event_enable(PIN_IN1, true);
}

/**
 * @brief Function for application main entry.
 */
int main(void)
{
    gpio_init();

    while (true)
    {
        // Do nothing.
    }
}
Related