1.34.23.4 TCx_CHy_TimerPeriodSet Function

C

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

/* 16 bit timer */
void TCx_CHy_TimerPeriodSet ( uint16_t period );

/* 32 bit timer */
void TCx_CHy_TimerPeriodSet ( uint32_t period );

Summary

Sets the period value of a given timer channel.

Description

This function writes the period value. When timer counter matches period value, counter is reset and interrupt can be generated.

Precondition

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

Parameters

Param Description
Period Period value of timer which decides the timer delay (type is based on the timer bit width)

Returns

None.

Example

TC0_CH1_TimerInitialize();
TC0_CH1_TimerPeriodSet(0x500U);

Remarks

None