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

Source modules for module_state_event

module_state_event

usb_state_pm

USB state module

usb_state_event

force_power_down_event

Power manager module

power_manager_restrict_event

Power manager 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 selecting CONFIG_DESKTOP_USB_PM_ENABLE option. It depends on CONFIG_DESKTOP_USB_ENABLE and CONFIG_CAF_POWER_MANAGER options.

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, the module restricts the power down level to the POWER_MANAGER_LEVEL_SUSPENDED.

  • If the USB state is set to USB_STATE_ACTIVE, the POWER_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, the POWER_MANAGER_LEVEL_SUSPENDED is imposed. The module restricts the power down level to the POWER_MANAGER_LEVEL_SUSPENDED and generates force_power_down_event.

For more information about the USB states in nRF Desktop, see the USB state module.