1.34.23.2 TCx_CHy_TimerCallbackRegister Function
C
/* x = TC instance number, y= channel number */ void TCx_CHy_TimerCallbackRegister ( TC_TIMER_CALLBACK callback, uintptr_t context );
Summary
Registers the function to be called from interrupt
Description
This function registers the callback function to be called from interrupt.
Precondition
TCx_CHy_TimerInitialize() 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_TIMER_STATUS status, uintptr_t context ); TC0_CH1_TimerInitialize(); TC0_CH1_TimerCallbackRegistert(TC_CallbackFn, NULL);
Remarks
Context value can be set to NULL if not required. To disable callback function, pass NULL for the callback parameter.