1.37.15.12 RTC_Timer32Start Function

C

void RTC_Timer32Start ( void )

Summary

Starts the 32-bit timer.

Description

This function starts the 32-bit timer. The timer will start counting up from the value that was set using the RTC_Timer32CounterSet() function. The timer will count at a rate configured by the input clock and the input prescalar.

The timer can be configured to count up till a specific non-zero value. This value is specified using the RTC_Timer32CompareSet() function. Setting a non-zero will cause the timer counter to operate as timer. The counter will count up to the period value and then reset and start counting again. This causes a period expiry event. Timer type operations are preferred to implement a delay or obtain periodic notification.

Setting the period to 0 will result in a counter type operation. In this mode, starting the timer will cause the counter to count upto 0xFFFFFFFF and then overflow to 0 and continue counting. This causes an overflow event. A counter can be used to count in timer input clock units. This is useful when needed to perform temporal measurements.

The counter can be stopped by calling the RTC_Timer32Stop function. Calling the RTC_Timer32Start() will again start the counting from the current counter value.

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. The RTC_Timer32CompareSet and RTC_Timer32CounterSet function should have been called to set the desired period and starting count.

Parameters

None.

Returns

None.

Example

RTC_Initialize();

// Operate as a timer by setting a non-zero period.
RTC_Timer32CompareSet(0x3000);
RTC_Timer32CounterSet(0);
RTC_Timer32Start();

// Wait till the period has expired.
while(RTC_Timer32CompareHasMatched());

// Refer to the description of the RTC_Timer32CounterHasOverflowed()
// function for example of counter mode operation.

Remarks

None.