1.1.9.10 QMSPIx_CallbackRegister Function

C

// x - Instance of the QMSPI peripheral

void QMSPIx_CallbackRegister
(
const QMSPIx_CALLBACK* callback,
uintptr_t context
);

Summary

Allows application to register callback with PLIB.

Description

This function allows application to register a callback function for the PLIB to call back when requested data transfer operation has completed.

The callback should be registered before the client performs transfer operation. At any point if application wants to stop the callback, it can call this function with "callback" value as NULL.

Precondition

The QMSPIx_Initialize function must have been called.

Parameters

Param Description
callback Pointer to the callback function implemented by the user
context The value of parameter will be passed back to the application unchanged, when the callback function is called. It can be used to identify any application specific value that identifies the instance of the client module (for example, it may be a pointer to the client module's state structure).

Returns

None.

Example

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

QMSPI0_CallbackRegister(&APP_QMSPITransferHandler, (uintptr_t)NULL);

Remarks

If the client does not want to be notified when the queued operation has completed, it does not need to register a callback.