Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

dpgeorge
Copy link
Member

@dpgeorge dpgeorge commented Jun 1, 2022

This is an alternative to #8682 that just improves the I2C transfer function for ports that need it, eg esp32.

This addresses #7134, and also #8135 (even though that is now fixed in a newer IDF version).

@dpgeorge dpgeorge added port-esp32 extmod Relates to extmod/ directory in source labels Jun 1, 2022
dpgeorge added 2 commits June 1, 2022 13:20
This option is useful for ports where it's more efficient to do a full I2C
transfer in one go.

Signed-off-by: Damien George <[email protected]>
I2C transfers are much more efficient if they are combined, instead of
doing separate writes and reads.

Fixes issue micropython#7134.

Signed-off-by: Damien George <[email protected]>
@dpgeorge
Copy link
Member Author

dpgeorge commented Jun 2, 2022

I tested this on an ESP32S2 with IDF 4.4.1, doing a readfrom_mem() with an 8 byte read. This PR improves the speed of that read from around 4800us down to 680us. That's about a 7x improvement.

@dpgeorge dpgeorge merged commit 6bda80d into micropython:master Jun 2, 2022
@dpgeorge dpgeorge deleted the extmod-machine-i2c-extended-write-and-read-v2 branch June 2, 2022 02:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extmod Relates to extmod/ directory in source port-esp32
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant