MTB CAT1 Peripheral driver library

General Description

This driver supports one SysPm callback for Deep Sleep transition.

Functions

cy_en_syspm_status_t Cy_CTDAC_DeepSleepCallback (cy_stc_syspm_callback_params_t *callbackParams, cy_en_syspm_callback_mode_t mode)
 Callback to prepare the CTDAC before entering and after exiting Deep Sleep mode. More...
 

Function Documentation

◆ Cy_CTDAC_DeepSleepCallback()

cy_en_syspm_status_t Cy_CTDAC_DeepSleepCallback ( cy_stc_syspm_callback_params_t callbackParams,
cy_en_syspm_callback_mode_t  mode 
)

Callback to prepare the CTDAC before entering and after exiting Deep Sleep mode.

If deglitching is used, it is disabled before entering Deep Sleep to ensure the deglitch switches are closed. This is needed only if the CTDAC will be enabled in DeepSleep. Upon wakeup, deglitching will be re-enabled if it was previously used.

Parameters
callbackParamsPointer to structure of type cy_stc_syspm_callback_params_t. The context pointer should point to cy_stc_ctdac_context_t.
modeCallback mode, see cy_en_syspm_callback_mode_t
Returns
See cy_en_syspm_status_t
Function Usage
/* Scenario: The CTDAC has been configured to stay on in Deep Sleep mode.
* Before putting the device into Deep Sleep mode, the CTDAC Deep Sleep
* callback must be registered to ensure proper operation during and after Deep Sleep mode. */
/* Set the base address pointer to the CTDAC hardware block. */
static cy_stc_syspm_callback_params_t DeepSleepCallbackParams;
static cy_stc_ctdac_context_t ctdacContext;
DeepSleepCallbackParams.base = CTDAC0;
DeepSleepCallbackParams.context = &ctdacContext;
/* Attach the Cy_CTDAC_DeepSleepCallback function and set the callback parameters. */
cy_stc_syspm_callback_t DeepSleepCallbackStruct;
DeepSleepCallbackStruct.callback = &Cy_CTDAC_DeepSleepCallback;
DeepSleepCallbackStruct.type = CY_SYSPM_DEEPSLEEP;
DeepSleepCallbackStruct.callbackParams = &DeepSleepCallbackParams;
/* Register the callback before entering Deep Sleep mode. */
Cy_SysPm_RegisterCallback(&DeepSleepCallbackStruct);
/* Put the device into Deep Sleep mode and wait for an interrupt to wake up. */
Cy_SysPm_DeepSleep(CY_SYSPM_WAIT_FOR_INTERRUPT);