i2c_slave_transmit() function
Write bytes to internal ringbuffer of the I2C slave data. When the TX fifo empty, the ISR will fill the hardware FIFO with the internal ringbuffer's data.
Arguments
i2c_slave
I2C slave device handle that created by `i2c_new_slave_device`.
data
Buffer to write to slave fifo, can pickup by master. Can be freed after this function returns. Equal or larger than `size`.
size
In bytes, of `data` buffer.
xfer_timeout_ms
Wait timeout, in ms. Note: -1 means wait forever.
Return value
- ESP_OK: I2C slave transmit success. - ESP_ERR_INVALID_ARG: I2C slave transmit parameter invalid. - ESP_ERR_TIMEOUT: Operation timeout(larger than xfer_timeout_ms) because the device is busy or hardware crash. - ESP_ERR_NOT_SUPPORTED: This function should be work in fifo mode, but I2C_SLAVE_NONFIFO mode is configured
Notes
If you connect this slave device to some master device, the data transaction direction is from slave device to master device.