i2c_slave_receive() function
Read bytes from I2C internal buffer. Start a job to receive I2C data.
Arguments
i2c_slave
I2C slave device handle that created by `i2c_new_slave_device`.
data
Buffer to store data from I2C fifo. Should be valid until `on_recv_done` is triggered.
buffer_size
Buffer size of data that provided by users.
Return value
- ESP_OK: I2C slave receive success. - ESP_ERR_INVALID_ARG: I2C slave receive parameter invalid. - ESP_ERR_NOT_SUPPORTED: This function should be work in fifo mode, but I2C_SLAVE_NONFIFO mode is configured
Notes
This function is non-blocking, it initiates a new receive job and then returns. User should check the received data from the `on_recv_done` callback that registered by `i2c_slave_register_event_callbacks()`.