Low Power Functions

group group_usbfs_dev_drv_functions_low_power

The Low-power functions provide an API to implement Low-power callback at the application level.

Functions

__STATIC_INLINE bool Cy_USBFS_Dev_Drv_CheckActivity (USBFS_Type *base)

Returns the activity status of the bus.

It clears the hardware status to provide an updated status on the next call of this function. This function is useful to determine whether there is any USB bus activity between function calls. A typical use case is to determine whether the USB suspend conditions are met.

Return

The bus activity since the last call.

Parameters
  • base: The pointer to the USBFS instance.

__STATIC_INLINE void Cy_USBFS_Dev_Drv_Force (USBFS_Type *base, cy_en_usbfs_dev_drv_force_bus_state_t state)

Forces a USB J, K, or SE0 state on the USB lines.

A typical use case is to signal a Remote Wakeup condition on the USB bus.

Parameters

void Cy_USBFS_Dev_Drv_Suspend(USBFS_Type *base, cy_stc_usbfs_dev_drv_context_t *context)

Prepares the USBFS component to enter Deep Sleep mode.

note

After entering low-power mode, the data that is left in the IN or OUT endpoint buffers is not restored after a wakeup, and is lost. Therefore, it should be stored in the SRAM for OUT endpoint or read by the host for the IN endpoint before entering low-power mode.

Parameters
  • base: The pointer to the USBFS instance.

  • context: The pointer to the context structure cy_stc_usbfs_dev_drv_context_t allocated by the user. The structure is used during the USBFS Device operation for internal configuration and data retention. The user must not modify anything in this structure.

void Cy_USBFS_Dev_Drv_Resume(USBFS_Type *base, cy_stc_usbfs_dev_drv_context_t *context)

Prepares the USBFS component for operation after exiting Deep Sleep mode.

Parameters
  • base: The pointer to the USBFS instance.

  • context: The pointer to the context structure cy_stc_usbfs_dev_drv_context_t allocated by the user. The structure is used during the USBFS Device operation for internal configuration and data retention. The user must not modify anything in this structure.