USB state power manager module
The USB state power manager module is minor, stateless module that imposes an application power level restriction related to the USB state. The application power level is managed by the power manager module.
Module events
Source Module |
Input Event |
This Module |
Output Event |
Sink Module |
---|---|---|---|---|
|
|
|||
|
||||
|
||||
|
Note
See the Overview: Firmware architecture 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 selecting CONFIG_DESKTOP_USB_PM_ENABLE
.
It depends on CONFIG_DESKTOP_USB_ENABLE
and CONFIG_CAF_POWER_MANAGER
.
The log level is inherited from the USB state module.
Implementation details
For the change of the restricted power level, the module reacts to usb_state_event
.
Upon reception of the event and depending on the current USB state, the module requests different power restrictions:
If the USB state is set to
USB_STATE_POWERED
orUSB_STATE_ACTIVE
, thePOWER_MANAGER_LEVEL_ALIVE
is required.If the USB state is set to
USB_STATE_DISCONNECTED
, any power level is allowed.If the USB state is set to
USB_STATE_SUSPENDED
, thePOWER_MANAGER_LEVEL_SUSPENDED
is imposed. The module restricts the power down level to thePOWER_MANAGER_LEVEL_SUSPENDED
and generatesforce_power_down_event
.
For more information about the USB states in nRF Desktop, see the USB state module.