1.2.19.2 1.3.22.2 1.4.20.2 1.5.21.2 1.6.21.2 1.7.22.2 1.29.21.2 1.32.24.2 1.38.20.2 1.39.17.2 1.40.19.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.