1.14.14.7 RTCC_CallbackRegister Function

C

void RTCC_CallbackRegister(RTC_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

RTCC_Initialize must have been called.

Parameters

Param Description
callback Function of type RTC_CALLBACK. This will be called from the interrupt service routine for RTCC.
context Allows the caller to provide a context value (usually a pointer to the callers context for multi-instance clients).

Returns

None.

Example

void RTC_Callback( uintptr_t context)
{
    // Code to be executed in the RTCC callback
}

RTCC_CallbackRegister(RTC_Callback, (uintptr_t) NULL);

Remarks

The callback function will be executed in an interrupt context. Avoid calling blocking functions, performing computationally intensive operations or interrupt unsafe functions from the callback function.