1.7.26.28 TCCx_Compare24bitCounterGet Function

C

/* x = TCC instance number */
uint32_t TCCx_Compare24bitCounterGet( void );

Summary

Reads the timer current count value.

Description

This function reads the timer count value.

Precondition

TCCx_CompareInitialize() function must have been called first.

Parameters

None.

Returns

Timer's current count value.

Example

uint32_t counter = 0;
TCC0_CompareInitialize();
TCC0_CompareStart();
counter = TCC0_Compare24bitCounterGet();

Remarks

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