1.41.21.5 TCx_CHy_TimerPeriodGet Function

C

/* x = TC instance number, y= channel number */

/* 16 bit timer */
uint16_t TCx_CHy_TimerPeriodGet ( void );

/* 32 bit timer */
uint32_t TCx_CHy_TimerPeriodGet ( void );

Summary

Reads the period value of given timer channel

Description

This function reads the value of period of given timer channel.

Precondition

TCx_CHy_TimerInitialize function must have been called first for the given channel.

Parameters

None

Returns

The timer's period value. Type of the return value is different based on the timer bit width.

Example

16 bit timer

uint16_t period;

TC0_CH1_TimerInitialize();
period = TC0_CH1_TimerPeriodGet();

32 bit timer

uint32_t period;

TC0_CH1_TimerInitialize();
period = TC0_CH1_TimerPeriodGet();

Remarks

None