nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
power_down_event Struct Reference

Power down event. More...

#include <power_event.h>

Data Fields

struct app_event_header header
 
bool error
 

Detailed Description

Power down event.

The power down event is submitted to inform the application modules that they should be suspended to reduce the power consumption. The power down event can also be submitted to suspend the modules after an application module reports fatal error submitting module_state_event with state set to MODULE_STATE_ERROR.

An application module that handles the power down event should submit module_state_event with state set to MODULE_STATE_OFF or MODULE_STATE_STANDBY. The MODULE_STATE_STANDBY should be submitted by a module that is capable of submitting wake_up_event to wake up the system on external event. Otherwise MODULE_STATE_OFF should be reported. If the module is unable to suspend at the moment, it should consume the received power down events until it is ready to suspend itself. The module should also delay submitting the module_state_event until it is ready to suspend itself.

The module may handle the power down event differently if it is related to fatal error. In general, an application module should suspend itself, but some of the modules may still need to be active after the fatal error. For example, a module that controls hardware LEDs may be used to display LED effect related to the fatal error.

Only the module that controls the power management in the application can submit the power down event. It is also the final subscriber for the power down event. When it receives the power down event, it is ensured that all other application modules that handle the power down event are already suspended. Then it can continue the power down procedure.

Note
An application module that handles power down event must also handle wake_up_event. Otherwise the module will never be woken up after suspending.

The documentation for this struct was generated from the following files: