1.32.18.24 PDECx_COUNTERCallbackRegister Function

C

void PDECx_COUNTERCallbackRegister ( PDEC_COUNTER_CALLBACK callback, uintptr_t context ) // x is instance of the peripheral and it is applicable only for devices having multiple instances of the peripheral.

Summary

Registers the function to be called from interrupt.

Description

This function registers the callback function to be called from interrupt

Precondition

PDECx_COUNTERInitialize must have been called first.

Parameters

Param Description
callback Callback function pointer
context Value provided back to the caller by the callback (usually a pointer to the caller's context for multi-instance clients)

Returns

None.

Example

void PDEC_CallbackFn(PDEC_COUNTER_STATUS status, uintptr_t context)
{
}

PDEC_COUNTERInitialize();
PDEC_COUNTERCallbackRegister(PDEC_CallbackFn, NULL);

Remarks

Context value can be set to NULL if not required. To disable callback function, pass NULL for the callback parameter.