HID state power manager module
The HID state power manager module is a minor module that prevents suspending the device when HID reports are exchanged with the host.
Module events
Source Module |
Input Event |
This Module |
Output Event |
Sink Module |
|---|---|---|---|---|
|
|
|||
|
Note
See the Application overview for more information about the event-based communication in the nRF Desktop application and about how to read this table.
Configuration
The module is enabled by CONFIG_DESKTOP_HID_STATE_PM_ENABLE Kconfig option.
The option depends on the CONFIG_CAF_POWER_MANAGER and CONFIG_DESKTOP_HID_STATE_ENABLE Kconfig options.
It selects the CONFIG_CAF_KEEP_ALIVE_EVENTS Kconfig option to enable support for the keep_alive_event.
The option is enabled by default.
Implementation details
The module relies on hid_report_event to detect HID report exchange.
The module submits a keep_alive_event on the HID report exchange to prevent application power down.
Note
In the nRF Desktop application, most of the HID reports are broadcasted as hid_report_event, but there are exceptions.
For example, the Configuration channel uses HID feature reports or HID output reports as transport and the configuration channel data is broadcasted using config_event in the application.
Hence, the HID state power manager module does not prevent suspending the device when the configuration channel is in use.
Tracking power manager restrictions
If the power manager events are supported (CONFIG_CAF_POWER_MANAGER_EVENTS), the HID state power manager module subscribes to the power_manager_restrict_event to track the maximum allowed power level.
If the POWER_MANAGER_LEVEL_ALIVE power level is enforced by any application module, the module skips submitting the keep_alive_event to reduce the number of performed operations and improve performance.