Skip to content
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

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

Draft
wants to merge 1 commit 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions adafruit_platformdetect/board.py
Expand Up @@ -127,6 +127,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 @@ -945,6 +947,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

return any(condition for condition in lazily_generate_conditions())

Expand Down Expand Up @@ -1010,6 +1013,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 pico_u2if(self) -> bool:
"""Check whether the current board is a RPi Pico w/ u2if."""
Expand Down
5 changes: 5 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.

Expand Up @@ -98,6 +98,11 @@
"BLINKA_MCP2221 environment variable "
+ "set, but no MCP2221 device found"
)
if os.environ.get("BLINKA_USB_ISS"):
from usb_iss import UsbIss, defs

Check failure on line 102 in adafruit_platformdetect/chip.py

View workflow job for this annotation

GitHub Actions / test

Unused UsbIss imported from usb_iss

Check failure on line 102 in adafruit_platformdetect/chip.py

View workflow job for this annotation

GitHub Actions / test

Unused defs imported from usb_iss

self._chip_id = chips.USB_ISS
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
Expand Up @@ -158,6 +158,7 @@
LICHEE_RV = "LICHEE_RV"

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
Expand Up @@ -74,5 +74,6 @@
RP2040_U2IF = "RP2040_U2IF"
D1_RISCV = "D1_RISCV"
ATOM_J4105 = "ATOM_J4105"
USB_ISS = "USB_ISS"

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