Skip to content

Adding usb_iss to i2c module; i2c support only; Stable #335

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

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
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 @@ -129,6 +129,8 @@ def id(self) -> Optional[str]:
board_id = self._beaglebone_id()
elif chip_id == chips.MCP2221:
board_id = boards.MICROCHIP_MCP2221
elif chip_id == chips.USB_ISS:
board_id = boards.MICROCHIP_USB_ISS
elif chip_id == chips.BINHO:
board_id = boards.BINHO_NOVA
elif chip_id == chips.LPC4330:
Expand Down Expand Up @@ -1056,6 +1058,7 @@ def lazily_generate_conditions():
yield self.board.QTPY_U2IF
yield self.board.QT2040_TRINKEY_U2IF
yield self.board.KB2040_U2IF
yield self.board.MICROCHIP_USB_ISS
yield self.board.OS_AGNOSTIC_BOARD

return any(condition for condition in lazily_generate_conditions())
Expand Down Expand Up @@ -1126,6 +1129,11 @@ def microchip_mcp2221(self) -> bool:
"""Check whether the current board is a Microchip MCP2221."""
return self.id == boards.MICROCHIP_MCP2221

@property
def microchip_usb_iss(self) -> bool:
"""Check whether the current board is a Microchip USB_ISS."""
return self.id == boards.MICROCHIP_USB_ISS

@property
def os_agnostic_board(self) -> bool:
"""Check whether the current board is an OS agnostic special case."""
Expand Down
4 changes: 4 additions & 0 deletions adafruit_platformdetect/chip.py
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no methode to enumerate usb_iss device. It's just connect, yes/no.
So I see no more need then having the import of the class lib.

Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,13 @@ def id(
"BLINKA_MCP2221 environment variable "
+ "set, but no MCP2221 device found"
)
if os.environ.get("BLINKA_USB_ISS"):
self._chip_id = chips.USB_ISS

if os.environ.get("BLINKA_OS_AGNOSTIC"):
# we don't need to look for this chip, it's just a flag
self._chip_id = chips.OS_AGNOSTIC

return self._chip_id
if os.environ.get("BLINKA_U2IF"):
import hid
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 @@ -165,6 +165,7 @@
LICHEEPI_4A = "LICHEEPI_4A"

MICROCHIP_MCP2221 = "MICROCHIP_MCP2221"
MICROCHIP_USB_ISS = "MICROCHIP_USB_ISS"

# Linkspirte Pcduino based boards
PCDUINO2 = "PCDUINO2"
Expand Down
1 change: 1 addition & 0 deletions adafruit_platformdetect/constants/chips.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
RP2040_U2IF = "RP2040_U2IF"
D1_RISCV = "D1_RISCV"
ATOM_J4105 = "ATOM_J4105"
USB_ISS = "USB_ISS"
TH1520 = "TH1520"

BCM_RANGE = {"BCM2708", "BCM2709", "BCM2711", "BCM2712", "BCM2835", "BCM2837"}
Expand Down
Loading