1.37.17.73 TCCx_PWMPatternSet Function

C

/* x = TCC instance number */
void TCCx_PWMPatternSet(uint8_t pattern_enable, uint8_t pattern_output);

Summary

Sets the output PWM pattern

Description

This function sets the output value for PWM channels and overrides the output generated from PWM comparator.

Precondition

TCCx_PWMInitialize() and TCCx_PWMStart function must have been called first for the given instance.

Parameters

Param Description
pattern_enable bitmask of the PWM channels used to enable/disable pattern output
pattern_output PWM pattern output value 0: Low and 1 : High

Returns

None.

Example

TCC0_PWMInitialize();
TCC0_PWMStart();
TCC0_PWMPatternSet(0x77, 0x0); // Sets the PWM channels 0, 1, 2 outputs to Low.

Remarks

This function waits till sync operation is complete. TCC should be running to write to double buffered pattern register. This function is applicable only if pattern generator feature is supported by TCC.