I am working on nRF51822, SDK12.3.0 in IAR workbench.
I am use init pin 2 as an interrupt.
Device will advertise for 20 minute after 20 minute device go to sleep.I want to wake up the chip only when pin 2 detect falling edge. I have used following lines to configure the input pin before device going to sleep.
err_code = sd_power_system_off();
Since I can either put sense to high or low. For e.g. if I Use "GPIO_PIN_CNF_SENSE_Low" and if pin 2 input is low, the nRF wakes up as soon as i put it in system off mode.
Is there any way to make sense functionality into sensing the edge rather than level ?
Thanks & Regards,
you can configure a level opposite to current one. The drawback is an additional false wake-up at rising edge, but it seems there is no other way.
nrf_gpio_pin_sense_t level = nrf_gpio_pin_read(2) ? NRF_GPIO_PIN_SENSE_LOW : NRF_GPIO_PIN_SENSE_HIGH;