1.2.5.3 SPW_CALLBACK

typedef void (*SPW_CALLBACK) (SPW_INT_MASK irqStatus, uintptr_t contextHandle)

Summary

SPW Callback Function Pointer.

Description

This data type defines the required function signature for the SPW callback function. Application must register a pointer to a callback function whose function signature (parameter and return value types) match the types specified by this function pointer in order to receive callback from the PLIB. The parameters and return values are described here and a partial example implementation is provided.

Parameters

  • irqStatus - The IRQ interrupt type value.

  • contextHandle - Value identifying the context of the application that registered the callback function

Remarks

The context parameter contains the a handle to the client context, provided at the time the callback function was registered using the CallbackRegister function. This context handle value is passed back to the client as the "context" parameter. It can be any value (such as a pointer to the client's data) necessary to identify the client context or instance of the client that made the data transfer request.

The callback function executes in the PLIB's interrupt context. It is recommended of the application to not perform process intensive or blocking operations with in this function.

Example

void APP_SPW_Handler(uintptr_t context)
{
    //Fixable error has occurred
}

SPW_CallbackRegister(&APP_SPW_Handler, (uintptr_t)NULL);