PSoC 6 Peripheral Driver Library
Low Power Callback

General Description

The driver supports SysPm callback for Deep Sleep transition.

Functions

cy_en_syspm_status_t Cy_I2S_DeepSleepCallback (cy_stc_syspm_callback_params_t *callbackParams, cy_en_syspm_callback_mode_t mode)
 This is a callback function to be used at the application layer to manage an I2S operation during the Deep Sleep cycle. More...
 

Function Documentation

◆ Cy_I2S_DeepSleepCallback()

cy_en_syspm_status_t Cy_I2S_DeepSleepCallback ( cy_stc_syspm_callback_params_t callbackParams,
cy_en_syspm_callback_mode_t  mode 
)

This is a callback function to be used at the application layer to manage an I2S operation during the Deep Sleep cycle.

It stores the I2S state (Tx/Rx enabled/disabled/paused) into the context structure and stops the communication before entering into Deep Sleep power mode and restores the I2S state after waking up.

Parameters
callbackParams- The pointer to the callback parameters structure, see cy_stc_syspm_callback_params_t.
modeCallback mode, see cy_en_syspm_callback_mode_t
Returns
the SysPm callback status cy_en_syspm_status_t.
Note
Use the cy_stc_i2s_context_t data type for definition of the *context element of the cy_stc_syspm_callback_params_t structure.
Function Usage
/* Scenario: The I2S hardware must be suitably prepared to enter device Deep Sleep Mode.
It must stop all communication before Deep Sleep Mode entry and continue communication upon Deep Sleep Mode exit. */
/* Context structure for Cy_I2S_DeepSleepCallback */
cy_stc_i2s_context_t i2sDeepSleepCallbackContext;
/* Parameters structure for Cy_I2S_DeepSleepCallback */
cy_stc_syspm_callback_params_t i2sDeepSleepCallbackParams =
{
(void*) I2S0,
(void*) &i2sDeepSleepCallbackContext
};
/* Initialization structure for Cy_I2S_DeepSleepCallback */
cy_stc_syspm_callback_t i2sDeepSleepCallback =
{
/* Skip execution for CHECK_READY and CHECK_FAIL events */
&i2sDeepSleepCallbackParams,
NULL,
NULL,
0
};
/* Register the Cy_I2S_DeepSleepCallback */
if (CY_SYSPM_SUCCESS != Cy_SysPm_RegisterCallback(&i2sDeepSleepCallback))
{
/* Insert error handling */
}
/* Enter chip Deep Sleep Mode using the SysPm driver API */