stevemarple / SoftWire

Software I2C implementation for Arduino and other Wiring-type environments
GNU Lesser General Public License v2.1
136 stars 31 forks source link

Does not implement TwoWire #10

Closed DanieleBenedettelli closed 3 years ago

DanieleBenedettelli commented 4 years ago

Hello. The class cannot be used as software I2C by other libraries, like Adafruit's because it does not implement the TwoWire interface. Please add it, as your class already implements the needed methods.

Thanks!

stevemarple commented 4 years ago

I'm not entirely sure what you are requesting here. The library already implements the methods of the Wire class. Perhaps you are requesting that SoftWire is derived from the Wire library? I considered this approach but rejected it as some architectures (eg ATtiny) do not have hardware I2C and thus do not have access to the Wire class. However the deliberate re-implementation of the interface means it is trivial for 'device driver' libraries to implement support for both Wire and SoftWire using templates. This is done for instance in my HIH61xx library, which has examples to use with SoftWire and Wire. See also https://github.com/eecharlie/Adafruit_VEML6070/.