Merge pull request #5656 from dhalbert/rp2040-i2c-zero-write-bitbang-timeout

Use a longer clock stretching timeout for RP2040 zero-byte I2C writes
This commit is contained in:
Dan Halbert 2021-12-04 19:40:48 -05:00 committed by GitHub
commit 4de6c7cf6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -109,8 +109,11 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self,
// set up as GPIO by the bitbangio.I2C object. // set up as GPIO by the bitbangio.I2C object.
// //
// Sets pins to open drain, high, and input. // Sets pins to open drain, high, and input.
//
// Do not use the default supplied clock stretching timeout here.
// It is too short for some devices. Use the busio timeout instead.
shared_module_bitbangio_i2c_construct(&self->bitbangio_i2c, scl, sda, shared_module_bitbangio_i2c_construct(&self->bitbangio_i2c, scl, sda,
frequency, timeout); frequency, BUS_TIMEOUT_US);
self->baudrate = i2c_init(self->peripheral, frequency); self->baudrate = i2c_init(self->peripheral, frequency);