esp-idf-v5.1 lp_core_i2c 读取问题
Posted: Wed Sep 06, 2023 9:02 am
Code: Select all
/**
* @brief Read from I2C device
*
* @note The LP I2C must have been initialized from the HP core using the lp_core_i2c_master_init() API
* before invoking this API.
*
* @param lp_i2c_num LP I2C port number
* @param device_addr I2C device address (7-bit)
* @param data_rd Buffer to hold data to be read
* @param size Size of data to be read in bytes
* @param timeout Operation timeout in CPU cycles. Set to -1 to wait forever.
*
* @return esp_err_t ESP_OK when successful
*
* @note the LP I2C does not support 10-bit I2C device addresses.
* @note the LP I2C port number is ignored at the moment.
*/
esp_err_t lp_core_i2c_master_read_from_device(i2c_port_t lp_i2c_num, uint16_t device_addr,
uint8_t *data_rs, size_t size,
int32_t ticks_to_wait);