This is my environment
- IDE: VSC
- SDK: NCS v2.2.0
- nRF52832 on nRF52-DK
This is what I am trying to do:
- Have my CPU go into a low power idle mode (should be < 2uA current consumption) whilst idle. To get the lowest quiescent current, I'm effectively disabling the UART.
- Come out of this mode with negative going edge on the RX pin (p0.08). The device that is transmitting will just send a dummy character to trigger the nRF52832 out of idle
- Enable the UART, send an "I'm active" message to the transmitting device over UART and then wait for data
I'm thinking the way I need to do this is to:
- Disable the UART using: pm_device_action_run(uart, PM_DEVICE_ACTION_SUSPEND);
- Set up P0.08 as: gpio_pin_configure_dt(&p0_08, GPIO_INPUT | GPIO_ACTIVE_LOW);
- Configure a callback on P0.08: gpio_pin_interrupt_configure_dt(&p0_08,GPIO_INT_EDGE_TO_ACTIVE);
- In the callback, disable the interrupt configuration, and activate the UART: pm_device_action_run(uart, PM_DEVICE_ACTION_SUSPEND);
Has anyone done this in NCS and is the above approach the best way to go about this? Or, better still, is it even going to work?
Best regards,
Mike