Function esp_idf_svc::hal::sys::i2c_slave_read_buffer

source ·
pub unsafe extern "C" fn i2c_slave_read_buffer(
    i2c_num: u32,
    data: *mut u8,
    max_size: usize,
    ticks_to_wait: u32,
) -> i32
Expand description

@brief Read bytes from I2C internal buffer. When the I2C bus receives data, the ISR will copy them from the hardware RX FIFO to the internal ringbuffer. Calling this function will then copy bytes from the internal ringbuffer to the data user buffer. @note This function shall only be called in I2C slave mode.

@param i2c_num I2C port number @param data Buffer to fill with ringbuffer’s bytes @param max_size Maximum bytes to read @param ticks_to_wait Maximum waiting ticks

@return - ESP_FAIL(-1) Parameter error - Others(>=0) The number of data bytes read from I2C slave buffer.