There are a number of peripherals which require special handling when the MCU enters or exits DeepSleep. These actions can take place at one or more stages of the transition process:
For drivers that already have deep sleep callbacks available in PDL and contain all logic needed to safely handle deepsleep entry this library only provides aliases in order to maintain uniformity on the naming level. For drivers for which instead more steps or checks are needed, the implementaiton is handled in this asset. Each callback is only available for devices that include the needed IP and the packaging system makes sure to include only relevant files for each family of devices.
All prebuilt callback implementations will provide a function signature which conforms to the Cy_SysPmCallback function pointer signature. This enables them to be directly registered without the application needing to write a wrapper function to adapt the signature.
This means that any information which a prebuilt callback needs in order to operation must be consolidated in a single high-level struct that can be passed via the "context" argument of cy_stc_syspm_callback_params_t (a generic void pointer whose interpretation is defined by each callback). The one exception is the base pointer, which is already passed via a separate member on cy_stc_syspm_callback_params_t . If a callback does not require any information beyond the base pointer, the context member can be left unused.