You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/nrf/libraries/caf/buttons.rst
+7-1Lines changed: 7 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,7 +65,7 @@ You can change this with :kconfig:option:`CONFIG_CAF_BUTTONS_POLARITY_INVERSED`,
65
65
Power management configuration
66
66
==============================
67
67
68
-
If the :kconfig:option:`CONFIG_CAF_BUTTONS_PM_EVENTS` Kconfig option is enabled, the module interacts with power management events (:c:struct:`power_down_event` and :c:struct:`wake_up_event`).
68
+
If the :kconfig:option:`CONFIG_CAF_BUTTONS_PM_EVENTS` Kconfig option is enabled, the module interacts with power management events (:c:struct:`power_down_event`, :c:struct:`power_off_event`, and :c:struct:`wake_up_event`).
69
69
70
70
The module can be used to trigger an application wakeup event.
71
71
By default, pressing any button wakes up the application.
@@ -159,6 +159,7 @@ In that case, the following additional states are available:
159
159
The power management events that module can react to are the following:
160
160
161
161
* :c:struct:`power_down_event`
162
+
* :c:struct:`power_off_event`
162
163
* :c:struct:`wake_up_event`
163
164
164
165
If :c:struct:`power_down_event` comes while the module is in the ``STATE_SCANNING`` state, the module switches to ``STATE_SUSPENDING`` and remains in this state until no button is pressed.
@@ -168,3 +169,8 @@ If :c:struct:`power_down_event` comes while the module is in the ``STATE_ACTIVE`
168
169
Similarly, as in ``STATE_ACTIVE``, in ``STATE_IDLE`` the module enables the GPIO interrupts and waits for the pin state to change.
169
170
However, in ``STATE_IDLE`` the interrupts are enabled only for the subset of buttons that are configured to wake up the application.
170
171
Pressing any of these buttons also invokes :c:struct:`wake_up_event` and sends it to all subscribing modules.
172
+
173
+
.. note::
174
+
If the system enters the off state (indicated by :c:struct:`power_off_event`), a button press triggers an instant system reboot (:c:func:`sys_reboot`).
175
+
This is done to prevent entering the system off state with GPIO interrupts disabled (:c:func:`sys_poweroff` call may prevent the CAF Buttons module from scanning buttons and reenabling GPIO interrupts).
176
+
System reboot is anyway necessary to wake up from the system off state.
0 commit comments