1.28.25.17 TCx_CHy_CompareASet Function

C

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

/* 16 bit counter */
void TCx_CHy_CompareASet ( uint16_t value )

/* 32 bit counter */
void TCx_CHy_CompareASet ( uint32_t value )

Summary

Sets the Compare-A value of the given timer channel in compare mode.

Description

This function sets the Compare-A value of the given timer channel, which decides the ON time the waveform generated in compare mode.

Precondition

TCx_CHy_TimerInitialize function must have been called first for the given channel to configure channel in compare mode.

Parameters

Param Description
value Compare-A value(type varies with the bit width of the counter)

Returns

None.

Example

TC0_CH1_CompareInitialize();
TC0_CH1_CompareASet(0x100U);

Remarks

This function is applicable only for compare mode.