X-Git-Url: https://git.ayoreis.com/hackapet/Adafruit_Blinka.git/blobdiff_plain/b3beba7399bc4d5faa203ef705691ef79fc4e87f..9b7e0062ab189ba6248acd50bca1485b26625e19:/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 deleted file mode 100644 index d4b2c6f..0000000 --- a/src/adafruit_blinka/microcontroller/fake_mcp2221/i2c.py +++ /dev/null @@ -1,30 +0,0 @@ -# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries -# -# SPDX-License-Identifier: MIT -"""I2C Class for MCP2221""" -import random -from .fake_mcp2221 import mcp2221 - - -class I2C: - """Custom I2C Class for MCP2221""" - - def __init__(self, *, frequency=100000): - self._mcp2221 = mcp2221 - self._freq = frequency - - @staticmethod - def scan(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 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