diff --git a/adafruit_platformdetect/board.py b/adafruit_platformdetect/board.py index 3057ca8d..ea98f2dd 100644 --- a/adafruit_platformdetect/board.py +++ b/adafruit_platformdetect/board.py @@ -129,6 +129,8 @@ def id(self) -> Optional[str]: board_id = self._beaglebone_id() elif chip_id == chips.MCP2221: board_id = boards.MICROCHIP_MCP2221 + elif chip_id == chips.USB_ISS: + board_id = boards.MICROCHIP_USB_ISS elif chip_id == chips.BINHO: board_id = boards.BINHO_NOVA elif chip_id == chips.LPC4330: @@ -1056,6 +1058,7 @@ def lazily_generate_conditions(): yield self.board.QTPY_U2IF yield self.board.QT2040_TRINKEY_U2IF yield self.board.KB2040_U2IF + yield self.board.MICROCHIP_USB_ISS yield self.board.OS_AGNOSTIC_BOARD return any(condition for condition in lazily_generate_conditions()) @@ -1126,6 +1129,11 @@ def microchip_mcp2221(self) -> bool: """Check whether the current board is a Microchip MCP2221.""" return self.id == boards.MICROCHIP_MCP2221 + @property + def microchip_usb_iss(self) -> bool: + """Check whether the current board is a Microchip USB_ISS.""" + return self.id == boards.MICROCHIP_USB_ISS + @property def os_agnostic_board(self) -> bool: """Check whether the current board is an OS agnostic special case.""" diff --git a/adafruit_platformdetect/chip.py b/adafruit_platformdetect/chip.py index 99588235..93bc3730 100644 --- a/adafruit_platformdetect/chip.py +++ b/adafruit_platformdetect/chip.py @@ -98,9 +98,13 @@ def id( "BLINKA_MCP2221 environment variable " + "set, but no MCP2221 device found" ) + if os.environ.get("BLINKA_USB_ISS"): + self._chip_id = chips.USB_ISS + if os.environ.get("BLINKA_OS_AGNOSTIC"): # we don't need to look for this chip, it's just a flag self._chip_id = chips.OS_AGNOSTIC + return self._chip_id if os.environ.get("BLINKA_U2IF"): import hid diff --git a/adafruit_platformdetect/constants/boards.py b/adafruit_platformdetect/constants/boards.py index b60de084..41a72f90 100644 --- a/adafruit_platformdetect/constants/boards.py +++ b/adafruit_platformdetect/constants/boards.py @@ -165,6 +165,7 @@ LICHEEPI_4A = "LICHEEPI_4A" MICROCHIP_MCP2221 = "MICROCHIP_MCP2221" +MICROCHIP_USB_ISS = "MICROCHIP_USB_ISS" # Linkspirte Pcduino based boards PCDUINO2 = "PCDUINO2" diff --git a/adafruit_platformdetect/constants/chips.py b/adafruit_platformdetect/constants/chips.py index fee42603..853014d0 100644 --- a/adafruit_platformdetect/constants/chips.py +++ b/adafruit_platformdetect/constants/chips.py @@ -77,6 +77,7 @@ RP2040_U2IF = "RP2040_U2IF" D1_RISCV = "D1_RISCV" ATOM_J4105 = "ATOM_J4105" +USB_ISS = "USB_ISS" TH1520 = "TH1520" BCM_RANGE = {"BCM2708", "BCM2709", "BCM2711", "BCM2712", "BCM2835", "BCM2837"}