8000 esp32: Add support for hardware I2C. by dpgeorge · Pull Request #4914 · micropython/micropython · GitHub
[go: up one dir, main page]

Skip to content

esp32: Add support for hardware I2C. #4914

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

Merged
merged 1 commit into from
Jul 19, 2019

Conversation

dpgeorge
Copy link
Member

This PR adds support for hardware I2C on the esp32. Sample usage:

i2c = machine.I2C(0, freq=1000000) # uses default pins
i2c_1 = machine.I2C(1, scl=machine.Pin(4), sda=machine.Pin(5))
i2c.scan()

Only basic testing of this code has been done so far, but it seems to work.

@dpgeorge dpgeorge merged commit a293347 into micropython:master Jul 19, 2019
@dpgeorge
Copy link
Member Author

I did further testing of this PR and fixed a bug with the I2C driver initialisation, added some docs to the quickref, and merged it.

@dpgeorge dpgeorge deleted the esp32-hw-i2c branch July 19, 2019 06:51
Copy link

Aren't the default i2c pins for the ESP32 SCL = GPIO22 and SDA = GPIO21?

@dpgeorge
Copy link
Member Author
dpgeorge commented Aug 7, 2019

I don't think there are any official default pins, it really depends which board is being used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0