Merge pull request #149 from tigard-tools/master

FT2232H support
This commit is contained in:
Melissa LeBlanc-Williams 2021-04-05 09:40:22 -07:00 committed by GitHub
commit 59edca95e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 0 deletions

View file

@ -105,6 +105,8 @@ class Board:
board_id = boards.ODROID_XU4
elif chip_id == chips.FT232H:
board_id = boards.FTDI_FT232H
elif chip_id == chips.FT2232H:
board_id = boards.FTDI_FT2232H
elif chip_id == chips.APQ8016:
board_id = boards.DRAGONBOARD_410C
elif chip_id in (chips.T210, chips.T186, chips.T194):
@ -547,6 +549,11 @@ class Board:
"""Check whether the current board is an FTDI FT232H."""
return self.id == boards.FTDI_FT232H
@property
def ftdi_ft2232h(self):
"""Check whether the current board is an FTDI FT2232H."""
return self.id == boards.FTDI_FT2232H
@property
def microchip_mcp2221(self):
"""Check whether the current board is a Microchip MCP2221."""

View file

@ -83,6 +83,18 @@ class Chip:
)
self._chip_id = chips.FT232H
return self._chip_id
if os.environ.get("BLINKA_FT2232H"):
from pyftdi.usbtools import UsbTools
# look for it based on PID/VID
count = len(UsbTools.find_all([(0x0403, 0x6010)]))
if count == 0:
raise RuntimeError(
"BLINKA_FT2232H environment variable "
+ "set, but no FT2232H device found"
)
self._chip_id = chips.FT2232H
return self._chip_id
if os.environ.get("BLINKA_MCP2221"):
import hid

View file

@ -104,6 +104,7 @@ ODROID_N2 = "ODROID_N2"
ODROID_XU4 = "ODROID_XU4"
FTDI_FT232H = "FTDI_FT232H"
FTDI_FT2232H = "FTDI_FT2232H"
DRAGONBOARD_410C = "DRAGONBOARD_410C"
SIFIVE_UNLEASHED = "SIFIVE_UNLEASHED"

View file

@ -21,6 +21,7 @@ T194 = "T194"
APQ8016 = "APQ8016"
GENERIC_X86 = "GENERIC_X86"
FT232H = "FT232H"
FT2232H = "FT2232H"
HFU540 = "HFU540"
MCP2221 = "MCP2221"
BINHO = "BINHO"

View file

@ -30,6 +30,7 @@ print("Is this an STM32MP1 Board?", detector.board.any_stm32mp1)
print(
"Is this an OS environment variable special case?",
detector.board.FTDI_FT232H
| detector.board.FTDI_FT2232H
| detector.board.MICROCHIP_MCP2221
| detector.board.BINHO_NOVA
| detector.board.GREATFET_ONE,