1.1.2.4.5 DRV_I2C_TransferSetup Function

C

bool DRV_I2C_TransferSetup ( DRV_HANDLE handle, DRV_I2C_TRANSFER_SETUP* setup )

Summary

Sets the dynamic transfer setup of the driver.

Description

This function should be used to update any of the DRV_I2C_TRANSFER_SETUP parameters for the selected client of the driver dynamically. It is mainly helpful for multi client scenario where different clients need different setup like clock speed. The DRV_I2C_TransferSetup function must be called before submitting any I2C driver read/write requests.

Preconditions

DRV_I2C_Open must have been called to obtain a valid opened device handle.

In case of asynchronous driver, all transfer requests from the queue must have been processed.

Parameters

ParamDescription
handleA valid open-instance handle, returned from the driver's open routine
setupPointer to the structure containing the new configuration settings

Returns

None.

Example

// myI2CHandle is the handle returned by the DRV_I2C_Open function.
DRV_I2C_TRANSFER_SETUP setup;

setup.clockSpeed = 400000;

DRV_I2C_TransferSetup ( myI2CHandle, &setup );

Remarks

None.