diff --git a/adafruit_platformdetect/board.py b/adafruit_platformdetect/board.py index cef6b0c8..30412f2e 100644 --- a/adafruit_platformdetect/board.py +++ b/adafruit_platformdetect/board.py @@ -488,6 +488,9 @@ def _rp2040_u2if_id(self): # QT2040 Trinkey if product == 0x0109: return boards.QT2040_TRINKEY_U2IF + # MacroPad RP2040 + if product == 0x0107: + return boards.MACROPAD_U2IF # Will only reach here if a device was added in chip.py but here. raise RuntimeError("RP2040_U2IF device was added to chip but not board.") @@ -654,6 +657,11 @@ def itsybitsy_u2if(self): """Check whether the current board is a Itsy Bitsy w/ u2if.""" return self.id == boards.ITSYBITSY_U2IF + @property + def macropad_u2if(self): + """Check whether the current board is a MacroPad w/ u2if.""" + return self.id == boards.MACROPAD_U2IF + @property def qtpy_u2if(self): """Check whether the current board is a QT Py w/ u2if.""" diff --git a/adafruit_platformdetect/chip.py b/adafruit_platformdetect/chip.py index 3d3fd767..b633c974 100644 --- a/adafruit_platformdetect/chip.py +++ b/adafruit_platformdetect/chip.py @@ -126,8 +126,9 @@ def id( # Itsy Bitsy RP2040 # QT Py RP2040 # QT2040 Trinkey + # MacroPad RP2040 vendor == 0x239A - and product in (0x00F1, 0x00FD, 0x00F7, 0x0109) + and product in (0x00F1, 0x00FD, 0x00F7, 0x0109, 0x0107) ): self._chip_id = chips.RP2040_U2IF return self._chip_id diff --git a/adafruit_platformdetect/constants/boards.py b/adafruit_platformdetect/constants/boards.py index 8b0ec333..fdcdd085 100644 --- a/adafruit_platformdetect/constants/boards.py +++ b/adafruit_platformdetect/constants/boards.py @@ -120,6 +120,7 @@ PICO_U2IF = "PICO_U2IF" FEATHER_U2IF = "FEATHER_U2IF" ITSYBITSY_U2IF = "ITSYBITSY_U2IF" +MACROPAD_U2IF = "MACROPAD_U2IF" QTPY_U2IF = "QTPY_U2IF" QT2040_TRINKEY_U2IF = "QT2040_TRINKEY_U2IF" diff --git a/bin/detect.py b/bin/detect.py index 42d07b6c..682166d9 100644 --- a/bin/detect.py +++ b/bin/detect.py @@ -37,6 +37,7 @@ | detector.board.PICO_U2IF | detector.board.FEATHER_U2IF | detector.board.ITSYBITY_U2IF + | detector.board.MACROPAD_U2IF | detector.board.QTPY_U2IF | detector.board.QT2040_TRINKEY_U2IF, )