Skip to content

Commit

Permalink
Merge pull request #7 from StevenBruinen/patch-1
Browse files Browse the repository at this point in the history
Support for `writeto_then_readfrom` which linux machines need for `write_then_readinto`.
  • Loading branch information
caternuson authored Apr 3, 2019
2 parents e396d47 + 2ea6865 commit 33280a6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions adafruit_tca9548a.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ def writeto(self, address, buffer, **kwargs):
raise ValueError("Device address must be different than TCA9548A address.")
return self.tca.i2c.writeto(address, buffer, **kwargs)

def writeto_then_readfrom(self, address, buffer_out, buffer_in, **kwargs):
"""Pass thru for writeto_then_readfrom."""
#In linux, at least, this is a special kernel function call
if address == self.tca.address:
raise ValueError("Device address must be different than TCA9548A address.")
return self.tca.i2c.writeto_then_readfrom(address, buffer_out, buffer_in, **kwargs)

class TCA9548A():
"""Class which provides interface to TCA9548A I2C multiplexer."""
Expand Down

0 comments on commit 33280a6

Please sign in to comment.