1.10.22.2 TMRx_CallbackRegister Function
C
/* x = TMR instance number */
void TMRx_CallbackRegister(TMR_CALLBACK callback_fn, uintptr_t context);
Summary
Sets the callback_fn function for an match.
Description
This function sets the callback_fn function that will be called when the TMR match is reached.
Precondition
TMRx_Initialize() function must have been called first.
Parameters
Param | Description |
---|---|
callback_fn | a pointer to the function to be called when match is reached |
context | Application context |
Returns
None.
Example
void TMR_Callback_Fn((uint32_t status, uintptr_t context);
TMR2_Initialize();
TMR2_CallbackRegister(TMR_Callback_Fn, NULL);
Remarks
Context value can be set to NULL if not required. To disable callback function, pass NULL for the callback parameter.