2089 else: |
2089 else: |
2090 res = ast.literal_eval(out.decode("utf-8")) |
2090 res = ast.literal_eval(out.decode("utf-8")) |
2091 return res["result"], res["error"] |
2091 return res["result"], res["error"] |
2092 |
2092 |
2093 |
2093 |
2094 def createDevice( |
2094 def createDevice(microPythonWidget, deviceType, _vid, _pid, _boardName, _serialNumber): |
2095 microPythonWidget, deviceType, vid, pid, boardName, serialNumber # noqa: U100 |
|
2096 ): |
|
2097 """ |
2095 """ |
2098 Function to instantiate a MicroPython device object. |
2096 Function to instantiate a MicroPython device object. |
2099 |
2097 |
2100 @param microPythonWidget reference to the main MicroPython widget |
2098 @param microPythonWidget reference to the main MicroPython widget |
2101 @type MicroPythonWidget |
2099 @type MicroPythonWidget |
2102 @param deviceType device type assigned to this device interface |
2100 @param deviceType device type assigned to this device interface |
2103 @type str |
2101 @type str |
2104 @param vid vendor ID |
2102 @param _vid vendor ID (unused) |
2105 @type int |
2103 @type int |
2106 @param pid product ID |
2104 @param _pid product ID (unused) |
2107 @type int |
2105 @type int |
2108 @param boardName name of the board |
2106 @param _boardName name of the board (unused) |
2109 @type str |
2107 @type str |
2110 @param serialNumber serial number of the board |
2108 @param _serialNumber serial number of the board (unused) |
2111 @type str |
2109 @type str |
2112 @return reference to the instantiated device object |
2110 @return reference to the instantiated device object |
2113 @rtype RP2040Device |
2111 @rtype RP2040Device |
2114 """ |
2112 """ |
2115 return RP2040Device(microPythonWidget, deviceType) |
2113 return RP2040Device(microPythonWidget, deviceType) |