1.1.11.46 I2C_SMB_HOST_CALLBACK Typedef

C

/* I2C SMBUS Host mode */
typedef void (*I2C_SMB_HOST_CALLBACK) (I2C_SMB_HOST_TRANSFER_EVENT event, uintptr_t contextHandle);

Summary

Defines the data type and function signature for the I2C SMBUS host mode callback function.

Description

This data type defines the function signature for the I2C SMBUS host mode callback function. The I2C peripheral will call back the client's function with this signature to report I2C SMBUS host mode events.

Precondition

I2CSMBx_Initialize must have been called for the given I2C peripheral instance and I2CSMBx_HostCallbackRegister must have been called to set the function to be called. The callback register function should have been called before any transfer is initiated by the I2C master.

Parameters

Param Description
event Indicates the data transfer event for which the callback function hasbeen called.
contextHandle Allows the caller to provide a context value (usually a pointer to the callers context for multi-instance clients).

Returns

None

Example

void I2CSMB0_Callback(I2C_SMB_HOST_TRANSFER_EVENT event, uintptr_t context)
{
    // Handle callback
}

// Register Callback function which is defined above
I2CSMB0_HostCallbackRegister(I2CSMB0_Callback, (uintptr_t)NULL);

Remarks

None