1.4.25.58 TCCx_PWM16bitDutySet Function

C

/* x = TCC instance number */
void TCCx_PWM16bitDutySet (TCCx_CHANNEL_NUM channel, uint16_t duty);

Summary

Sets the duty value of a given TCC channel.

Description

This function writes the compare value. Every channel of TCC instance has its own compare register. When counter matches compare value interrupt can be generated. This function writes to the double buffered register. Actual update happens on period match or zero match.

Precondition

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

Parameters

Param Description
channel TCC channel number
duty Compare value

Returns

None

Example

TCC0_PWMInitialize();
TCC0_PWM16bitDutySet(TCC0_CHANNEL0, 0x100U);

Remarks

None