Skip to content

Commit 99a7cb2

Browse files
authored
Merge pull request #303 from caternuson/add_kb2040
Add KB2040
2 parents 6cc5669 + dbe5a7a commit 99a7cb2

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

adafruit_platformdetect/board.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,9 @@ def _rp2040_u2if_id(self) -> Optional[str]:
695695
# Feather RP2040 CAN
696696
if product == 0x8130:
697697
return boards.FEATHER_CAN_U2IF
698+
# KB2040 Kee Board
699+
if product == 0x0105:
700+
return boards.KB2040_U2IF
698701
# Will only reach here if a device was added in chip.py but here.
699702
raise RuntimeError("RP2040_U2IF device was added to chip but not board.")
700703

@@ -889,6 +892,7 @@ def lazily_generate_conditions():
889892
yield self.board.MACROPAD_U2IF
890893
yield self.board.QTPY_U2IF
891894
yield self.board.QT2040_TRINKEY_U2IF
895+
yield self.board.KB2040_U2IF
892896

893897
return any(condition for condition in lazily_generate_conditions())
894898

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

1004+
@property
1005+
def kb2040_u2if(self) -> bool:
1006+
"""Check whether the current board is a KB2040 w/ u2if."""
1007+
return self.id == boards.KB2040_U2IF
1008+
10001009
@property
10011010
def binho_nova(self) -> bool:
10021011
"""Check whether the current board is an BINHO NOVA."""

adafruit_platformdetect/chip.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ def id(
131131
0x812C,
132132
0x812E,
133133
0x8130,
134+
0x0105,
134135
)
135136
):
136137
self._chip_id = chips.RP2040_U2IF

adafruit_platformdetect/constants/boards.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@
162162
MACROPAD_U2IF = "MACROPAD_U2IF"
163163
QTPY_U2IF = "QTPY_U2IF"
164164
QT2040_TRINKEY_U2IF = "QT2040_TRINKEY_U2IF"
165+
KB2040_U2IF = "KB2040_U2IF"
165166

166167
BINHO_NOVA = "BINHO_NOVA"
167168

0 commit comments

Comments
 (0)