File tree Expand file tree Collapse file tree 5 files changed +22
-0
lines changed Expand file tree Collapse file tree 5 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,8 @@ def id(self):
105105 board_id = boards .ODROID_XU4
106106 elif chip_id == chips .FT232H :
107107 board_id = boards .FTDI_FT232H
108+ elif chip_id == chips .FT2232H :
109+ board_id = boards .FTDI_FT2232H
108110 elif chip_id == chips .APQ8016 :
109111 board_id = boards .DRAGONBOARD_410C
110112 elif chip_id in (chips .T210 , chips .T186 , chips .T194 ):
@@ -547,6 +549,11 @@ def ftdi_ft232h(self):
547549 """Check whether the current board is an FTDI FT232H."""
548550 return self .id == boards .FTDI_FT232H
549551
552+ @property
553+ def ftdi_ft2232h (self ):
554+ """Check whether the current board is an FTDI FT2232H."""
555+ return self .id == boards .FTDI_FT2232H
556+
550557 @property
551558 def microchip_mcp2221 (self ):
552559 """Check whether the current board is a Microchip MCP2221."""
Original file line number Diff line number Diff line change @@ -83,6 +83,18 @@ def id(
8383 )
8484 self ._chip_id = chips .FT232H
8585 return self ._chip_id
86+ if os .environ .get ("BLINKA_FT2232H" ):
87+ from pyftdi .usbtools import UsbTools
88+
89+ # look for it based on PID/VID
90+ count = len (UsbTools .find_all ([(0x0403 , 0x6010 )]))
91+ if count == 0 :
92+ raise RuntimeError (
93+ "BLINKA_FT2232H environment variable "
94+ + "set, but no FT2232H device found"
95+ )
96+ self ._chip_id = chips .FT2232H
97+ return self ._chip_id
8698 if os .environ .get ("BLINKA_MCP2221" ):
8799 import hid
88100
Original file line number Diff line number Diff line change 104104ODROID_XU4 = "ODROID_XU4"
105105
106106FTDI_FT232H = "FTDI_FT232H"
107+ FTDI_FT2232H = "FTDI_FT2232H"
107108DRAGONBOARD_410C = "DRAGONBOARD_410C"
108109
109110SIFIVE_UNLEASHED = "SIFIVE_UNLEASHED"
Original file line number Diff line number Diff line change 2121APQ8016 = "APQ8016"
2222GENERIC_X86 = "GENERIC_X86"
2323FT232H = "FT232H"
24+ FT2232H = "FT2232H"
2425HFU540 = "HFU540"
2526MCP2221 = "MCP2221"
2627BINHO = "BINHO"
Original file line number Diff line number Diff line change 3030print (
3131 "Is this an OS environment variable special case?" ,
3232 detector .board .FTDI_FT232H
33+ | detector .board .FTDI_FT2232H
3334 | detector .board .MICROCHIP_MCP2221
3435 | detector .board .BINHO_NOVA
3536 | detector .board .GREATFET_ONE ,
You can’t perform that action at this time.
0 commit comments