Skip to main content

i2c_master_execute_defined_operations

Function i2c_master_execute_defined_operations 

Source
pub unsafe extern "C" fn i2c_master_execute_defined_operations(
    i2c_dev: *mut i2c_master_dev_t,
    i2c_operation: *mut i2c_operation_job_t,
    operation_list_num: usize,
    xfer_timeout_ms: i32,
) -> i32
Expand description

@brief Execute a series of pre-defined I2C operations.

This function processes a list of I2C operations, such as start, write, read, and stop, according to the user-defined i2c_operation_job_t array. It performs these operations sequentially on the specified I2C master device.

@param[in] i2c_dev Handle to the I2C master device. @param[in] i2c_operation Pointer to an array of user-defined I2C operation jobs. Each job specifies a command and associated parameters. @param[in] operation_list_num The number of operations in the i2c_operation array. @param[in] xfer_timeout_ms Timeout for the transaction, in milliseconds.

@return

  • ESP_OK: Transaction completed successfully.
  • ESP_ERR_INVALID_ARG: One or more arguments are invalid.
  • ESP_ERR_TIMEOUT: Transaction timed out.
  • ESP_FAIL: Other error during transaction.

@note The ack_value field in the READ operation must be set to I2C_NACK_VAL if the next operation is a STOP command.