adafruit / Adafruit_CircuitPython_BusDevice

Two helper classes that handle transaction related state for I2C and SPI including locks.
MIT License
105 stars 76 forks source link

Don't scan the whole bus to verify existence of i2c device #3

Closed deshipu closed 7 years ago

deshipu commented 7 years ago

Instead of sending an empty write request to every possible address on the bus to see which devices respond, send it only to the one address that we are checking. This is not only much faster and more robust (there might be devices on the bus that respond badly to such requests at the wrong speed) but also makes it much easier to debug things with a logic analyzer, as it doesn't get flooded with all those requests.

tannewt commented 7 years ago

Looks good! Thanks!