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

How can I disable the GPIO irq

hi how can i disable the gpio irq, can how can i enable it.

and if i disable one pin irq not effect the other one?

Thank you very much.

  • Hello wiqifa

    GPIO interrupts are handled with GPIOTE. After GPIOTE has been initialized, you can configure pins as input pins with events with the nrf_drv_gpiote_in_init function. The function takes 3 arguments, the pin you want to configure, how it should be configured, and a callback function (handler) for when an event is triggered.

    If the pins are set for high accuracy, they will use dedicated GPIOTE channels that allow you to detect events happening on several pins simultaneously. Do note that there are a limited number of GPIOTE channels, and they do increase current consumption. Alternatively, with high accuracy disabled (Port event), you can detect events on up to 32 pins, but if two events happens simultaneously, only one will be processed. Please note you have to increase the number of low power events in sdk_config.h to accommodate this.

    After you have initialized a pin as an input, you can enable its ability to generate events with the nrf_drv_gpiote_in_event_enable, and deactivate it with nrf_drv_gpiote_in_event_disable. For more detailed information on port events see. It is an old post but it should still be valid. devzone.nordicsemi.com/.../

    You can also see the GPIOTE chapter of the product specification for more information.

    Best regards

    Jørn Frøysa

  • OK,thank you very much. now i think i don't need to disable it.

Related