1.29.21.41 RTC_Timer16Compare3HasMatched Function

C

bool RTC_Timer16Compare3HasMatched(void)

Summary

Returns true if the 16-bit Timer Compare 3 value has matched the counter.

Description

This function returns true if the 16-bit Timer Compare 3 value has matched the counter. When operating in 16-bit Timer Counter mode, the RTC peripheral compares the counter value with compare values (Compare 3). This function will return true if the counter value has matched the Compare 3 value. The Compare 3 Value could have been configured via MHC or at run time by calling the RTC_Timer16Compare3Set() function. The RTC_Timer16Compare3ValueMatched() function allows the application to poll for the compare value match.

Precondition

RTC_Initialize, RTC_Timer16Start must have been called for the associated RTC instance. The RTC value should have been configured for 16-bit Timer Counter Mode.

Parameters

None.

Returns

True, if Counter has matched Compare 3 Value and False otherwise.

Example

RTC_Initialize();
RTC_Timer16CounterSet(0);
RTC_Timer16PeriodSet(0xFFF);

// Calling the RTC_Timer16Compare3Set() function will override the
RTC_Timer16Compare3Set(0x3F);
RTC_Timer16Start();

// Wait till the Compare 3 value has matched.
while(!RTC_Timer16Compare3HasMatched());

Remarks

This API is available for devices that have more than three compare register in 16-bit mode.