1.31.16.26 TCx_Compare16bitCounterGet Function

C

/* x = TC instance number */
uint16_t TCx_Compare16bitCounterGet( void );

Summary

Reads the timer current count value.

Description

This function reads the timer count value.

Precondition

TCx_CompareInitialize() function must have been called first.

Parameters

None.

Returns

Timer's current count value.

Example

uint16_t counter = 0;
TC0_CompareInitialize();
TC0_CompareStart();
counter = TC0_Compare16bitCounterGet();

Remarks

The caller must know the number of significant bytes of timer. Period value is right-aligned.