1.34.23.23 TCx_CHy_CaptureCallbackRegister Function

C

/* x = TC instance number, y = channel number */
void TCx_CHy_CaptureCallbackRegister ( TC_CAPTURE_CALLBACK callback, uintptr_t context )

Summary

Registers the function to be called from the capture-event.

Description

This function registers the callback function to be called from the interrupt when the selected capture event occurs.

Precondition

TCx_CHy_CaptureInitialize() must have been called first.

Parameters

Param Description
callback Callback function pointer.
context Allows the caller to provide a context value (usually a pointer to the callers context for multi-instance clients)

Returns

None.

Example

void TC_CallbackFn(TC_CAPTURE_STATUS status, uintptr_t context);

TC0_CH1_CaptureInitialize();
TC0_CH1_CaptureCallbackRegister(TC_CallbackFn, NULL);

Remarks

Context value can be set to NULL if not required. To disable callback function, pass NULL for the callback parameter.