1.7.19.23 QSPI_CALLBACK Typedef

C

typedef void (*QSPI_CALLBACK) (uintptr_t context);

Summary

Pointer to a Callback function. This is used in SPI mode only.

Description

This data type defines the required function signature for the QSPI 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.

Parameters

Param Description
context Value identifying the context of the application thatregistered the callback function

Returns

None.

Example

void APP_QSPITransferHandler(uintptr_t context)
{
    //Transfer was completed without error, do something else now.
}

QSPI0_CallbackRegister(&APP_SPITransferHandler, (uintptr_t)NULL);

Remarks

The context parameter contains the a handle to the client context, provided at the time the callback function was registered using the QSPIx_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.