Jump to main content

##

# 2.42.4 EIC_CallbackRegister Function

## C

    void EIC_CallbackRegister (EIC_PIN pin, EIC_CALLBACK callback
    uintptr_t context);

## Summary

Registers the function to be called when an interrupt condition has been sensed on the pin.

## Description

This function registers the callback function to be called when an interrupt condition has been sensed on the pin. A unique callback function can be registered for each pin.

When an interrupt condition has been sensed on the pin, the library will call the registered callback function and will then clear the interrupt condition when the callback function exits.

## Precondition

EIC_Initialize() must have been called first for the associated instance.

## Parameters

Param | Description
--- | ---
pin | EIC Pin number
callback | callback function pointer. Setting this to NULL will disable the callback feature
context | An application defined context value that will be passed to the callback function

## Returns

None.

## Example

    // Refer to the description of the EIC_CALLBACK data type for details on API
    // usage.

## Remarks

Context value can be set to NULL, if not required.