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

how to use GPIOTE_IRQHandler

im using an external acceleromter to trigger an event once the device shaked. I configured the event pin on nrf51 EVENT_PIN as an input this way:

 APP_ERROR_CHECK(acc_config_motion_detector());
    nrf_gpio_cfg_sense_input(EVENT_PIN, NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_SENSE_HIGH);
    NRF_GPIOTE->INTENSET = GPIOTE_INTENSET_PORT_Msk;
    NVIC_EnableIRQ(GPIOTE_IRQn);

but then I couldn't implement the handler, so I used the handler GPIOTE_IRQHandler of nrf_drv_gpiote but then I'm not sure how to know in what part of the code I should call my interrupt routine (how can I know that it's EVENT_PIN that's triggered) my question is :

how can I isolate EVENT_PIN pin on GPIOTE_IRQHandler to run my own interrupt routine.

how can I if possible use my own handler without modifying the GPIOTE_IRQHandler of nrf_drv_gpiote file

Parents Reply Children
No Data
Related