Skip to content

add support for Radxa-X4 via U2IF #385

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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 @@ -896,6 +896,8 @@ def _rp2040_u2if_id(self) -> Optional[str]:
product = dev["product_id"]
if vendor == 0xCAFE and product == 0x4005:
return boards.PICO_U2IF
if vendor == 0xCAFF and product == 0x4005:
return boards.RADXA_X4_U2IF
if vendor == 0x239A:
# Feather RP2040
if product == 0x00F1:
Expand Down Expand Up @@ -1203,6 +1205,7 @@ def lazily_generate_conditions():
yield self.board.QT2040_TRINKEY_U2IF
yield self.board.KB2040_U2IF
yield self.board.RP2040_ONE_U2IF
yield self.board.RADXA_X4_U2IF
yield self.board.OS_AGNOSTIC_BOARD

return any(condition for condition in lazily_generate_conditions())
Expand Down Expand Up @@ -1342,6 +1345,11 @@ def rp2040_one_u2if(self) -> bool:
"""Check whether the current board is an RP2040 One w/ u2if."""
return self.id == boards.RP2040_ONE_U2IF

@property
def radxa_x4_u2if(self) -> bool:
"""Check whether the current board is an RP2040 One w/ u2if."""
return self.id == boards.RADXA_X4_U2IF

@property
def binho_nova(self) -> bool:
"""Check whether the current board is an BINHO NOVA."""
Expand Down
2 changes: 1 addition & 1 deletion adafruit_platformdetect/chip.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def id(
if (
(
# Raspberry Pi Pico
vendor == 0xCAFE
vendor in (0xCAFE, 0xCAFF)
and product == 0x4005
)
or (
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 @@ -195,6 +195,7 @@
KB2040_U2IF = "KB2040_U2IF"

RP2040_ONE_U2IF = "RP2040_ONE_U2IF"
RADXA_X4_U2IF = "RADXA_X4_U2IF"

BINHO_NOVA = "BINHO_NOVA"

Expand Down
Loading