i2c_transfer

The interface has the following parameters.
  • Synopsis:
    int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
  • Description: The interface is used to execute a single or combined I2C message.
  • Parameter:
    • adap: The handle to the I2C bus.
    • msgs: The parameter includes one or more than one messages to execute before the flag of "STOP" is issued to terminate the operation; Each message begins with a flag of "START".
    • num: The total number of messages to be executed.
  • Return:
    • Success: The total number of messages which are executed successfully.
    • Failure: Error code.