[][src]Function esp_idf_sys::i2c_driver_install

pub unsafe extern "C" fn i2c_driver_install(
    i2c_num: i2c_port_t,
    mode: i2c_mode_t,
    slv_rx_buf_len: usize,
    slv_tx_buf_len: usize,
    intr_alloc_flags: c_int
) -> esp_err_t

@brief I2C driver install

@param i2c_num I2C port number @param mode I2C mode( master or slave ) @param slv_rx_buf_len receiving buffer size for slave mode @note Only slave mode will use this value, driver will ignore this value in master mode. @param slv_tx_buf_len sending buffer size for slave mode @note Only slave mode will use this value, driver will ignore this value in master mode. @param intr_alloc_flags Flags used to allocate the interrupt. One or multiple (ORred) ESP_INTR_FLAG_* values. See esp_intr_alloc.h for more info. @note In master mode, if the cache is likely to be disabled(such as write flash) and the slave is time-sensitive, ESP_INTR_FLAG_IRAM is suggested to be used. In this case, please use the memory allocated from internal RAM in i2c read and write function, because we can not access the psram(if psram is enabled) in interrupt handle function when cache is disabled.

@return - ESP_OK Success - ESP_ERR_INVALID_ARG Parameter error - ESP_FAIL Driver install error