Jump to main content

##

# 2.99.11 RTC_Timer32CompareHasMatched Function

## C

    bool RTC_Timer32CompareHasMatched ( void )

## Summary

Check for 32-bit Timer Compare match

## Description

This function returns true if the counter value has matched the configured 32-bit compare value.

## Precondition

RTC_Initialize, RTC_Timer32Start and RTC_Timer32CompareSet must have been called for the associated RTC instance. The RTC peripheral should have been configured in 32-bit Timer Counter mode.

## Parameters

None.

## Returns

True, Compare match has occurred and False otherwise.

## Example

    bool compareHasMatched = false;
    RTC_Initialize();
    RTC_Timer32CompareSet(0x3000);
    RTC_Timer32CounterSet(0);
    RTC_Timer32Start();

    // Wait until compare match
    while(!RTC_Timer32CompareHasMatched();

## Remarks

This API is available for devices that have only one compare register in 32-bit mode.