i2c_slave_read_buffer() function
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.
Arguments
data
Buffer to fill with ringbuffer's bytes
max_size
Maximum bytes to read
ticks_to_wait
Maximum waiting ticks
Return value
- ESP_FAIL(-1) Parameter error - Others(>=0) The number of data bytes read from I2C slave buffer.
Notes
This function shall only be called in I2C slave mode.
i2c_slave_read_buffer() calls 10 functions:
![]()
i2c_slave_read_buffer()
i2c_slave_read_buffer() reads 16 variables:
![]()
i2c_slave_read_buffer()