1.27.14.12 QSPIx_CallbackRegister Function
C
// x - Instance of the QSPI peripheral void QSPIx_CallbackRegister ( const QSPIx_CALLBACK* callback, uintptr_t context );
Summary
Allows application to register callback with PLIB. This is used in SPI mode only.
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 QSPIx_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 applicationunchanged, 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_QSPITransferHandler(uintptr_t context)
{
//Transfer was completed without error, do something else now.
}
QSPI0_CallbackRegister(&APP_QSPITransferHandler, (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.