1.16.20.2 TMR1_CallbackRegister Function

C

void TMR1_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

TMR1_Initialize() function must have been called first.

Parameters

Param Description
callback_fn a pointer to the function to be called when match is reached. Use NULL to Un Register the match callback_fn
context a pointer to user defined data to be used when the callback_fn function is called. NULL can be passed in if no data needed

Returns

None.

Example

void TMR1_Callback_Fn(uintptr_t context);

TMR1_Initialize();
TMR1_CallbackRegister(TMR1_Callback_Fn, NULL);

Remarks

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