I2C master device handle that created by `i2c_master_bus_add_device`.
write_buffer
Data bytes to send on the I2C bus.
write_size
Size, in bytes, of the write buffer.
read_buffer
Data bytes received from i2c bus.
read_size
Size, in bytes, of the read buffer.
xfer_timeout_ms
Wait timeout, in ms. Note: -1 means wait forever.
Return value
- ESP_OK: I2C master transmit-receive success - ESP_ERR_INVALID_ARG: I2C master transmit parameter invalid. - ESP_ERR_TIMEOUT: Operation timeout(larger than xfer_timeout_ms) because the bus is busy or hardware crash.
Notes
If a callback was registered with `i2c_master_register_event_callbacks`, the transaction will be asynchronous, and thus, this function will return directly, without blocking. You will get finish information from callback. Besides, data buffer should always be completely prepared when callback is registered, otherwise, the data will get corrupt.
Transmit multiple buffers of data over an I2C bus. This function transmits multiple buffers of data over an I2C bus using the specified I2C master device handle. It takes in an array of buffer information structures along with the size of the array and a transfer timeout value in milliseconds.