1.29.27.27 TCCx_Compare16bitPeriodSet Function

C

/* x = TCC instance number */
void TCCx_Compare16bitPeriodSet( uint16_t period );

Summary

Sets the period value of a given timer.

Description

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

Precondition

TCCx_CompareInitialize() function must have been called first.

Parameters

Param Description
period new period value to set for timer

Returns

None.

Example

uint16_t period = 0x500;
TCC0_CompareInitialize();
TCC0_Compare16bitPeriodSet(period);

Remarks

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