1.14.2.22 1.15.2.22 CCPx_Compare32bitPeriodValueSet Function
C
/* x = CCP instance number */
void CCPx_Compare32bitPeriodValueSet( uint32_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
CCPx_CompareInitialize() function must have been called first.
Parameters
Param | Description |
---|---|
period | new period value to set for timer |
Returns
None.
Example
uint32_t period = 0x500;
CCP1_CompareInitialize();
CCP1_Compare32bitPeriodValueSet(period);
Remarks
The caller must know the number of significant bytes of timer. Period value is right-aligned.