Function esp_idf_hal::sys::i2c_master_cmd_begin
source · pub unsafe extern "C" fn i2c_master_cmd_begin(
i2c_num: u32,
cmd_handle: *mut c_void,
ticks_to_wait: u32,
) -> i32
Expand description
@brief 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.
@param i2c_num I2C port number @param cmd_handle I2C commands list @param ticks_to_wait Maximum ticks to wait before issuing a timeout.
@return - 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.