1.24.21.4 SQIx_RegisterCallback Function

C

void SQIx_RegisterCallback(SQI_EVENT_HANDLER event_handler, uintptr_t context); // x - Instance of the SQI peripheral

Summary

Sets the pointer to the function (and it's context) to be called when the operation is complete.

Description

This function sets the pointer to a client function to be called back when the SQI Transfer is completed. It also passes a context value that is passed into the function when it is called. This function is available only in interrupt mode of operation.

Precondition

None.

Parameters

Param Description
event_handler A pointer to a function with a calling signature definedby the SQI_EVENT_HANDLER data type.
context A value (usually a pointer) passed (unused) into the functionidentified by the callback parameter.

Returns

None.

Example

static void APP_EventHandler(uintptr_t context)
{
    // Complete operations;
}

SQI1_RegisterCallback(APP_EventHandler, (uintptr_t)NULL);

Remarks

The context value may be set to NULL if it is not required. Note that the value of NULL will still be passed to the callback function.

To disable the callback function, pass a NULL for the callback parameter. See the APP_EventHandler type definition for additional information.