2.127.13 TSENS_CallbackRegister Function / Typedef

C

void TSENS_CallbackRegister(TSENS_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

TSENS_Initialize() function must have been called first for the associated instance

Parameters

ParamDescription
callbackcallback function pointer
contextAllows the caller to provide a context value (usually a pointer to the callers context for multi-instance clients)

Returns

None.

Example

void TSENS_TemperatureCallback( TSENS_STATUS status, uintptr_t context )
{
    int32_t result = 0;
    result = TSENS_ConversionResultGet();
}
TSENS_CallbackRegister(TSENS_TemperatureCallback, uintptr_t(NULL));

Remarks

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