i2c_master_write() function
Queue a "write (multiple) bytes" command to the commands list. 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
Bytes to send. This buffer shall remain **valid** until the transaction is finished. If the PSRAM is enabled and `intr_flag` is set to `ESP_INTR_FLAG_IRAM`, `data` should be allocated from internal RAM.
data_len
Length, 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
![]()
ESP_GOTO_ON_ERROR(i2c_master_write(cmd_link, cmds + (sizeof(cmds) - cmds_size), cmds_size, true), err, TAG, "write LCD cmd failed");![]()
ESP_GOTO_ON_ERROR(i2c_master_write(cmd_link, cmds + (sizeof(cmds) - cmds_size), cmds_size, true), err, TAG, "write LCD cmd failed");
i2c_master_write() is called by 4 functions and calls 4 functions:
![]()
i2c_master_write()
i2c_master_write() reads 6 variables:
![]()
i2c_master_write()