1.1.1.3 CCT_CapturexCallbackRegister Function

C

/* x = Capture channel number */

void CCT_CapturexCallbackRegister( CCT_CALLBACK callback, uintptr_t context )

Summary

Allows application to register a callback with for the CCT capture channel

Description

This function sets the pointer to a client/application function to be called "back" when the capture edge is received and the free running counter value is copied to the corresponding capture channel register. 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. The callback should be registered before starting the free running timer.

Precondition

CCT_Initialize() function must have been called first.

Parameters

Param Description
callback A pointer to a function with a calling signature defined by the CCT_CALLBACK data type. Setting this to NULL disables the callback feature.
context A value (usually a pointer) which is passed (unused) into the function identified by the callback parameter

Returns

None

Example

void cct_capture_callback(uintptr_t context)
{
    /* Handle capture event */
}
CCT_Capture0CallbackRegister(cct_capture_callback, 0);

Remarks

None