1.40.23.15 TCx_Timer8bitCounterGet Function

C

/* x = TC instance number */
uint8_t TCx_Timer8bitCounterGet( void );

Summary

Reads the timer current count value.

Description

This function reads the timer count value.

Precondition

TCx_TimerInitialize() function must have been called first.

Parameters

None.

Returns

Timer's current count value

Example

uint8_t counter = 0;
TC0_TimerInitialize();
TC0_TimerStart();
counter = TC0_Timer8bitCounterGet();

Remarks

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