1.2.19.30 1.3.22.30 1.4.20.30 1.5.21.30 1.6.21.30 1.7.22.30 1.29.21.30 1.30.15.22 1.31.15.22 1.32.24.30 1.33.15.22 1.37.15.22 1.38.20.30 1.39.17.30 1.40.19.30 RTC_Timer16CounterHasOverflowed Function

C

bool RTC_Timer16CounterHasOverflowed ( void )

Summary

Checks if the 16-bit counter has overflowed

Description

This function returns true if the counter value has matched the configured 16-bit timer period. The counter will be reset and start counting again.

The API can be used to poll period completion when using the timer counter as a timer. Calling the function will clear the internal period match flags if these flags were set at the time of calling the function.

Precondition

RTC_Initialize, RTC_Timer16Start and RTC_Timer16PeriodSet must have been called for the associated RTC instance. The RTC peripheral should have been configured in 16-bit Timer Counter mode.

Parameters

None.

Returns

True, if counter has overflowed, False otherwise.

Example

bool counterOverflowed = false;
RTC_Initialize();
RTC_Timer16PeriodSet(0x3000);
RTC_Timer16CounterSet(0);
RTC_Timer16Start();
do
{
    counterOverflowed = RTC_Timer16CounterHasOverflowed();
}

Remarks

None.