setspeed() and setpullups() now update their respective variables

[#27]
This commit is contained in:
James Bowman 2020-01-04 06:51:34 -08:00
parent f00bee59c9
commit a6c58a5be3
1 changed files with 2 additions and 0 deletions

View File

@ -143,6 +143,7 @@ class I2CDriver:
assert s in (100, 400) assert s in (100, 400)
c = {100:b'1', 400:b'4'}[s] c = {100:b'1', 400:b'4'}[s]
self.__ser_w(c) self.__ser_w(c)
self.speed = s
def setpullups(self, s): def setpullups(self, s):
""" """
@ -152,6 +153,7 @@ class I2CDriver:
""" """
assert 0 <= s < 64 assert 0 <= s < 64
self.__ser_w([ord('u'), s]) self.__ser_w([ord('u'), s])
self.pullups = s
def scan(self, silent = False): def scan(self, silent = False):
""" Performs an I2C bus scan. """ Performs an I2C bus scan.