Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I believe this fixes all these ESP32-S2 I2C issues:
As suggested by @tannewt in #5680 (comment), this PR provides a new
common_hal_busio_i2c_write_read()
operation.shared-bindings/busio/I2C.c
no longer callswrite
andread
separately itself, but calls the combined routine.common-hal
I2C routines use the new ESP-IDFi2c_master_device...()
wrapper routines, which set things up properly for I2C transactions.common-hal/busio/I2C.c
simply calls the oldwrite
andread
routines, and do not send a stop bit on combined write/read operations (as was already done previously).IS31FL3741.c
is revised to use the new API.adafruit_bus_device
now puts a0x
prefix on the hex address it prints if it can't find the device. The Python library already does this.Tested on all ports. Tested with these I2C devices, except where noted: BNO055, DS3231, LC709203F, MSA301 (all at once, in a STEMMA/QT string).
atmel-samd
SAMD21: Metro M0: due to limited RAM, devices tested separately, and not BNO055atmel-samd
SAMD51: Metro M4broadcom
: Pi Zero 2Wcxd56
: Spresenseespressif
: Metro ESP32-S2mimxrt10xx
: Teensy4.1nrf
: Feather nRF52840. IS31FL3741 (LED glasses) also tested on this board.raspberrypi
: Feather RP2040stm
: Feather F405I did not yet change
bitbangio
to do anything combined. It could be fixed for consistency later, but it's not necessary right now.