PSOC E8XXGP Device Support Library

| PSOC E8XXGP Device Support Library

Functions
Low Power Callback
PDL API Reference » SMIF (Serial Memory Interface) » Functions | PDL API Reference » SMIF (Serial Memory Interface) » Functions » Low Level Functions

## 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

  callbackParams | The pointer to the structure with SMIF SysPm callback parameters (pointer to SMIF registers, context and call mode cy_stc_syspm_callback_params_t).
  mode | Callback 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 */
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);
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.
Definition: cy_smif.c:2839
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.
Definition: cy_smif.c:2715
CY_SYSPM_HIBERNATE
@ CY_SYSPM_HIBERNATE
The Hibernate enum callback type.
Definition: cy_syspm.h:1520
CY_SYSPM_DEEPSLEEP
@ CY_SYSPM_DEEPSLEEP
The Deep Sleep enum callback type.
Definition: cy_syspm.h:1519
cy_stc_syspm_callback_params_t
The structure contains syspm callback parameters.
Definition: cy_syspm.h:2054
cy_stc_syspm_callback_t
Structure with syspm callback configuration elements.
Definition: cy_syspm.h:2068
Cy_SysPm_RegisterCallback
bool Cy_SysPm_RegisterCallback(cy_stc_syspm_callback_t *handler)
Registers a new syspm callback.
Definition: cy_syspm_v4.c:2063

## ◆ 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

  callbackParams | The pointer to the structure with SMIF SysPm callback parameters (pointer to SMIF registers, context and call mode cy_stc_syspm_callback_params_t).
  mode | Callback 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 */
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);