1.38.24.43 TCx_Compare8bitPeriodSet Function
C
/* x = TC instance number */
void TCx_Compare8bitPeriodSet( uint8_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
TCx_CompareInitialize() function must have been called first.
Parameters
Param | Description |
---|---|
period | new period value to set for timer |
Returns
None.
Example
uint8_t period = 0x500U;
TC0_CompareInitialize();
TC0_Compare8bitPeriodSet(period);
Remarks
The caller must know the number of significant bytes of timer. Period value is right-aligned.