eric6/MicroPython/MicroPythonDevices.py

changeset 7549
fcfbb9e94471
parent 7360
9190402e4505
child 7588
881eebfefd34
equal deleted inserted replaced
7548:e1c6a2e32a38 7549:fcfbb9e94471
53 ], 53 ],
54 "description": "BBC micro:bit", 54 "description": "BBC micro:bit",
55 "icon": "microbitDevice", 55 "icon": "microbitDevice",
56 }, 56 },
57 57
58 "calliope": {
59 "ids": [
60 (0x0D28, 0x0204), # Calliope mini
61 ],
62 "description": "Calliope mini",
63 "icon": "calliope_mini",
64 },
65
58 "pyboard": { 66 "pyboard": {
59 "ids": [ 67 "ids": [
60 (0xF055, 0x9800), # Pyboard in CDC mode 68 (0xF055, 0x9800), # Pyboard in CDC mode
61 (0xF055, 0x9801), # Pyboard in CDC+HID mode 69 (0xF055, 0x9801), # Pyboard in CDC+HID mode
62 (0xF055, 0x9802), # Pyboard in CDC+MSC mode 70 (0xF055, 0x9802), # Pyboard in CDC+MSC mode
63 ], 71 ],
64 "description": "PyBoard", 72 "description": "PyBoard",
65 "icon": "micropython48", 73 "icon": "micropython48",
66 } 74 },
67 } 75 }
68 76
69 77
70 def getSupportedDevices(): 78 def getSupportedDevices():
71 """ 79 """
101 if ((vid, pid) in SupportedBoards[board]["ids"] or 109 if ((vid, pid) in SupportedBoards[board]["ids"] or
102 (vid, None) in SupportedBoards[board]["ids"]): 110 (vid, None) in SupportedBoards[board]["ids"]):
103 foundDevices.append( 111 foundDevices.append(
104 (board, SupportedBoards[board]["description"], 112 (board, SupportedBoards[board]["description"],
105 port.portName())) 113 port.portName()))
106 break
107 else: 114 else:
108 logging.debug("Unknown device: (0x%04x:0x%04x)", vid, pid) 115 logging.debug("Unknown device: (0x%04x:0x%04x)", vid, pid)
109 116
110 return foundDevices 117 return foundDevices
111 118
149 from .EspDevices import EspDevice 156 from .EspDevices import EspDevice
150 return EspDevice(microPythonWidget) 157 return EspDevice(microPythonWidget)
151 elif deviceType == "circuitpython": 158 elif deviceType == "circuitpython":
152 from .CircuitPythonDevices import CircuitPythonDevice 159 from .CircuitPythonDevices import CircuitPythonDevice
153 return CircuitPythonDevice(microPythonWidget) 160 return CircuitPythonDevice(microPythonWidget)
154 elif deviceType == "bbc_microbit": 161 elif deviceType in ("bbc_microbit", "calliope"):
155 from .MicrobitDevices import MicrobitDevice 162 from .MicrobitDevices import MicrobitDevice
156 return MicrobitDevice(microPythonWidget) 163 return MicrobitDevice(microPythonWidget, deviceType)
157 elif deviceType == "pyboard": 164 elif deviceType == "pyboard":
158 from .PyBoardDevices import PyBoardDevice 165 from .PyBoardDevices import PyBoardDevice
159 return PyBoardDevice(microPythonWidget) 166 return PyBoardDevice(microPythonWidget)
160 else: 167 else:
161 # nothing specific requested 168 # nothing specific requested

eric ide

mercurial