I2C combined master/slave mode

User avatar
supersat
Posts: 10
Joined: Tue Apr 11, 2017 10:17 pm

I2C combined master/slave mode

Postby supersat » Fri Jul 21, 2017 12:57 am

Is it possible for the ESP32 to work as a combined I2C master and slave? I am working on a project with multiple masters, and it would be nice if each master could push packets to each other, rather than one acting as a slave and polling the other. I was originally hoping the two I2C controllers on the ESP32 could share pins, but while it might be possible to route the same pins as inputs to both I2C controllers, I think it's only possible for one to drive them as outputs. Or at least that's my understanding from the GPIO matrix documentation.

So, I think these are the options:

1. Switch one I2C controller between master and slave mode as needed.
2. Configure both I2C controllers as master/slave, but switch which drives the GPIO pins as needed.
3. Configure both I2C controllers as master/slave, and don't have the slave drive the output at all. This would require the master to knowingly violate the I2C protocol by ignoring the missing ACKs, but it might work.
4. Use two additional pins for a second I2C interface and tie both interfaces together.

Any other options I'm missing?

Who is online

Users browsing this forum: No registered users and 89 guests