1.24.19.9 RTC_CALLBACK Typedef

C

typedef void (*RTC_CALLBACK)(uintptr_t context);

Summary

Defines the data type and function signature of the Real Time Clock Calendar callback function.

Description

This data type defines the function signature of the RTCC Real Time Clock Calendar Callback function. The RTCC peripheral will call back the client's function with this signature when the RTCC Alarm occurs.

The application should register a callback function whose signature (input arguments and return type) must match the signature of this function. The callback function should be registered by calling the RTCC_CallbackRegister() function. This should be done before setting the alarm.

Precondition

None.

Parameters

Param Description
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 execute in an interrupt context. Avoid calling blocking functions, performing computationally intensive operations or interrupt unsafe functions from the callback function.