i2c_master_read() function
Queue a "read (multiple) bytes" command to the commands list. Multiple bytes will be read on the I2C bus. This function shall only be called in I2C master mode. Call `i2c_master_cmd_begin()` to send all queued commands
Arguments
cmd_handle
I2C commands list
data
Pointer where the received bytes will the stored. This buffer shall remain **valid** until the transaction is finished.
data_len
Size, in bytes, of the `data` buffer
Return value
- ESP_OK Success - ESP_ERR_INVALID_ARG Parameter error - ESP_ERR_NO_MEM The static buffer used to create `cmd_handler` is too small - ESP_FAIL No more memory left on the heap
i2c_master_read() is called by 3 functions and calls 4 functions:
![]()
i2c_master_read()
i2c_master_read() reads 10 variables:
![]()
i2c_master_read()