Callback function to be used when entering system Deep Sleep mode.
This function is applicable if:
- The FLL is enabled
- The PLL is enabled and is driven by ECO
This function performs the following:
- Before entering Deep Sleep, the clock configuration is saved in SRAM. If the FLL/PLL source is the ECO, then the FLL/PLL is bypassed and the source is changed to IMO.
If the FLL is enabled - it is just bypassed.
- Upon wakeup from Deep Sleep, the function waits for ECO stabilization, then restores the configuration and waits for the FLL/PLL to regain their frequency locks.
If ECO is not used and FLL is enabled - it waits for FLL lock and unbypasses it.
The function prevents entry into Deep Sleep mode if the measurement counters are currently counting; see Cy_SysClk_StartClkMeasurementCounters.
This function can be called during execution of Cy_SysPm_CpuEnterDeepSleep. To do so, register this function as a callback before calling Cy_SysPm_CpuEnterDeepSleep - specify CY_SYSPM_DEEPSLEEP as the callback type and call Cy_SysPm_RegisterCallback.
- Note
- This function is recommended to be the last callback that is registered. Doing so minimizes the time spent on low power mode entry and exit.
This function implements all four SysPm callback modes cy_en_syspm_callback_mode_t. So the cy_stc_syspm_callback_t::skipMode must be set to 0UL.
This function does not support such cases as, for example, FLL is enabled but bypassed by user code before entering Deep Sleep.
You can use this callback implementation as an example to design custom low-power callbacks for certain user application.
- Parameters
-
- Returns
- Error / status code; see cy_en_syspm_status_t. Pass if not doing a clock measurement, otherwise Fail. Timeout if timeout waiting for ECO, FLL or PLL to get stable / regain its frequency lock. CY_PRA_STATUS_* - For the PSoC 64 devices there are possible situations when function returns the PRA error status code cy_en_pra_status_t instead of cy_en_sysclk_status_t. This is because for PSoC 64 devices the function uses the PRA driver to change the protected registers. Refer to cy_en_pra_status_t for more details.
- Function Usage
NULL,
NULL
};
0UL,
&clkCallbackParams,
NULL,
NULL,
0
};
{
}