i2c_master_cmd_begin() function
Send all the queued commands on the I2C bus, in master mode. The task will be blocked until all the commands have been sent out. The I2C port is protected by mutex, so this function is thread-safe. This function shall only be called in I2C master mode.
Arguments
cmd_handle
I2C commands list
ticks_to_wait
Maximum ticks to wait before issuing a timeout.
Return value
- ESP_OK Success - ESP_ERR_INVALID_ARG Parameter error - ESP_FAIL Sending command error, slave hasn't ACK the transfer. - ESP_ERR_INVALID_STATE I2C driver not installed or not in master mode. - ESP_ERR_TIMEOUT Operation timeout because the bus is busy.
i2c_master_cmd_begin() is called by 5 functions and calls 17 functions:
![]()
i2c_master_cmd_begin()
i2c_master_cmd_begin() reads 29 variables and writes 7 variables:
![]()
i2c_master_cmd_begin()