1.29.27.64 TCCx_PWM24bitPeriodSet Function
C
/* x = TCC instance number */ void TCCx_PWM24bitPeriodSet ( uint32_t period );
Summary
Sets the period value of a given TCC instance.
Description
This function writes the period value. Period value is shared between all the channels of TCC instance. When counter matches period 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 and TCCx_PWMStart functions must have been called first for the given channel.
Parameters
Param | Description |
---|---|
period | Period value. Counter increments till this value |
Returns
None.
Example
TCC0_PWMInitialize();
TCC0_PWMStart();
TCC0_PWM24bitPeriodSet(0x500ul);
Remarks
This function waits till sync operation is complete. TCC should be running to write to double buffered period register.