1.1.3.22 ICM_CallbackRegister

void ICM_CallbackRegister(ICM_CALLBACK callback, uintptr_t context)

Summary

Sets the pointer to the function (and it's context) to be called when the given ICM's interrupt events occur.

Description

This function sets the pointer to a client function to be called "back" when the given ICM's interrupt events occur. It also passes a context value (usually a pointer to a context structure) that is passed into the function when it is called. The specified callback function will be called from the peripheral interrupt context.

Preconditions

ICM_Initialize must have been called for the associated ICM instance.

Parameters

  • callback - A pointer to a function with a calling signature defined by the ICM_CALLBACK data type. Setting this to NULL disables the callback feature.

  • contextHandle - A value (usually a pointer) passed (unused) into the function identified by the callback parameter.

Returns

None

Example

    // Refer to the description of the ICM_CALLBACK data type for
    // example usage.