1.3.22.39 RTC_Timer16Compare2HasMatched Function

C

bool RTC_Timer16Compare2HasMatched(void)

Summary

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

Description

This function returns true if the 16-bit Timer Compare 2 value has matched the counter. When operating in 16-bit Timer Counter mode, the RTC peripheral compares the counter value with compare values (Compare 2). This function will return true if the counter value has matched the Compare 2 value. The Compare 2 Value could have been configured via MHC or at run time by calling the RTC_Timer16Compare2Set() function. The RTC_Timer16Compare2ValueMatched() 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 2 Value and False otherwise.

Example

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

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

// Wait till the Compare 2 value has matched.
while(!RTC_Timer16Compare2HasMatched());

Remarks

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