Low Power Callback

group group_smif_functions_syspm_callback

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.

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.

Example setup of SysPM deep sleep and hibernate mode

    /* Initialize callback parameters with SMIF register base address and 
     * context structure */
    cy_stc_syspm_callback_params_t smifSysPm = 
    {
        /* .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);
    
Return

cy_en_syspm_status_t

Parameters

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.

Example setup of SysPM deep sleep and hibernate mode

    /* Initialize callback parameters with SMIF register base address and 
     * context structure */
    cy_stc_syspm_callback_params_t smifSysPm = 
    {
        /* .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);
    
Return

cy_en_syspm_status_t

Parameters