Jump to main content

##

# 2.74.9 OCMPx_CallbackRegister Function

## C

    /* x = OCMP instance number */

    void OCMPx_CallbackRegister( OCMP_CALLBACK callback, uintptr_t context )

## Summary

Registers the function to be called from interrupt.

## Description

This function registers the callback function to be called from interrupt.

## Precondition

OCMPx_Initialize() function must have been called first.

## Parameters

Param | Description
--- | ---
callback | Pointer to the function to be called when value is reached. Use NULL to Unregister the compare callback
context | Pointer to user defined data to be used when the callback function is called. NULL can be passed in if no data needed.

## Returns

None

## Example

    OCMP_Callback(uintptr_t context);

    OCMP1_Initialize();
    OCMP1_Enable();
    OCMP1_CallbackRegister(OCMP_Callback, NULL);

## Remarks

None