bitbank2 / BitBang_I2C

A software I2C implementation to run on any GPIO pins on any system
GNU General Public License v3.0
235 stars 31 forks source link

Slave functionality #5

Open oomek opened 4 years ago

oomek commented 4 years ago

Would it be difficult to extend your library by adding slave functionality? I need to make an i2c injector that sits between a non avr master and a slave. Tried Wire library but it locks up constantly when I use both wire ports in master/slave configuration

bitbank2 commented 4 years ago

It's a good idea, but I haven't had need for it (yet). All it would really require is attaching a pin interrupt to the clock line and adding a little bit of additional logic. Yes, it could be used as a middle-man for an I2C sniffer too. Are you able to write the missing part? I would be happy to merge a PR.

oomek commented 4 years ago

Let me go through your sources first. I just found your repo.

oomek commented 4 years ago

Damn, those ifdefs and case sensitive function names duplicates don't help at all :) I think I'll have to strip your lib off of gpio and wire temporarily otherwise I risk developing a brain tumor ;)