1 """I2C Class for MCP2221"""
2 from .mcp2221 import mcp2221
6 """Custom I2C Class for MCP2221"""
8 def __init__(self, *, frequency=100000):
9 self._mcp2221 = mcp2221
10 self._mcp2221._i2c_configure(frequency)
13 """Perform an I2C Device Scan"""
14 return self._mcp2221.i2c_scan()
16 # pylint: disable=unused-argument
17 def writeto(self, address, buffer, *, start=0, end=None, stop=True):
18 """Write data from the buffer to an address"""
19 self._mcp2221.i2c_writeto(address, buffer, start=start, end=end)
21 def readfrom_into(self, address, buffer, *, start=0, end=None, stop=True):
22 """Read data from an address and into the buffer"""
23 self._mcp2221.i2c_readfrom_into(address, buffer, start=start, end=end)
25 def writeto_then_readfrom(
37 """Write data from buffer_out to an address and then
38 read data from an address and into buffer_in
40 self._mcp2221.i2c_writeto_then_readfrom(
50 # pylint: enable=unused-argument