8000 esp32: make I2C more efficient by using write-then-read transfers by dpgeorge · Pull Request #8718 · micropython/micropython · GitHub
[go: up one dir, main page]

Skip to content

esp32: make I2C more efficient by using write-then-read transfers #8718

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 <damien@micropython.org>
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 <damien@micropython.org>
@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
0