1.24.14.5 OCMPx_CompareValueSet Function

C

/* x = OCMP instance number */

void OCMPx_CompareValueSet (uint32_t value)

Summary

Configures the compare register. Based on OC32 bit, compare value will be 16-bit or 32-bit. Refer the generated header file for the exact function signature.

Description

This function writes the compare value. When timer counter matches compare value, output pin level changes as per the configured output compare mode.

Precondition

OCMPx_Initialize() function must have been called first.

Parameters

Param Description
value compare value

Returns

void

Example

OCMP1_Initialize();
OCMP1_Enable();
OCMP1_CompareValueSet(500);

Remarks

This function is not applicable for PWM mode. Based on OC32 bit, compare value will be 16-bit or 32-bit. Refer the generated header file for the exact function signature.