Low Power Callback

group group_lpcomp_functions_syspm_callback

The driver supports SysPm callback for Deep Sleep and Hibernate transition.

Functions

cy_en_syspm_status_t Cy_LPComp_DeepSleepCallback(cy_stc_syspm_callback_params_t *callbackParams, cy_en_syspm_callback_mode_t mode)

This function checks the current power mode of LPComp and then disables the LPComp block if there is no wake-up source from LPComp in the deep-sleep mode.

It stores the state of the LPComp enable and then disables the LPComp block before going to the low power modes, and recovers the LPComp power state after wake-up using the stored value.

Return

cy_en_syspm_status_t

Parameters
  • *callbackParams: The cy_stc_syspm_callback_params_t structure with the callback parameters which consists of mode, base and context fields: *base - LPComp register structure pointer; *context - Context for the call-back function; mode CY_SYSPM_CHECK_READY - No action for this state. CY_SYSPM_CHECK_FAIL - No action for this state. CY_SYSPM_BEFORE_TRANSITION - Checks the LPComp interrupt mask and the power mode, and then disables or enables the LPComp block according to the condition. Stores the LPComp state to recover the state after wake up. CY_SYSPM_AFTER_TRANSITION - Enables the LPComp block, if it was disabled before the sleep mode.

  • mode: Callback mode, see cy_en_syspm_callback_mode_t

cy_en_syspm_status_t Cy_LPComp_HibernateCallback(cy_stc_syspm_callback_params_t *callbackParams, cy_en_syspm_callback_mode_t mode)

This function checks the current power mode of LPComp and then disable the LPComp block, if there is no wake-up source from LPComp in the hibernate mode.

Return

cy_en_syspm_status_t

Parameters
  • *callbackParams: The cy_stc_syspm_callback_params_t structure with the callback parameters which consists of mode, base and context fields: *base - LPComp register structure pointer; *context - Context for the call-back function; mode CY_SYSPM_CHECK_READY - No action for this state. CY_SYSPM_CHECK_FAIL - No action for this state. CY_SYSPM_BEFORE_TRANSITION - Checks the wake-up source from the hibernate mode of the LPComp block, and then disables or enables the LPComp block according to the condition.

  • mode: Callback mode, see cy_en_syspm_callback_mode_t