Merge pull request #303 from caternuson/add_kb2040

Add KB2040
This commit is contained in:
Melissa LeBlanc-Williams 2023-07-07 10:37:44 -07:00 committed by GitHub
commit 99a7cb2218
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 0 deletions

View file

@ -695,6 +695,9 @@ class Board:
# 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.")
@ -889,6 +892,7 @@ class Board:
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())
@ -997,6 +1001,11 @@ class Board:
"""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."""

View file

@ -131,6 +131,7 @@ class Chip:
0x812C,
0x812E,
0x8130,
0x0105,
)
):
self._chip_id = chips.RP2040_U2IF

View file

@ -162,6 +162,7 @@ ITSYBITSY_U2IF = "ITSYBITSY_U2IF"
MACROPAD_U2IF = "MACROPAD_U2IF"
QTPY_U2IF = "QTPY_U2IF"
QT2040_TRINKEY_U2IF = "QT2040_TRINKEY_U2IF"
KB2040_U2IF = "KB2040_U2IF"
BINHO_NOVA = "BINHO_NOVA"