1.2.19.11 RTC_Timer32CounterGet Function

C

uint32_t RTC_Timer32CounterGet ( void )

Summary

Get the current 32-bit counter value.

Description

This function returns the current 32-bit count value. This function can be used to retrieve the counter value at the end of a time measurement.

Precondition

RTC_Initialize 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

uint32_t returns the current 32 bit counter value.

Example

// The following code example stops the counter when the counter value
// has reached 0xFFF.

RTC_Initialize();
RTC_Timer32CompareSet(0);
RTC_Timer32CounterSet(0);
RTC_Timer32Start();
while(RTC_Timer32CounterGet() < 0xFFF);

// Stop the counter.
RTC_Timer32Stop();

Remarks

None.