Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions adafruit_platformdetect/board.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")

Expand Down Expand Up @@ -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."""
Expand Down
3 changes: 2 additions & 1 deletion adafruit_platformdetect/chip.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions adafruit_platformdetect/constants/boards.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
1 change: 1 addition & 0 deletions bin/detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down