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

How to ? : Button Press Event Register & Enable a selected button to wake up the NRF52 DK from Deep Sleep

I am new to NRF (The usual song Slight smile)

Here's what I am trying to do :

Connect my button on P0.16 or P0.17 of my NRF52 DK Board , and when I press the button connected to P0.17 a function be called to wake up the chip from DEEP Sleep , and when I press another button , another function be called to do something else the other one be not able to wake up the chip.

I had a look at the GPIOTE Library , then I had a look at the BSP Library , I think they all have overlapping functionalities,

I was expecting some api along these lines.

esp_sleep_enable_ext0_wakeup(GPIO_NUM_X, level) // coming straight from ESP32 Arduino ! https://randomnerdtutorials.com/esp32-external-wake-up-deep-sleep/

My ESP32 uses this call to get up from sleep (My P0.17 Requirement.
I am having trouble understanding how to register a button callback.
A very simple example by someone on the forum would help me get started.
Also APP_GPIOTE_INIT(MAX_USERS); whats the USER here ? (I am a total noob here.) does it corresponds to different button registering for a different callback like my P0.16 for some other function , P0.17 for wakeup.
Conclusion : Help me get started on GPIOTE Package.

An simple example would be much appreciated.

Getting Started is not getting me started ,someone on the forum said :) .
Thank You.

Related