+# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
+#
+# SPDX-License-Identifier: MIT
"""I2C Classes for RP2040s with u2if firmware"""
from .rp2040_u2if import rp2040_u2if
out_end=None,
in_start=0,
in_end=None,
- stop=False
+ stop=False,
):
"""Write data from buffer_out to an address and then
read data from an address and into buffer_in
# pylint: enable=unused-argument
+
class I2C_Pico(I2C):
"""I2C Class for Pico u2if"""
super().__init__(index, frequency=frequency)
+
class I2C_Feather(I2C):
"""I2C Class for Feather u2if"""
super().__init__(index, frequency=frequency)
+
+class I2C_QTPY(I2C):
+ """I2C Class for QT Py 2if"""
+
+ def __init__(self, scl, sda, *, frequency=100000):
+ index = None
+ if scl.id == 25 and sda.id == 24:
+ index = 0
+ if scl.id == 23 and sda.id == 22:
+ index = 1
+ if index is None:
+ raise ValueError("I2C not found on specified pins.")
+ self._index = index
+
+ super().__init__(index, frequency=frequency)
+
+
+class I2C_ItsyBitsy(I2C):
+ """I2C Class for ItsyBitsy u2if"""
+
+ def __init__(self, scl, sda, *, frequency=100000):
+ index = None
+ if scl.id == 3 and sda.id == 2:
+ index = 1
+ if index is None:
+ raise ValueError("I2C not found on specified pins.")
+ self._index = index
+
+ super().__init__(index, frequency=frequency)
+
+
+class I2C_MacroPad(I2C):
+ """I2C Class for MacroPad u2if"""
+
+ def __init__(self, scl, sda, *, frequency=100000):
+ index = None
+ if scl.id == 21 and sda.id == 20:
+ index = 0
+ if index is None:
+ raise ValueError("I2C not found on specified pins.")
+ self._index = index
+ super().__init__(index, frequency=frequency)
+
+
+class I2C_QT2040_Trinkey(I2C):
+ """I2C Class for QT2040 Trinkey u2if"""
+
+ def __init__(self, scl, sda, *, frequency=100000):
+ index = None
+ if scl.id == 17 and sda.id == 16:
+ index = 0
+ if index is None:
+ raise ValueError("I2C not found on specified pins.")
+ self._index = index
+
+ super().__init__(index, frequency=frequency)