1.29.24.5 SUPC_BODVDDCallbackRegister Function
C
void SUPC_BODVDDCallbackRegister( SUPC_BODVDD_CALLBACK callback, uintptr_t context );
Summary
Registers the function to be called when a Brown Out Event has occurred.
Description
This function registers the callback function to be called when a Brown Out event has occurred. Note that the callback function will be called only if the BODVDD action setting in NVM User Row is configured to generate an interrupt and not reset the system.
Precondition
SUPC_Initialize() must have been called first for the associated instance.
Parameters
Param | Description |
---|---|
callback | callback function pointer. |
context | Allows the caller to provide a context value (usually a pointer to the callers context for multi-instance clients). |
Returns
None.
Example
MY_APP_OBJ myAppObj; void APP_SUPC_CallbackFunction (uintptr_t context) { // The context was set to an application specific object. // It is now retrievable easily in the event handler. MY_APP_OBJ myAppObj = (MY_APP_OBJ *) context; //Application related tasks } SUPC_BODVDDCallbackRegister(APP_SUPC_CallbackFunction, (uintptr_t)&myAppObj);
Remarks
Context value can be set to NULL is not required. To disable callback function, pass NULL for the callback parameter