X-Git-Url: https://git.ayoreis.com/hackapet/Adafruit_Blinka.git/blobdiff_plain/2bb509c5e122b4e0538bd5a87364c3c5a524fc0c..54a64285fbc416a587a0894e1495f891e5c6080a:/src/adafruit_blinka/microcontroller/fake_mcp2221/i2c.py diff --git a/src/adafruit_blinka/microcontroller/fake_mcp2221/i2c.py b/src/adafruit_blinka/microcontroller/fake_mcp2221/i2c.py index b98c70c..30f0b1d 100644 --- a/src/adafruit_blinka/microcontroller/fake_mcp2221/i2c.py +++ b/src/adafruit_blinka/microcontroller/fake_mcp2221/i2c.py @@ -11,44 +11,19 @@ class I2C: def __init__(self, *, frequency=100000): self._mcp2221 = mcp2221 + self._freq = frequency def scan(self, address_list=None): """Mocks an I2C scan. - If address_list is not provided, this function returns a list of 3 randomly generated I2C addresses from 0x0 to 0x79. - For a stimulus-driven test: If address_list is provided, this function returns the provided address_list. + If address_list is not provided, this function returns a + list of 3 randomly generated I2C addresses from 0x0 to 0x79. + For a stimulus-driven test: If address_list is provided, + this function returns the provided address_list. """ - if address_list == None: + if address_list is None: # Generate a list of 3 randomly generated addresses from 0x0 to 0x79 address_list = [] for _ in range(3): address_list.append(random.randint(0x0, 0x79)) return address_list return address_list - - # pylint: disable=unused-argument - def writeto(self, address, buffer, *, start=0, end=None, stop=True): - """Write data from the buffer to an address""" - pass - - def readfrom_into(self, address, buffer, *, start=0, end=None, stop=True): - """Read data from an address and into the buffer""" - pass - - def writeto_then_readfrom( - self, - address, - buffer_out, - buffer_in, - *, - out_start=0, - out_end=None, - in_start=0, - in_end=None, - stop=False, - ): - """Write data from buffer_out to an address and then - read data from an address and into buffer_in - """ - pass - - # pylint: enable=unused-argument