PSoC 6 Peripheral Driver Library

General Description

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

Functions

cy_en_syspm_status_t Cy_SMIF_DeepSleepCallback (cy_stc_syspm_callback_params_t *callbackParams, cy_en_syspm_callback_mode_t mode)
 This function handles the transition of the SMIF into and out of Deep Sleep mode. More...
 
cy_en_syspm_status_t Cy_SMIF_HibernateCallback (cy_stc_syspm_callback_params_t *callbackParams, cy_en_syspm_callback_mode_t mode)
 This function handles the transition of the SMIF into Hibernate mode. More...
 

Function Documentation

◆ Cy_SMIF_DeepSleepCallback()

cy_en_syspm_status_t Cy_SMIF_DeepSleepCallback ( cy_stc_syspm_callback_params_t callbackParams,
cy_en_syspm_callback_mode_t  mode 
)

This function handles the transition of the SMIF into and out of Deep Sleep mode.

It prevents the device from entering DeepSleep if SMIF is actively communicating, or there is any data in the TX or RX FIFOs, or SMIF is in memory mode.

This function should be called while execution of Cy_SysPm_CpuEnterDeepSleep therefore must be registered as a callback before the call. To register it call Cy_SysPm_RegisterCallback and specify CY_SYSPM_DEEPSLEEP as the callback type.

Note
This API is template and user should add code for external memory enter/exit low power mode.
Parameters
callbackParamsThe pointer to the structure with SMIF SysPm callback parameters (pointer to SMIF registers, context and call mode cy_stc_syspm_callback_params_t).
modeCallback mode, see cy_en_syspm_callback_mode_t
Returns
cy_en_syspm_status_t

Example setup of SysPM deep sleep and hibernate mode

/* Initialize callback parameters with SMIF register base address and
* context structure */
{
/* .base */ SMIF0,
/* .context */ &smifContext
};
/* Register SMIF SysPm callback for deep sleep mode*/
cy_stc_syspm_callback_t smifDeepSleepCb =
{
/* .callback */ &Cy_SMIF_DeepSleepCallback,
/* .type */ CY_SYSPM_DEEPSLEEP,
/* .skipMode */ 0U,
/* .callbackParams */ &smifSysPm,
/* .prevItm */ NULL,
/* .nextItm */ NULL,
/* .order */ 0
};
Cy_SysPm_RegisterCallback(&smifDeepSleepCb);
/* Register SMIF SysPm callback for hibernate mode*/
cy_stc_syspm_callback_t smifHibernateCb=
{
/* .callback */ &Cy_SMIF_HibernateCallback,
/* .type */ CY_SYSPM_HIBERNATE,
/* .skipMode */ 0U,
/* .callbackParams */ &smifSysPm,
/* .prevItm */ NULL,
/* .nextItm */ NULL,
/* .order */ 0
};
Cy_SysPm_RegisterCallback(&smifHibernateCb);

◆ Cy_SMIF_HibernateCallback()

cy_en_syspm_status_t Cy_SMIF_HibernateCallback ( cy_stc_syspm_callback_params_t callbackParams,
cy_en_syspm_callback_mode_t  mode 
)

This function handles the transition of the SMIF into Hibernate mode.

It prevents the device from entering Hibernate if the SMIF is actively communicating, or there is any data in the TX or RX FIFO, or SMIF is in memory mode.

This function should be called during execution of Cy_SysPm_SystemEnterHibernate therefore it must be registered as a callback before the call. To register it call Cy_SysPm_RegisterCallback and specify CY_SYSPM_HIBERNATE as the callback type.

Note
This API is template and user should add code for external memory enter/exit low power mode.
Parameters
callbackParamsThe pointer to the structure with SMIF SysPm callback parameters (pointer to SMIF registers, context and call mode cy_stc_syspm_callback_params_t).
modeCallback mode, see cy_en_syspm_callback_mode_t
Returns
cy_en_syspm_status_t

Example setup of SysPM deep sleep and hibernate mode

/* Initialize callback parameters with SMIF register base address and
* context structure */
{
/* .base */ SMIF0,
/* .context */ &smifContext
};
/* Register SMIF SysPm callback for deep sleep mode*/
cy_stc_syspm_callback_t smifDeepSleepCb =
{
/* .callback */ &Cy_SMIF_DeepSleepCallback,
/* .type */ CY_SYSPM_DEEPSLEEP,
/* .skipMode */ 0U,
/* .callbackParams */ &smifSysPm,
/* .prevItm */ NULL,
/* .nextItm */ NULL,
/* .order */ 0
};
Cy_SysPm_RegisterCallback(&smifDeepSleepCb);
/* Register SMIF SysPm callback for hibernate mode*/
cy_stc_syspm_callback_t smifHibernateCb=
{
/* .callback */ &Cy_SMIF_HibernateCallback,
/* .type */ CY_SYSPM_HIBERNATE,
/* .skipMode */ 0U,
/* .callbackParams */ &smifSysPm,
/* .prevItm */ NULL,
/* .nextItm */ NULL,
/* .order */ 0
};
Cy_SysPm_RegisterCallback(&smifHibernateCb);