Functions | |
bool | Cy_SysPm_RegisterCallback (cy_stc_syspm_callback_t *handler) |
Registers a new syspm callback. More... | |
bool | Cy_SysPm_UnregisterCallback (cy_stc_syspm_callback_t const *handler) |
This function unregisters a callback. More... | |
cy_en_syspm_status_t | Cy_SysPm_ExecuteCallback (cy_en_syspm_callback_type_t type, cy_en_syspm_callback_mode_t mode) |
The function executes all registered callbacks with provided type and mode. More... | |
cy_stc_syspm_callback_t * | Cy_SysPm_GetFailedCallback (cy_en_syspm_callback_type_t type) |
Reads the result of the callback execution after the power mode functions execution. More... | |
bool Cy_SysPm_RegisterCallback | ( | cy_stc_syspm_callback_t * | handler | ) |
Registers a new syspm callback.
A callback is a function called after an event in the driver or middleware module has occurred. The handler callback API will be executed if the specific event occurs. SysPm callbacks are called when changing power modes. See cy_stc_syspm_callback_t.
handler | The address of the syspm callback structure. See cy_stc_syspm_callback_t. |
bool Cy_SysPm_UnregisterCallback | ( | cy_stc_syspm_callback_t const * | handler | ) |
This function unregisters a callback.
The registered callback can be unregistered and the function returns true. Otherwise, false is returned.
handler | The item that should be unregistered. See cy_stc_syspm_callback_t. |
cy_en_syspm_status_t Cy_SysPm_ExecuteCallback | ( | cy_en_syspm_callback_type_t | type, |
cy_en_syspm_callback_mode_t | mode | ||
) |
The function executes all registered callbacks with provided type and mode.
If no callbacks are registered, returns CY_SYSPM_SUCCESS.
type | The callback type. See cy_en_syspm_callback_type_t. |
mode | The callback mode. See cy_en_syspm_callback_mode_t. |
cy_stc_syspm_callback_t* Cy_SysPm_GetFailedCallback | ( | cy_en_syspm_callback_type_t | type | ) |
Reads the result of the callback execution after the power mode functions execution.
This function reads the value of the pointer that stores the result of callback execution. It takes power mode as the parameter and returns the address of the callback configuration structure in the case of failure or NULL in the case of success. This address of the failed callback allows finding the callback that blocks entering power mode.
type | Power mode for which a callback execution result is required. |