Function esp_idf_svc::hal::sys::i2c_slave_receive
source ยท pub unsafe extern "C" fn i2c_slave_receive(
i2c_slave: *mut i2c_slave_dev_t,
data: *mut u8,
buffer_size: usize,
) -> i32
Expand description
@brief Read bytes from I2C internal buffer. Start a job to receive I2C data.
@note 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()
.
@param[in] i2c_slave I2C slave device handle that created by i2c_new_slave_device
.
@param[out] data Buffer to store data from I2C fifo. Should be valid until on_recv_done
is triggered.
@param[in] buffer_size Buffer size of data that provided by users.
@return
- 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