1.26.19.13 PMERRLOC_CallbackRegister Function
C
void PMERRLOC_CallbackRegister( PMERRLOC_CALLBACK callback, uintptr_t context )
Summary
Sets the pointer to the function (and it's context) to be called when the given PMERRLOC's interrupt occurred.
Description
This function sets the pointer to a client function to be called "back" when the given PMERRLOC's interrupt occurred. It also passes a context value (usually a pointer to a context structure) that is passed into the function when it is called. This function is available only in interrupt mode of operation.
Precondition
PMERRLOC_Initialize must have been called for the associated PMERRLOC instance.
Parameters
Param | Description |
---|---|
callback | A pointer to a function with a calling signature defined by thePMERRLOC_CALLBACK data type |
context | A value (usually a pointer) passed (unused) into the functionidentified by the callback parameter |
Returns
None.
Example
void pmerrlocCallback( uintptr_t context, uint32_t interruptStatus )
{
}
PMERRLOC_CallbackRegister(pmerrlocCallback, (uintptr_t)NULL);
Remarks
The context parameter is ignored if the pointer passed is NULL. To disable the callback function, pass a NULL for the callback parameter. See the PMERRLOC_CALLBACK type definition for additional information.