PSoC 6 Peripheral Driver Library

General Description

This driver supports one SysPm callback for Deep Sleep transition.


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.

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
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. */
/* Put the device into Deep Sleep mode and wait for an interrupt to wake up. */