1.39.17.2 RTC_PeriodicIntervalHasCompleted Function
C
bool RTC_PeriodicIntervalHasCompleted (RTC_PERIODIC_INT_MASK mask)
Summary
Check if the configured periodic interval has expired.
Description
This function will check if the configured periodic interval expired. The RTC module can be configured to generate notification at periodic intervals. This function provides a polling method to check if a periodic interval is complete. The interval is configured via MHC.
Precondition
RTC_Initialize must have been called for the associated RTC instance. The Enable Periodic Interval Notification Option in MHC should be set to the desired periodic interval.
Parameters
Param | Description |
---|---|
mask | Specifies the mask for the needed period interval |
Returns
True if Periodic interval has completed, False otherwise.
Example
// Wait till the configured periodic interval has expired.
bool periodIntervalCompleted = false;
RTC_Initialize();
RTC_Timer32CounterSet(0);
RTC_Timer32Start();
do
{
periodIntervalCompleted = RTC_PeriodicIntervalHasCompleted(RTC_PER0_MASK);
} while(!periodIntervalCompleted);
Remarks
The application can alternatively register a callback function by calling the RTC_RTCCCallbackRegister() function to receive asynchronous notification.