GPIO wake-up and sleep

Dear Dialog Support,

I am testing the example ble_app_peripheral in SDK_6.0.18.1182.1. I want to realize the following function:

Once DA14531 is powered on, it enters into the extended sleep mode. When the button is pressed down once, DA14531 wakes up and the functions of the original example ble_app_peripheral can normally perform. And when the button is pressed down once again, DA14531 enters into the extended sleep mode again, and so on.

Could you please show me how to achieve this. Thanks a lot!