1.10.15.5 1.11.16.5 1.12.16.5 1.13.15.5 1.16.12.5 1.17.12.5 1.18.12.5 1.19.12.5 1.20.12.5 1.21.13.5 1.22.17.5 1.23.16.5 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.