-
Notifications
You must be signed in to change notification settings - Fork 746
Description
Answers checklist.
- I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
- I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
- I have searched the issue tracker for a similar issue and not found a similar issue.
General issue report
with this function, it writes data and then read data. in the write operation the R/W bit is 0, which is correct. But in the read phase, the R/W bit is still 0, which is wrong.
I found this bug, when use SCCB_Read in the procedure of configuring a camera.
I replace the i2c_master_transmit_receive with the code below and then I can get what I want.
// Write register address (this issues START + address with R/W=0)
esp_err_t ret = i2c_master_transmit(dev_handle, tx_buffer, 1, TIMEOUT_MS);
if (ret != ESP_OK) {
ESP_LOGE(TAG, "SCCB_Read addr phase failed addr:0x%02x, reg:0x%02x, ret:%d", slv_addr, reg, ret);
return 0;
}
// Read the register value (this issues a new START + address with R/W=1)
ret = i2c_master_receive(dev_handle, rx_buffer, 1, TIMEOUT_MS);