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
9 changes: 9 additions & 0 deletions adafruit_platformdetect/board.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,6 +695,9 @@ def _rp2040_u2if_id(self) -> Optional[str]:
# Feather RP2040 CAN
if product == 0x8130:
return boards.FEATHER_CAN_U2IF
# KB2040 Kee Board
if product == 0x0105:
return boards.KB2040_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 @@ -889,6 +892,7 @@ def lazily_generate_conditions():
yield self.board.MACROPAD_U2IF
yield self.board.QTPY_U2IF
yield self.board.QT2040_TRINKEY_U2IF
yield self.board.KB2040_U2IF

return any(condition for condition in lazily_generate_conditions())

Expand Down Expand Up @@ -997,6 +1001,11 @@ def qt2040_trinkey_u2if(self) -> bool:
"""Check whether the current board is a QT Py w/ u2if."""
return self.id == boards.QT2040_TRINKEY_U2IF

@property
def kb2040_u2if(self) -> bool:
"""Check whether the current board is a KB2040 w/ u2if."""
return self.id == boards.KB2040_U2IF

@property
def binho_nova(self) -> bool:
"""Check whether the current board is an BINHO NOVA."""
Expand Down
1 change: 1 addition & 0 deletions adafruit_platformdetect/chip.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ def id(
0x812C,
0x812E,
0x8130,
0x0105,
)
):
self._chip_id = chips.RP2040_U2IF
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 @@ -162,6 +162,7 @@
MACROPAD_U2IF = "MACROPAD_U2IF"
QTPY_U2IF = "QTPY_U2IF"
QT2040_TRINKEY_U2IF = "QT2040_TRINKEY_U2IF"
KB2040_U2IF = "KB2040_U2IF"

BINHO_NOVA = "BINHO_NOVA"

Expand Down