Thu, 07 Jul 2022 11:23:56 +0200
Reorganized the project structure to use the source layout in order to support up-to-date build systems with "pyproject.toml".
7054
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
1 | # -*- coding: utf-8 -*- |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
2 | |
8881
54e42bc2437a
Updated copyright for 2022.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8762
diff
changeset
|
3 | # Copyright (c) 2019 - 2022 Detlev Offenbach <detlev@die-offenbachs.de> |
7054
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
4 | # |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
5 | |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
6 | """ |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
7 | Module implementing some utility functions and the MicroPythonDevice base |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
8 | class. |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
9 | """ |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
10 | |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
11 | import logging |
7059
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
12 | import os |
7054
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
13 | |
8318
962bce857696
Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8312
diff
changeset
|
14 | from PyQt6.QtCore import pyqtSlot, QObject, QCoreApplication |
962bce857696
Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8312
diff
changeset
|
15 | from PyQt6.QtWidgets import QInputDialog |
7054
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
16 | |
8358
144a6b854f70
Sorted the eric specific extensions into packages named like the corresponding PyQt packages (i.e. EricCore,EricGui and EricWidgets).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8356
diff
changeset
|
17 | from EricWidgets.EricApplication import ericApp |
8038
73ec029d4107
MicroPython: improved the support for "BBC micro:bit" and "Calliope mini".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8024
diff
changeset
|
18 | |
7054
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
19 | import UI.PixmapCache |
7059
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
20 | import Preferences |
7054
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
21 | |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
22 | |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
23 | SupportedBoards = { |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
24 | "esp": { |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
25 | "ids": [ |
8024
e0eb1d5922a5
MicroPython: added a few device IDs (taken from mu-Editor).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
26 | (0x0403, 0x6001), # M5Stack ESP32 device"), |
e0eb1d5922a5
MicroPython: added a few device IDs (taken from mu-Editor).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
27 | (0x0403, 0x6001), # FT232/FT245 (XinaBox CW01, CW02) |
e0eb1d5922a5
MicroPython: added a few device IDs (taken from mu-Editor).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
28 | (0x0403, 0x6010), # FT2232C/D/L/HL/Q (ESP-WROVER-KIT) |
e0eb1d5922a5
MicroPython: added a few device IDs (taken from mu-Editor).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
29 | (0x0403, 0x6011), # FT4232 |
e0eb1d5922a5
MicroPython: added a few device IDs (taken from mu-Editor).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
30 | (0x0403, 0x6014), # FT232H |
7058
bdd583f96e96
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7054
diff
changeset
|
31 | (0x0403, 0x6015), # Sparkfun ESP32 |
8024
e0eb1d5922a5
MicroPython: added a few device IDs (taken from mu-Editor).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
32 | (0x0403, 0x601C), # FT4222H |
8072
58491f4c99d6
MicroPython: added code to give a hint for CircuitPython devices, that do not support the UF2 bootloader for flashing.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8067
diff
changeset
|
33 | (0x10C4, 0xEA60), # CP210x |
8914 | 34 | (0x1A86, 0x55D4), # CH343 |
8919 | 35 | (0x1A86, 0x7523), # HL-340, CH340 |
7054
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
36 | ], |
8079
331e717c458e
MicroPython: added capability to manually configure devices not yet known by eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8072
diff
changeset
|
37 | "description": "ESP32, ESP8266", |
7054
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
38 | "icon": "esp32Device", |
8038
73ec029d4107
MicroPython: improved the support for "BBC micro:bit" and "Calliope mini".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8024
diff
changeset
|
39 | "port_description": "", |
7054
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
40 | }, |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
41 | |
7058
bdd583f96e96
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7054
diff
changeset
|
42 | "circuitpython": { |
7054
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
43 | "ids": [ |
8462
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
44 | (0x04D8, 0xEA2A), # BHDynamics DynaLoRa_USB |
8084
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
45 | (0x04D8, 0xEAD1), # BH Dynamics DynOSSAT-EDU-EPS-v1.0 |
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
46 | (0x04D8, 0xEAD2), # BH Dynamics DynOSSAT-EDU-OBC-v1.0 |
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
47 | (0x04D8, 0xEC44), # maholli PyCubed |
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
48 | (0x04D8, 0xEC63), # Kevin Neubauer CircuitBrains Basic |
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
49 | (0x04D8, 0xEC64), # Kevin Neubauer CircuitBrains Deluxe |
8072
58491f4c99d6
MicroPython: added code to give a hint for CircuitPython devices, that do not support the UF2 bootloader for flashing.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8067
diff
changeset
|
50 | (0x04D8, 0xEC72), # XinaBox CC03 |
58491f4c99d6
MicroPython: added code to give a hint for CircuitPython devices, that do not support the UF2 bootloader for flashing.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8067
diff
changeset
|
51 | (0x04D8, 0xEC75), # XinaBox CS11 |
8084
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
52 | (0x04D8, 0xED5F), # Itaca Innovation uChip CircuitPython |
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
53 | (0x04D8, 0xED94), # maholli kicksat-sprite |
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
54 | (0x04D8, 0xEDB3), # Capable Robot Programmable USB Hub |
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
55 | (0x04D8, 0xEDBE), # maholli SAM32 |
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
56 | (0x04D8, 0xEE8C), # J&J Studios LLC datum-Distance |
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
57 | (0x04D8, 0xEE8D), # J&J Studios LLC datum-IMU |
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
58 | (0x04D8, 0xEE8E), # J&J Studios LLC datum-Light |
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
59 | (0x04D8, 0xEE8F), # J&J Studios LLC datum-Weather |
8462
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
60 | (0x04D8, 0xEF67), # senseBox MCU |
8084
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
61 | (0x054C, 0x0BC2), # Sony Spresense |
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
62 | (0x1209, 0x2017), # Benjamin Shockley Mini SAM M4 |
8910 | 63 | (0x1209, 0x3141), # CrumpSpace CrumpS2 |
8084
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
64 | (0x1209, 0x3252), # Targett Module Clip w/Wroom |
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
65 | (0x1209, 0x3253), # Targett Module Clip w/Wrover |
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
66 | (0x1209, 0x4D43), # Robotics Masters Robo HAT MM1 M4 |
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
67 | (0x1209, 0x4DDD), # ODT CP Sapling |
8072
58491f4c99d6
MicroPython: added code to give a hint for CircuitPython devices, that do not support the UF2 bootloader for flashing.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8067
diff
changeset
|
68 | (0x1209, 0x4DDE), # ODT CP Sapling M0 w/ SPI Flash |
8462
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
69 | (0x1209, 0x4DDF), # ODT CP Sapling Rev B |
8910 | 70 | (0x1209, 0x4DF0), # Oak Dev Tech Pixelwing ESP32S2 |
71 | (0x1209, 0x4DF1), # Oak Dev Tech BREAD2040 | |
72 | (0x1209, 0x4DF2), # Oak Dev Tech CAST AWAY RP2040 | |
8084
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
73 | (0x1209, 0x5BF0), # Foosn Fomu |
8462
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
74 | (0x1209, 0x7150), # Electronic Cats Hunter Cat NFC |
9051 | 75 | (0x1209, 0x7382), # Invector Labs AB iLabs Challenger 840 |
8084
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
76 | (0x1209, 0x805A), # Electronic Cats BastBLE |
8910 | 77 | (0x1209, 0xA182), # Solder Party RP2040 Stamp |
8084
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
78 | (0x1209, 0xBAB0), # Electronic Cats Bast WiFi |
7058
bdd583f96e96
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7054
diff
changeset
|
79 | (0x1209, 0xBAB1), # Electronic Cats Meow Meow |
bdd583f96e96
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7054
diff
changeset
|
80 | (0x1209, 0xBAB2), # Electronic Cats CatWAN USBStick |
bdd583f96e96
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7054
diff
changeset
|
81 | (0x1209, 0xBAB3), # Electronic Cats Bast Pro Mini M0 |
8024
e0eb1d5922a5
MicroPython: added a few device IDs (taken from mu-Editor).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7923
diff
changeset
|
82 | (0x1209, 0xBAB6), # Electronic Cats Escornabot Makech |
8084
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
83 | (0x1209, 0xBAB8), # Electronic Cats NFC Copy Cat |
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
84 | (0x1209, 0xC051), # Betrusted Simmel |
9051 | 85 | (0x1209, 0xD10D), # Diodes Delight Piunora |
8084
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
86 | (0x1209, 0xE3E3), # StackRduino M0 PRO |
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
87 | (0x1209, 0xF500), # Silicognition LLC M4-Shim |
8462
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
88 | (0x16D0, 0x08C6), # Pimoroni Keybow 2040 |
8910 | 89 | (0x16D0, 0x08C7), # Pimoroni Tiny 2040 (8MB) |
8462
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
90 | (0x16D0, 0x08C8), # Pimoroni PicoSystem |
8084
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
91 | (0x1915, 0xB001), # Makerdiary Pitaya Go |
8910 | 92 | (0x192F, 0xB1B2), # WarmBit BluePixel nRF52840 |
8084
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
93 | (0x1B4F, 0x0015), # SparkFun RedBoard Turbo Board |
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
94 | (0x1B4F, 0x0016), # SparkFun SAMD51 Thing+ |
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
95 | (0x1B4F, 0x0017), # SparkFun LUMIDrive Board |
8910 | 96 | (0x1B4F, 0x0020), # SparkFun MicroMod SAMD51 Processor |
97 | (0x1B4F, 0x0021), # SparkFun MicroMod nRF52840 Processor | |
98 | (0x1B4F, 0x0024), # SparkFun MicroMod RP2040 Processor | |
8462
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
99 | (0x1B4F, 0x0025), # SparkFun Thing Plus RP2040 |
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
100 | (0x1B4F, 0x0026), # SparkFun Pro Micro RP2040 |
8910 | 101 | (0x1B4F, 0x0027), # SparkFun STM32 MicroMod Processor |
102 | (0x1B4F, 0x0028), # SparkFun Thing Plus - STM32 | |
9051 | 103 | (0x1B4F, 0x002E), # PJRC/Sparkfun Teensy MicroMod |
8084
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
104 | (0x1B4F, 0x5289), # SparkFun SFE_nRF52840_Mini |
7058
bdd583f96e96
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7054
diff
changeset
|
105 | (0x1B4F, 0x8D22), # SparkFun SAMD21 Mini Breakout |
bdd583f96e96
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7054
diff
changeset
|
106 | (0x1B4F, 0x8D23), # SparkFun SAMD21 Dev Breakout |
8082
2242a6a1d786
MicroPython: added support for a generic MicroPython device where the user can configure the relevant paramaters through the 'Unknown Devices' dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8079
diff
changeset
|
107 | (0x1B4F, 0x8D24), # SparkFun Qwiic Micro |
8084
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
108 | (0x1D50, 0x60E8), # Radomir Dopieralski PewPew M4 |
8910 | 109 | (0x1D50, 0x6152), # nrf52.jpconstantineau.com BlueMicro833 |
110 | (0x1D50, 0x6153), # JPConstantineau PyKey18 | |
111 | (0x1D50, 0x6153), # JPConstantineau PyKey44 | |
112 | (0x1D50, 0x6153), # JPConstantineau PyKey60 | |
113 | (0x1D50, 0x6153), # JPConstantineau PyKey87 | |
114 | (0x1D50, 0x6154), # JPConstantineau EncoderPad RP2040 | |
115 | (0x1D50, 0x6161), # nrf52.jpconstantineau.com BlueMicro840 | |
8084
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
116 | (0x2341, 0x8053), # Arduino MKR1300 |
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
117 | (0x2341, 0x8057), # Arduino Nano 33 IoT |
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
118 | (0x2341, 0x805A), # Arduino Arduino_Nano_33_BLE |
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
119 | (0x2341, 0x824D), # Arduino Zero |
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
120 | (0x2786, 0x9207), # Switch Sc. BLE-SS dev board Multi Sensor |
9051 | 121 | (0x2786, 0x920D), # Switch Sc. SSCI ISP1807 Dev Board |
122 | (0x2786, 0x920F), # Switch Sc. SSCI ISP1807 Micro Board | |
8084
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
123 | (0x2886, 0x002F), # Seeed Seeeduino XIAO |
8910 | 124 | (0x2886, 0x0042), # Seeed Seeeduino XIAO RP2040 |
125 | (0x2886, 0x0045), # Seeed XIAO nRF52840 Sense | |
8084
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
126 | (0x2886, 0x802D), # Seeed Seeeduino Wio Terminal |
8910 | 127 | (0x2886, 0x802F), # Seeed Seeeduino XIAO KB |
8084
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
128 | (0x2886, 0xF001), # Makerdiary nRF52840 M.2 Developer Kit |
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
129 | (0x2886, 0xF002), # Makerdiary M60 Keyboard |
8072
58491f4c99d6
MicroPython: added code to give a hint for CircuitPython devices, that do not support the UF2 bootloader for flashing.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8067
diff
changeset
|
130 | (0x2B04, 0xC00C), # Particle Argon |
58491f4c99d6
MicroPython: added code to give a hint for CircuitPython devices, that do not support the UF2 bootloader for flashing.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8067
diff
changeset
|
131 | (0x2B04, 0xC00D), # Particle Boron |
58491f4c99d6
MicroPython: added code to give a hint for CircuitPython devices, that do not support the UF2 bootloader for flashing.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8067
diff
changeset
|
132 | (0x2B04, 0xC00E), # Particle Xenon |
8462
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
133 | (0x2E8A, 0x1000), # Cytron Maker Pi RP2040 |
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
134 | (0x2E8A, 0x1002), # Pimoroni Pico LiPo (4MB) |
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
135 | (0x2E8A, 0x1003), # Pimoroni Pico LiPo (16MB) |
8910 | 136 | (0x2E8A, 0x1005), # Melopero Shake RP2040 |
137 | (0x2E8A, 0x1006), # Invector Labs Challenger RP2040 WiFi | |
8462
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
138 | (0x2E8A, 0x1008), # Pimoroni PGA2040 |
8910 | 139 | (0x2E8A, 0x1009), # Pimoroni Interstate 75 |
140 | (0x2E8A, 0x100A), # Pimoroni Plasma 2040 | |
141 | (0x2E8A, 0x100B), # Invector Labs Challenger RP2040 LTE | |
142 | (0x2E8A, 0x100D), # Invector Labs Challenger NB RP2040 WiFi | |
9051 | 143 | (0x2E8A, 0x100E), # Raspberry Pi Zero |
8910 | 144 | (0x2E8A, 0x100F), # Cytron Maker Nano RP2040 |
145 | (0x2E8A, 0x1012), # Raspberry Pi Compute Module 4 IO Board | |
146 | (0x2E8A, 0x1013), # Raspberry Pi 4B | |
147 | (0x2E8A, 0x1014), # Raspberry Pi Compute Module 4 | |
148 | (0x2E8A, 0x1015), # Raspberry Pi Zero 2W | |
149 | (0x2E8A, 0x1016), # Pimoroni Tiny 2040 (2MB) | |
9051 | 150 | (0x2E8A, 0x1019), # Pimoroni Motor 2040 |
151 | (0x2E8A, 0x101A), # Pimoroni Servo 2040 | |
152 | (0x2E8A, 0x101B), # Pimoroni Badger 2040 | |
153 | (0x2E8A, 0x101E), # Raspberry Pi Zero W | |
154 | (0x2E8A, 0x101F), # Waveshare Electronics RP2040-Zero | |
155 | (0x2E8A, 0x1026), # ELECFREAKS Pico:ed | |
156 | (0x2E8A, 0x1027), # WIZnet W5100S-EVB-Pico | |
8910 | 157 | (0x303A, 0x7001), # Espressif ESP32-S2-HMI-DevKit-1 |
158 | (0x303A, 0x7003), # Espressif ESP32-S3-DevKitC-1 | |
9051 | 159 | (0x303A, 0x7003), # Espressif ESP32-S3-DevKitC-1-N8 |
160 | (0x303A, 0x7003), # Espressif ESP32-S3-DevKitC-1-N8R2 | |
161 | (0x303A, 0x7003), # Espressif ESP32-S3-DevKitC-1-N8R8 | |
8910 | 162 | (0x303A, 0x7003), # Espressif ESP32-S3-DevKitC-1-nopsram |
163 | (0x303A, 0x7005), # Espressif ESP32-S3-Box-2.5 | |
9051 | 164 | (0x303A, 0x7007), # Espressif ESP32-S3-DevKitM-1-N8 |
165 | (0x303A, 0x7009), # Espressif ESP32-S2-DevKitC-1-N4 | |
166 | (0x303A, 0x7009), # Espressif ESP32-S2-DevKitC-1-N4R2 | |
167 | (0x303A, 0x700B), # Espressif ESP32-S3-USB-OTG-N8 | |
8462
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
168 | (0x303A, 0x8002), # UnexpectedMaker TinyS2 |
8084
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
169 | (0x303A, 0x8007), # LILYGO TTGO T8 ESP32-S2 |
8910 | 170 | (0x303A, 0x800D), # Gravitech Cucumber RS |
171 | (0x303A, 0x80A1), # Gravitech Cucumber R | |
172 | (0x303A, 0x80A4), # Gravitech Cucumber M | |
173 | (0x303A, 0x80A7), # Gravitech Cucumber MS | |
8462
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
174 | (0x303A, 0x80AA), # Espressif Franzininho WIFI w/Wroom |
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
175 | (0x303A, 0x80AD), # Espressif Franzininho WIFI w/Wrover |
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
176 | (0x303A, 0x80AF), # Artisense Reference Design RD00 |
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
177 | (0x303A, 0x80B2), # Muselab nanoESP32-S2 w/Wrover |
8910 | 178 | (0x303A, 0x80B5), # UnexpectedMaker FeatherS2 Neo |
179 | (0x303A, 0x80B7), # MORPHEANS MORPHESP-240 | |
180 | (0x303A, 0x80C3), # Lolin S2 Mini | |
181 | (0x303A, 0x80C6), # Lolin S2 Pico | |
9051 | 182 | (0x303A, 0x80D1), # UnexpectedMaker TinyS3 |
183 | (0x303A, 0x80D4), # UnexpectedMaker ProS3 | |
184 | (0x303A, 0x80D7), # UnexpectedMaker FeatherS3 | |
185 | (0x303A, 0x80D9), # FutureKeys HexKy_S2 | |
186 | (0x303A, 0x80E8), # HiiBot IoTs2 | |
187 | (0x303A, 0x80EA), # LILYGO TTGO T8 ESP32-S2-WROOM | |
188 | (0x303A, 0x80ED), # LILYGO TTGO T8 ESP32-S2 | |
8910 | 189 | (0x30A4, 0x0002), # Blues Inc. Swan R5 |
8462
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
190 | (0x3171, 0x0101), # 8086.net Commander |
8084
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
191 | (0x31E2, 0x2001), # BDMICRO LLC VINA-D21 |
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
192 | (0x31E2, 0x2011), # BDMICRO LLC VINA-D51 |
8462
34bb10914b21
Extended the list of known CircuitPython and UF2 capable devices.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8358
diff
changeset
|
193 | (0x31E2, 0x2021), # BDMICRO LLC VINA-D51 |
8084
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
194 | (0x32BD, 0x3001), # Alorium Tech. AloriumTech Evo M51 |
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
195 | (0x4097, 0x0001), # TG-Boards Datalore IP M4 |
8910 | 196 | (0x612B, 0x80A7), # Ai-Thinker ESP 12k NodeMCU |
8084
7742e0b96629
MicroPython: extended the list of known CircuitPython devices by extracting the VID/PID from the CorcuitPython sources.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8082
diff
changeset
|
197 | |
8072
58491f4c99d6
MicroPython: added code to give a hint for CircuitPython devices, that do not support the UF2 bootloader for flashing.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8067
diff
changeset
|
198 | (0x239A, None), # Any Adafruit Boards |
7054
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
199 | ], |
8055
52fdd41517f3
MicroPython: made the value shown in the deveice selection list more descriptive.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8051
diff
changeset
|
200 | "description": "CircuitPython", |
7059
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
201 | "icon": "circuitPythonDevice", |
8038
73ec029d4107
MicroPython: improved the support for "BBC micro:bit" and "Calliope mini".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8024
diff
changeset
|
202 | "port_description": "", |
7054
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
203 | }, |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
204 | |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
205 | "bbc_microbit": { |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
206 | "ids": [ |
7058
bdd583f96e96
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7054
diff
changeset
|
207 | (0x0D28, 0x0204), # micro:bit |
7054
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
208 | ], |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
209 | "description": "BBC micro:bit", |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
210 | "icon": "microbitDevice", |
8038
73ec029d4107
MicroPython: improved the support for "BBC micro:bit" and "Calliope mini".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8024
diff
changeset
|
211 | "port_description": "BBC micro:bit CMSIS-DAP", |
7054
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
212 | }, |
7295
cf50045a7c0f
MicroPython: added support for PyBoard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
213 | |
7549
fcfbb9e94471
MicroPython: continued implementing support for the "Calliope mini".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
214 | "calliope": { |
fcfbb9e94471
MicroPython: continued implementing support for the "Calliope mini".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
215 | "ids": [ |
fcfbb9e94471
MicroPython: continued implementing support for the "Calliope mini".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
216 | (0x0D28, 0x0204), # Calliope mini |
fcfbb9e94471
MicroPython: continued implementing support for the "Calliope mini".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
217 | ], |
fcfbb9e94471
MicroPython: continued implementing support for the "Calliope mini".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
218 | "description": "Calliope mini", |
fcfbb9e94471
MicroPython: continued implementing support for the "Calliope mini".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
219 | "icon": "calliope_mini", |
8038
73ec029d4107
MicroPython: improved the support for "BBC micro:bit" and "Calliope mini".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8024
diff
changeset
|
220 | "port_description": "DAPLink CMSIS-DAP", |
7549
fcfbb9e94471
MicroPython: continued implementing support for the "Calliope mini".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
221 | }, |
fcfbb9e94471
MicroPython: continued implementing support for the "Calliope mini".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
222 | |
7295
cf50045a7c0f
MicroPython: added support for PyBoard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
223 | "pyboard": { |
cf50045a7c0f
MicroPython: added support for PyBoard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
224 | "ids": [ |
cf50045a7c0f
MicroPython: added support for PyBoard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
225 | (0xF055, 0x9800), # Pyboard in CDC mode |
cf50045a7c0f
MicroPython: added support for PyBoard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
226 | (0xF055, 0x9801), # Pyboard in CDC+HID mode |
cf50045a7c0f
MicroPython: added support for PyBoard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
227 | (0xF055, 0x9802), # Pyboard in CDC+MSC mode |
cf50045a7c0f
MicroPython: added support for PyBoard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
228 | ], |
cf50045a7c0f
MicroPython: added support for PyBoard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
229 | "description": "PyBoard", |
cf50045a7c0f
MicroPython: added support for PyBoard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
230 | "icon": "micropython48", |
8038
73ec029d4107
MicroPython: improved the support for "BBC micro:bit" and "Calliope mini".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8024
diff
changeset
|
231 | "port_description": "", |
7549
fcfbb9e94471
MicroPython: continued implementing support for the "Calliope mini".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
232 | }, |
8079
331e717c458e
MicroPython: added capability to manually configure devices not yet known by eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8072
diff
changeset
|
233 | |
8122 | 234 | "rp2040": { |
235 | "ids": [ | |
236 | (0x2E8A, 0x0005), # Raspberry Pi Pico | |
237 | ], | |
238 | "description": QCoreApplication.translate( | |
239 | "MicroPythonDevice", "RP2040 based"), | |
240 | "icon": "rp2040Device", | |
241 | "port_description": "", | |
242 | }, | |
243 | ||
8079
331e717c458e
MicroPython: added capability to manually configure devices not yet known by eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8072
diff
changeset
|
244 | "generic": { |
331e717c458e
MicroPython: added capability to manually configure devices not yet known by eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8072
diff
changeset
|
245 | # only manually configured devices use this |
331e717c458e
MicroPython: added capability to manually configure devices not yet known by eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8072
diff
changeset
|
246 | "ids": [], |
331e717c458e
MicroPython: added capability to manually configure devices not yet known by eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8072
diff
changeset
|
247 | "description": QCoreApplication.translate( |
331e717c458e
MicroPython: added capability to manually configure devices not yet known by eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8072
diff
changeset
|
248 | "MicroPythonDevice", "Generic Board"), |
331e717c458e
MicroPython: added capability to manually configure devices not yet known by eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8072
diff
changeset
|
249 | "icon": "micropython48", |
331e717c458e
MicroPython: added capability to manually configure devices not yet known by eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8072
diff
changeset
|
250 | "port_description": "", |
331e717c458e
MicroPython: added capability to manually configure devices not yet known by eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8072
diff
changeset
|
251 | }, |
7054
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
252 | } |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
253 | |
7787
9ede0dcfc2ac
MicroPythonDevices: added a list of device to be ignored by default.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
254 | IgnoredBoards = ( |
9ede0dcfc2ac
MicroPythonDevices: added a list of device to be ignored by default.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
255 | (0x8086, 0x9c3d), |
8762
49d93d0069af
MicroPython: added '(0x8086, None)' to the list of ignores boards as it is used for some 8086 related chips.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8508
diff
changeset
|
256 | (0x8086, None), |
7787
9ede0dcfc2ac
MicroPythonDevices: added a list of device to be ignored by default.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
257 | ) |
9ede0dcfc2ac
MicroPythonDevices: added a list of device to be ignored by default.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7780
diff
changeset
|
258 | |
7054
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
259 | |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
260 | def getSupportedDevices(): |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
261 | """ |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
262 | Function to get a list of supported MicroPython devices. |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
263 | |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
264 | @return set of tuples with the board type and description |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
265 | @rtype set of tuples of (str, str) |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
266 | """ |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
267 | boards = [] |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
268 | for board in SupportedBoards: |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
269 | boards.append( |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
270 | (board, SupportedBoards[board]["description"])) |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
271 | return boards |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
272 | |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
273 | |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
274 | def getFoundDevices(): |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
275 | """ |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
276 | Function to check the serial ports for supported MicroPython devices. |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
277 | |
8096 | 278 | @return tuple containing a list of tuples with the board type, the port |
279 | description, a description, the serial port it is connected at, the | |
8134
a5c4ac339f2a
MicroPython: finished adding manual connection capability with device type and port selection.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8133
diff
changeset
|
280 | VID and PID for known device types, a list of tuples with VID, PID |
a5c4ac339f2a
MicroPython: finished adding manual connection capability with device type and port selection.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8133
diff
changeset
|
281 | and description for unknown devices and a list of tuples with VID, |
a5c4ac339f2a
MicroPython: finished adding manual connection capability with device type and port selection.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8133
diff
changeset
|
282 | PID, description and port name for ports with missing VID or PID |
8096 | 283 | @rtype tuple of (list of tuples of (str, str, str, str, int, int), |
8134
a5c4ac339f2a
MicroPython: finished adding manual connection capability with device type and port selection.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8133
diff
changeset
|
284 | list of tuples of (int, int, str), |
a5c4ac339f2a
MicroPython: finished adding manual connection capability with device type and port selection.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8133
diff
changeset
|
285 | list of tuples of (int, int, str, str) |
7054
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
286 | """ |
8318
962bce857696
Replaced all imports of PyQt5 to PyQt6 and started to replace code using obsoleted methods and adapt to the PyQt6 enum usage.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8312
diff
changeset
|
287 | from PyQt6.QtSerialPort import QSerialPortInfo |
7054
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
288 | |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
289 | foundDevices = [] |
7588
881eebfefd34
MicroPython: added code to report detected non-supported devices to the user asking to report them.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7549
diff
changeset
|
290 | unknownDevices = [] |
8133
4d1d1c248f79
MicroPython: started adding manual connection capability with device type and port selection.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8122
diff
changeset
|
291 | unknownPorts = [] |
7054
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
292 | |
8079
331e717c458e
MicroPython: added capability to manually configure devices not yet known by eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8072
diff
changeset
|
293 | manualDevices = {} |
331e717c458e
MicroPython: added capability to manually configure devices not yet known by eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8072
diff
changeset
|
294 | for deviceDict in Preferences.getMicroPython("ManualDevices"): |
331e717c458e
MicroPython: added capability to manually configure devices not yet known by eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8072
diff
changeset
|
295 | manualDevices[(deviceDict["vid"], deviceDict["pid"])] = deviceDict |
331e717c458e
MicroPython: added capability to manually configure devices not yet known by eric6.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8072
diff
changeset
|
296 | |
7054
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
297 | availablePorts = QSerialPortInfo.availablePorts() |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
298 | for port in availablePorts: |
8508
fbd629e65477
MicroPython: modified the code to be used with PyQt 6.2 (Qt 6.2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8462
diff
changeset
|
299 | if port.hasVendorIdentifier() and port.hasProductIdentifier(): |
fbd629e65477
MicroPython: modified the code to be used with PyQt 6.2 (Qt 6.2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8462
diff
changeset
|
300 | supported = False |
fbd629e65477
MicroPython: modified the code to be used with PyQt 6.2 (Qt 6.2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8462
diff
changeset
|
301 | vid = port.vendorIdentifier() |
fbd629e65477
MicroPython: modified the code to be used with PyQt 6.2 (Qt 6.2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8462
diff
changeset
|
302 | pid = port.productIdentifier() |
fbd629e65477
MicroPython: modified the code to be used with PyQt 6.2 (Qt 6.2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8462
diff
changeset
|
303 | |
fbd629e65477
MicroPython: modified the code to be used with PyQt 6.2 (Qt 6.2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8462
diff
changeset
|
304 | for board in SupportedBoards: |
8222
5994b80b8760
Applied some more code simplifications suggested by the new Simplify checker (Y102: use single if) (batch 1).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8218
diff
changeset
|
305 | if ( |
8508
fbd629e65477
MicroPython: modified the code to be used with PyQt 6.2 (Qt 6.2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8462
diff
changeset
|
306 | (vid, pid) in SupportedBoards[board]["ids"] or |
fbd629e65477
MicroPython: modified the code to be used with PyQt 6.2 (Qt 6.2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8462
diff
changeset
|
307 | (vid, None) in SupportedBoards[board]["ids"] |
8222
5994b80b8760
Applied some more code simplifications suggested by the new Simplify checker (Y102: use single if) (batch 1).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8218
diff
changeset
|
308 | ): |
8508
fbd629e65477
MicroPython: modified the code to be used with PyQt 6.2 (Qt 6.2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8462
diff
changeset
|
309 | if ( |
fbd629e65477
MicroPython: modified the code to be used with PyQt 6.2 (Qt 6.2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8462
diff
changeset
|
310 | board in ("bbc_microbit", "calliope") and |
fbd629e65477
MicroPython: modified the code to be used with PyQt 6.2 (Qt 6.2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8462
diff
changeset
|
311 | (port.description().strip() != |
fbd629e65477
MicroPython: modified the code to be used with PyQt 6.2 (Qt 6.2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8462
diff
changeset
|
312 | SupportedBoards[board]["port_description"]) |
fbd629e65477
MicroPython: modified the code to be used with PyQt 6.2 (Qt 6.2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8462
diff
changeset
|
313 | ): |
fbd629e65477
MicroPython: modified the code to be used with PyQt 6.2 (Qt 6.2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8462
diff
changeset
|
314 | # both boards have the same VID and PID |
fbd629e65477
MicroPython: modified the code to be used with PyQt 6.2 (Qt 6.2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8462
diff
changeset
|
315 | # try to differentiate based on port description |
fbd629e65477
MicroPython: modified the code to be used with PyQt 6.2 (Qt 6.2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8462
diff
changeset
|
316 | continue |
fbd629e65477
MicroPython: modified the code to be used with PyQt 6.2 (Qt 6.2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8462
diff
changeset
|
317 | foundDevices.append(( |
fbd629e65477
MicroPython: modified the code to be used with PyQt 6.2 (Qt 6.2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8462
diff
changeset
|
318 | board, |
fbd629e65477
MicroPython: modified the code to be used with PyQt 6.2 (Qt 6.2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8462
diff
changeset
|
319 | port.description(), |
fbd629e65477
MicroPython: modified the code to be used with PyQt 6.2 (Qt 6.2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8462
diff
changeset
|
320 | SupportedBoards[board]["description"], |
fbd629e65477
MicroPython: modified the code to be used with PyQt 6.2 (Qt 6.2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8462
diff
changeset
|
321 | port.portName(), |
fbd629e65477
MicroPython: modified the code to be used with PyQt 6.2 (Qt 6.2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8462
diff
changeset
|
322 | vid, |
fbd629e65477
MicroPython: modified the code to be used with PyQt 6.2 (Qt 6.2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8462
diff
changeset
|
323 | pid, |
fbd629e65477
MicroPython: modified the code to be used with PyQt 6.2 (Qt 6.2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8462
diff
changeset
|
324 | )) |
fbd629e65477
MicroPython: modified the code to be used with PyQt 6.2 (Qt 6.2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8462
diff
changeset
|
325 | supported = True |
fbd629e65477
MicroPython: modified the code to be used with PyQt 6.2 (Qt 6.2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8462
diff
changeset
|
326 | if not supported and (vid, pid) in manualDevices: |
fbd629e65477
MicroPython: modified the code to be used with PyQt 6.2 (Qt 6.2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8462
diff
changeset
|
327 | # check the locally added ones next |
fbd629e65477
MicroPython: modified the code to be used with PyQt 6.2 (Qt 6.2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8462
diff
changeset
|
328 | board = manualDevices[(vid, pid)]["type"] |
8082
2242a6a1d786
MicroPython: added support for a generic MicroPython device where the user can configure the relevant paramaters through the 'Unknown Devices' dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8079
diff
changeset
|
329 | foundDevices.append(( |
2242a6a1d786
MicroPython: added support for a generic MicroPython device where the user can configure the relevant paramaters through the 'Unknown Devices' dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8079
diff
changeset
|
330 | board, |
2242a6a1d786
MicroPython: added support for a generic MicroPython device where the user can configure the relevant paramaters through the 'Unknown Devices' dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8079
diff
changeset
|
331 | port.description(), |
2242a6a1d786
MicroPython: added support for a generic MicroPython device where the user can configure the relevant paramaters through the 'Unknown Devices' dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8079
diff
changeset
|
332 | SupportedBoards[board]["description"], |
2242a6a1d786
MicroPython: added support for a generic MicroPython device where the user can configure the relevant paramaters through the 'Unknown Devices' dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8079
diff
changeset
|
333 | port.portName(), |
2242a6a1d786
MicroPython: added support for a generic MicroPython device where the user can configure the relevant paramaters through the 'Unknown Devices' dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8079
diff
changeset
|
334 | vid, |
2242a6a1d786
MicroPython: added support for a generic MicroPython device where the user can configure the relevant paramaters through the 'Unknown Devices' dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8079
diff
changeset
|
335 | pid, |
2242a6a1d786
MicroPython: added support for a generic MicroPython device where the user can configure the relevant paramaters through the 'Unknown Devices' dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8079
diff
changeset
|
336 | )) |
7588
881eebfefd34
MicroPython: added code to report detected non-supported devices to the user asking to report them.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7549
diff
changeset
|
337 | supported = True |
8508
fbd629e65477
MicroPython: modified the code to be used with PyQt 6.2 (Qt 6.2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8462
diff
changeset
|
338 | if not supported: |
fbd629e65477
MicroPython: modified the code to be used with PyQt 6.2 (Qt 6.2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8462
diff
changeset
|
339 | if vid and pid: |
8762
49d93d0069af
MicroPython: added '(0x8086, None)' to the list of ignores boards as it is used for some 8086 related chips.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8508
diff
changeset
|
340 | if ( |
49d93d0069af
MicroPython: added '(0x8086, None)' to the list of ignores boards as it is used for some 8086 related chips.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8508
diff
changeset
|
341 | (vid, pid) not in IgnoredBoards and |
49d93d0069af
MicroPython: added '(0x8086, None)' to the list of ignores boards as it is used for some 8086 related chips.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8508
diff
changeset
|
342 | (vid, None) not in IgnoredBoards |
49d93d0069af
MicroPython: added '(0x8086, None)' to the list of ignores boards as it is used for some 8086 related chips.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8508
diff
changeset
|
343 | ): |
8508
fbd629e65477
MicroPython: modified the code to be used with PyQt 6.2 (Qt 6.2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8462
diff
changeset
|
344 | unknownDevices.append((vid, pid, port.description())) |
fbd629e65477
MicroPython: modified the code to be used with PyQt 6.2 (Qt 6.2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8462
diff
changeset
|
345 | logging.debug("Unknown device: (0x%04x:0x%04x %s)", |
fbd629e65477
MicroPython: modified the code to be used with PyQt 6.2 (Qt 6.2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8462
diff
changeset
|
346 | vid, pid, port.description()) |
fbd629e65477
MicroPython: modified the code to be used with PyQt 6.2 (Qt 6.2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8462
diff
changeset
|
347 | else: |
fbd629e65477
MicroPython: modified the code to be used with PyQt 6.2 (Qt 6.2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8462
diff
changeset
|
348 | # either VID or PID or both not detected |
fbd629e65477
MicroPython: modified the code to be used with PyQt 6.2 (Qt 6.2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8462
diff
changeset
|
349 | desc = port.description() |
fbd629e65477
MicroPython: modified the code to be used with PyQt 6.2 (Qt 6.2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8462
diff
changeset
|
350 | if not desc: |
fbd629e65477
MicroPython: modified the code to be used with PyQt 6.2 (Qt 6.2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8462
diff
changeset
|
351 | desc = QCoreApplication.translate("MicroPythonDevice", |
fbd629e65477
MicroPython: modified the code to be used with PyQt 6.2 (Qt 6.2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8462
diff
changeset
|
352 | "Unknown Device") |
fbd629e65477
MicroPython: modified the code to be used with PyQt 6.2 (Qt 6.2).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8462
diff
changeset
|
353 | unknownPorts.append((vid, pid, desc, port.portName())) |
7054
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
354 | |
8133
4d1d1c248f79
MicroPython: started adding manual connection capability with device type and port selection.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8122
diff
changeset
|
355 | return foundDevices, unknownDevices, unknownPorts |
7054
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
356 | |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
357 | |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
358 | def getDeviceIcon(boardName, iconFormat=True): |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
359 | """ |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
360 | Function to get the icon for the given board. |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
361 | |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
362 | @param boardName name of the board |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
363 | @type str |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
364 | @param iconFormat flag indicating to get an icon or a pixmap |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
365 | @type bool |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
366 | @return icon for the board (iconFormat == True) or |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
367 | a pixmap (iconFormat == False) |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
368 | @rtype QIcon or QPixmap |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
369 | """ |
8259
2bbec88047dd
Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8222
diff
changeset
|
370 | iconName = ( |
2bbec88047dd
Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8222
diff
changeset
|
371 | SupportedBoards[boardName]["icon"] |
2bbec88047dd
Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8222
diff
changeset
|
372 | if boardName in SupportedBoards else |
7054
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
373 | # return a generic MicroPython icon |
8259
2bbec88047dd
Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8222
diff
changeset
|
374 | "micropython48" |
2bbec88047dd
Applied some more code simplifications suggested by the new Simplify checker (Y108: use ternary operator).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8222
diff
changeset
|
375 | ) |
7054
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
376 | |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
377 | if iconFormat: |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
378 | return UI.PixmapCache.getIcon(iconName) |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
379 | else: |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
380 | return UI.PixmapCache.getPixmap(iconName) |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
381 | |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
382 | |
8082
2242a6a1d786
MicroPython: added support for a generic MicroPython device where the user can configure the relevant paramaters through the 'Unknown Devices' dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8079
diff
changeset
|
383 | def getDevice(deviceType, microPythonWidget, vid, pid): |
7054
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
384 | """ |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
385 | Public method to instantiate a specific MicroPython device interface. |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
386 | |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
387 | @param deviceType type of the device interface |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
388 | @type str |
7058
bdd583f96e96
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7054
diff
changeset
|
389 | @param microPythonWidget reference to the main MicroPython widget |
7134
21d23ca51680
Renamed "MicroPythonReplWidget" to "MicroPythonWidget".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7129
diff
changeset
|
390 | @type MicroPythonWidget |
8082
2242a6a1d786
MicroPython: added support for a generic MicroPython device where the user can configure the relevant paramaters through the 'Unknown Devices' dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8079
diff
changeset
|
391 | @param vid vendor ID (only used for deviceType 'generic') |
2242a6a1d786
MicroPython: added support for a generic MicroPython device where the user can configure the relevant paramaters through the 'Unknown Devices' dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8079
diff
changeset
|
392 | @type int |
2242a6a1d786
MicroPython: added support for a generic MicroPython device where the user can configure the relevant paramaters through the 'Unknown Devices' dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8079
diff
changeset
|
393 | @param pid product ID (only used for deviceType 'generic') |
2242a6a1d786
MicroPython: added support for a generic MicroPython device where the user can configure the relevant paramaters through the 'Unknown Devices' dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8079
diff
changeset
|
394 | @type int |
7054
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
395 | @return instantiated device interface |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
396 | @rtype MicroPythonDevice |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
397 | """ |
7059
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
398 | if deviceType == "esp": |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
399 | from .EspDevices import EspDevice |
8117
aaa5e0eacd4e
MicroPython: changed the logic to synchronize the time because some devices don't implement long integer and failed defining the 'set_time()' function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8096
diff
changeset
|
400 | return EspDevice(microPythonWidget, deviceType) |
7059
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
401 | elif deviceType == "circuitpython": |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
402 | from .CircuitPythonDevices import CircuitPythonDevice |
8117
aaa5e0eacd4e
MicroPython: changed the logic to synchronize the time because some devices don't implement long integer and failed defining the 'set_time()' function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8096
diff
changeset
|
403 | return CircuitPythonDevice(microPythonWidget, deviceType) |
7549
fcfbb9e94471
MicroPython: continued implementing support for the "Calliope mini".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
404 | elif deviceType in ("bbc_microbit", "calliope"): |
7059
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
405 | from .MicrobitDevices import MicrobitDevice |
7549
fcfbb9e94471
MicroPython: continued implementing support for the "Calliope mini".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7360
diff
changeset
|
406 | return MicrobitDevice(microPythonWidget, deviceType) |
7295
cf50045a7c0f
MicroPython: added support for PyBoard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
407 | elif deviceType == "pyboard": |
cf50045a7c0f
MicroPython: added support for PyBoard.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7229
diff
changeset
|
408 | from .PyBoardDevices import PyBoardDevice |
8117
aaa5e0eacd4e
MicroPython: changed the logic to synchronize the time because some devices don't implement long integer and failed defining the 'set_time()' function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8096
diff
changeset
|
409 | return PyBoardDevice(microPythonWidget, deviceType) |
8122 | 410 | elif deviceType == "rp2040": |
411 | from .RP2040Devices import RP2040Device | |
412 | return RP2040Device(microPythonWidget, deviceType) | |
8082
2242a6a1d786
MicroPython: added support for a generic MicroPython device where the user can configure the relevant paramaters through the 'Unknown Devices' dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8079
diff
changeset
|
413 | elif deviceType == "generic": |
2242a6a1d786
MicroPython: added support for a generic MicroPython device where the user can configure the relevant paramaters through the 'Unknown Devices' dialogs.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8079
diff
changeset
|
414 | from .GenericMicroPythonDevices import GenericMicroPythonDevice |
8117
aaa5e0eacd4e
MicroPython: changed the logic to synchronize the time because some devices don't implement long integer and failed defining the 'set_time()' function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8096
diff
changeset
|
415 | return GenericMicroPythonDevice(microPythonWidget, deviceType, |
aaa5e0eacd4e
MicroPython: changed the logic to synchronize the time because some devices don't implement long integer and failed defining the 'set_time()' function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8096
diff
changeset
|
416 | vid, pid) |
7059
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
417 | else: |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
418 | # nothing specific requested |
8117
aaa5e0eacd4e
MicroPython: changed the logic to synchronize the time because some devices don't implement long integer and failed defining the 'set_time()' function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8096
diff
changeset
|
419 | return MicroPythonDevice(microPythonWidget, deviceType) |
7054
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
420 | |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
421 | |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
422 | class MicroPythonDevice(QObject): |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
423 | """ |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
424 | Base class for the more specific MicroPython devices. |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
425 | """ |
8117
aaa5e0eacd4e
MicroPython: changed the logic to synchronize the time because some devices don't implement long integer and failed defining the 'set_time()' function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8096
diff
changeset
|
426 | def __init__(self, microPythonWidget, deviceType, parent=None): |
7054
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
427 | """ |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
428 | Constructor |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
429 | |
7058
bdd583f96e96
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7054
diff
changeset
|
430 | @param microPythonWidget reference to the main MicroPython widget |
7134
21d23ca51680
Renamed "MicroPythonReplWidget" to "MicroPythonWidget".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7129
diff
changeset
|
431 | @type MicroPythonWidget |
8117
aaa5e0eacd4e
MicroPython: changed the logic to synchronize the time because some devices don't implement long integer and failed defining the 'set_time()' function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8096
diff
changeset
|
432 | @param deviceType device type assigned to this device interface |
aaa5e0eacd4e
MicroPython: changed the logic to synchronize the time because some devices don't implement long integer and failed defining the 'set_time()' function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8096
diff
changeset
|
433 | @type str |
7054
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
434 | @param parent reference to the parent object |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
435 | @type QObject |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
436 | """ |
8218
7c09585bd960
Applied some more code simplifications suggested by the new Simplify checker (super(Foo, self) => super()).
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8134
diff
changeset
|
437 | super().__init__(parent) |
7058
bdd583f96e96
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7054
diff
changeset
|
438 | |
8117
aaa5e0eacd4e
MicroPython: changed the logic to synchronize the time because some devices don't implement long integer and failed defining the 'set_time()' function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8096
diff
changeset
|
439 | self._deviceType = deviceType |
7059
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
440 | self.microPython = microPythonWidget |
7054
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
441 | |
8117
aaa5e0eacd4e
MicroPython: changed the logic to synchronize the time because some devices don't implement long integer and failed defining the 'set_time()' function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8096
diff
changeset
|
442 | def getDeviceType(self): |
aaa5e0eacd4e
MicroPython: changed the logic to synchronize the time because some devices don't implement long integer and failed defining the 'set_time()' function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8096
diff
changeset
|
443 | """ |
aaa5e0eacd4e
MicroPython: changed the logic to synchronize the time because some devices don't implement long integer and failed defining the 'set_time()' function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8096
diff
changeset
|
444 | Public method to get the device type. |
aaa5e0eacd4e
MicroPython: changed the logic to synchronize the time because some devices don't implement long integer and failed defining the 'set_time()' function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8096
diff
changeset
|
445 | |
aaa5e0eacd4e
MicroPython: changed the logic to synchronize the time because some devices don't implement long integer and failed defining the 'set_time()' function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8096
diff
changeset
|
446 | @return type of the device |
aaa5e0eacd4e
MicroPython: changed the logic to synchronize the time because some devices don't implement long integer and failed defining the 'set_time()' function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8096
diff
changeset
|
447 | @rtype str |
aaa5e0eacd4e
MicroPython: changed the logic to synchronize the time because some devices don't implement long integer and failed defining the 'set_time()' function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8096
diff
changeset
|
448 | """ |
aaa5e0eacd4e
MicroPython: changed the logic to synchronize the time because some devices don't implement long integer and failed defining the 'set_time()' function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8096
diff
changeset
|
449 | return self._deviceType |
aaa5e0eacd4e
MicroPython: changed the logic to synchronize the time because some devices don't implement long integer and failed defining the 'set_time()' function.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8096
diff
changeset
|
450 | |
7058
bdd583f96e96
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7054
diff
changeset
|
451 | def setButtons(self): |
7054
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
452 | """ |
7058
bdd583f96e96
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7054
diff
changeset
|
453 | Public method to enable the supported action buttons. |
7054
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
454 | """ |
7059
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
455 | self.microPython.setActionButtons( |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
456 | open=False, save=False, |
7058
bdd583f96e96
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7054
diff
changeset
|
457 | run=False, repl=False, files=False, chart=False) |
7054
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
458 | |
7058
bdd583f96e96
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7054
diff
changeset
|
459 | def forceInterrupt(self): |
7054
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
460 | """ |
7058
bdd583f96e96
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7054
diff
changeset
|
461 | Public method to determine the need for an interrupt when opening the |
bdd583f96e96
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7054
diff
changeset
|
462 | serial connection. |
7054
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
463 | |
7058
bdd583f96e96
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7054
diff
changeset
|
464 | @return flag indicating an interrupt is needed |
bdd583f96e96
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7054
diff
changeset
|
465 | @rtype bool |
bdd583f96e96
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7054
diff
changeset
|
466 | """ |
bdd583f96e96
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7054
diff
changeset
|
467 | return True |
bdd583f96e96
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7054
diff
changeset
|
468 | |
7125
2028553ee58c
CircuitPythonDevices, EspDevices, MicroPythonDevices: added a method to get the device name.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7123
diff
changeset
|
469 | def deviceName(self): |
2028553ee58c
CircuitPythonDevices, EspDevices, MicroPythonDevices: added a method to get the device name.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7123
diff
changeset
|
470 | """ |
2028553ee58c
CircuitPythonDevices, EspDevices, MicroPythonDevices: added a method to get the device name.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7123
diff
changeset
|
471 | Public method to get the name of the device. |
2028553ee58c
CircuitPythonDevices, EspDevices, MicroPythonDevices: added a method to get the device name.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7123
diff
changeset
|
472 | |
2028553ee58c
CircuitPythonDevices, EspDevices, MicroPythonDevices: added a method to get the device name.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7123
diff
changeset
|
473 | @return name of the device |
2028553ee58c
CircuitPythonDevices, EspDevices, MicroPythonDevices: added a method to get the device name.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7123
diff
changeset
|
474 | @rtype str |
2028553ee58c
CircuitPythonDevices, EspDevices, MicroPythonDevices: added a method to get the device name.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7123
diff
changeset
|
475 | """ |
2028553ee58c
CircuitPythonDevices, EspDevices, MicroPythonDevices: added a method to get the device name.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7123
diff
changeset
|
476 | return self.tr("Unsupported Device") |
2028553ee58c
CircuitPythonDevices, EspDevices, MicroPythonDevices: added a method to get the device name.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7123
diff
changeset
|
477 | |
7058
bdd583f96e96
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7054
diff
changeset
|
478 | def canStartRepl(self): |
7054
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
479 | """ |
7058
bdd583f96e96
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7054
diff
changeset
|
480 | Public method to determine, if a REPL can be started. |
bdd583f96e96
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7054
diff
changeset
|
481 | |
bdd583f96e96
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7054
diff
changeset
|
482 | @return tuple containing a flag indicating it is safe to start a REPL |
bdd583f96e96
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7054
diff
changeset
|
483 | and a reason why it cannot. |
7059
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
484 | @rtype tuple of (bool, str) |
7058
bdd583f96e96
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7054
diff
changeset
|
485 | """ |
7059
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
486 | return False, self.tr("REPL is not supported by this device.") |
7058
bdd583f96e96
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7054
diff
changeset
|
487 | |
bdd583f96e96
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7054
diff
changeset
|
488 | def setRepl(self, on): |
bdd583f96e96
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7054
diff
changeset
|
489 | """ |
bdd583f96e96
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7054
diff
changeset
|
490 | Public method to set the REPL status and dependent status. |
7054
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
491 | |
7058
bdd583f96e96
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7054
diff
changeset
|
492 | @param on flag indicating the active status |
bdd583f96e96
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7054
diff
changeset
|
493 | @type bool |
bdd583f96e96
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7054
diff
changeset
|
494 | """ |
7059
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
495 | pass |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
496 | |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
497 | def canStartPlotter(self): |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
498 | """ |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
499 | Public method to determine, if a Plotter can be started. |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
500 | |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
501 | @return tuple containing a flag indicating it is safe to start a |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
502 | Plotter and a reason why it cannot. |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
503 | @rtype tuple of (bool, str) |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
504 | """ |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
505 | return False, self.tr("Plotter is not supported by this device.") |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
506 | |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
507 | def setPlotter(self, on): |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
508 | """ |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
509 | Public method to set the Plotter status and dependent status. |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
510 | |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
511 | @param on flag indicating the active status |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
512 | @type bool |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
513 | """ |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
514 | pass |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
515 | |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
516 | def canRunScript(self): |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
517 | """ |
7091
84d2a73b448a
EspDevices, MicroPythonDevices: fixed a wrong source docu string.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7082
diff
changeset
|
518 | Public method to determine, if a script can be executed. |
7059
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
519 | |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
520 | @return tuple containing a flag indicating it is safe to start a |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
521 | Plotter and a reason why it cannot. |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
522 | @rtype tuple of (bool, str) |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
523 | """ |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
524 | return False, self.tr("Running scripts is not supported by this" |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
525 | " device.") |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
526 | |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
527 | def runScript(self, script): |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
528 | """ |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
529 | Public method to run the given Python script. |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
530 | |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
531 | @param script script to be executed |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
532 | @type str |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
533 | """ |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
534 | pass |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
535 | |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
536 | def canStartFileManager(self): |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
537 | """ |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
538 | Public method to determine, if a File Manager can be started. |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
539 | |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
540 | @return tuple containing a flag indicating it is safe to start a |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
541 | File Manager and a reason why it cannot. |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
542 | @rtype tuple of (bool, str) |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
543 | """ |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
544 | return False, self.tr("File Manager is not supported by this device.") |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
545 | |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
546 | def setFileManager(self, on): |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
547 | """ |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
548 | Public method to set the File Manager status and dependent status. |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
549 | |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
550 | @param on flag indicating the active status |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
551 | @type bool |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
552 | """ |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
553 | pass |
7058
bdd583f96e96
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7054
diff
changeset
|
554 | |
7129
3cc19aec959a
MicroPythonDevicces: added a method to indicate that a device allows access to its file system via a local directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7125
diff
changeset
|
555 | def supportsLocalFileAccess(self): |
3cc19aec959a
MicroPythonDevicces: added a method to indicate that a device allows access to its file system via a local directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7125
diff
changeset
|
556 | """ |
3cc19aec959a
MicroPythonDevicces: added a method to indicate that a device allows access to its file system via a local directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7125
diff
changeset
|
557 | Public method to indicate file access via a local directory. |
3cc19aec959a
MicroPythonDevicces: added a method to indicate that a device allows access to its file system via a local directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7125
diff
changeset
|
558 | |
3cc19aec959a
MicroPythonDevicces: added a method to indicate that a device allows access to its file system via a local directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7125
diff
changeset
|
559 | @return flag indicating file access via local directory |
7145
ceb3e8b242c1
Regenerated source docu after merge with 'micropython' branch.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7134
diff
changeset
|
560 | @rtype bool |
7129
3cc19aec959a
MicroPythonDevicces: added a method to indicate that a device allows access to its file system via a local directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7125
diff
changeset
|
561 | """ |
3cc19aec959a
MicroPythonDevicces: added a method to indicate that a device allows access to its file system via a local directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7125
diff
changeset
|
562 | return False # default |
3cc19aec959a
MicroPythonDevicces: added a method to indicate that a device allows access to its file system via a local directory.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7125
diff
changeset
|
563 | |
7058
bdd583f96e96
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7054
diff
changeset
|
564 | def getWorkspace(self): |
bdd583f96e96
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7054
diff
changeset
|
565 | """ |
bdd583f96e96
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7054
diff
changeset
|
566 | Public method to get the workspace directory. |
7054
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
567 | |
7058
bdd583f96e96
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7054
diff
changeset
|
568 | @return workspace directory used for saving files |
7054
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
569 | @rtype str |
fb84d8489bc1
Started implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
diff
changeset
|
570 | """ |
8067
a467ab075be0
MicroPython: added buttons to go to the 'home' directory (local and on device) to the MicroPython file manager and improved the workspace handling.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8062
diff
changeset
|
571 | return ( |
a467ab075be0
MicroPython: added buttons to go to the 'home' directory (local and on device) to the MicroPython file manager and improved the workspace handling.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8062
diff
changeset
|
572 | Preferences.getMicroPython("MpyWorkspace") or |
a467ab075be0
MicroPython: added buttons to go to the 'home' directory (local and on device) to the MicroPython file manager and improved the workspace handling.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8062
diff
changeset
|
573 | Preferences.getMultiProject("Workspace") or |
a467ab075be0
MicroPython: added buttons to go to the 'home' directory (local and on device) to the MicroPython file manager and improved the workspace handling.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8062
diff
changeset
|
574 | os.path.expanduser("~") |
a467ab075be0
MicroPython: added buttons to go to the 'home' directory (local and on device) to the MicroPython file manager and improved the workspace handling.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8062
diff
changeset
|
575 | ) |
7058
bdd583f96e96
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7054
diff
changeset
|
576 | |
8062
8dc5acb30a8b
MicroPython: implemented code to deal with multiple devices attached to the computer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8055
diff
changeset
|
577 | def selectDeviceDirectory(self, deviceDirectories): |
8dc5acb30a8b
MicroPython: implemented code to deal with multiple devices attached to the computer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8055
diff
changeset
|
578 | """ |
8dc5acb30a8b
MicroPython: implemented code to deal with multiple devices attached to the computer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8055
diff
changeset
|
579 | Public method to select the device directory from a list of detected |
8dc5acb30a8b
MicroPython: implemented code to deal with multiple devices attached to the computer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8055
diff
changeset
|
580 | ones. |
8dc5acb30a8b
MicroPython: implemented code to deal with multiple devices attached to the computer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8055
diff
changeset
|
581 | |
8dc5acb30a8b
MicroPython: implemented code to deal with multiple devices attached to the computer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8055
diff
changeset
|
582 | @param deviceDirectories list of directories to select from |
8dc5acb30a8b
MicroPython: implemented code to deal with multiple devices attached to the computer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8055
diff
changeset
|
583 | @type list of str |
8dc5acb30a8b
MicroPython: implemented code to deal with multiple devices attached to the computer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8055
diff
changeset
|
584 | @return selected directory or an empty string |
8dc5acb30a8b
MicroPython: implemented code to deal with multiple devices attached to the computer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8055
diff
changeset
|
585 | @rtype str |
8dc5acb30a8b
MicroPython: implemented code to deal with multiple devices attached to the computer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8055
diff
changeset
|
586 | """ |
8dc5acb30a8b
MicroPython: implemented code to deal with multiple devices attached to the computer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8055
diff
changeset
|
587 | deviceDirectory, ok = QInputDialog.getItem( |
8dc5acb30a8b
MicroPython: implemented code to deal with multiple devices attached to the computer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8055
diff
changeset
|
588 | None, |
8dc5acb30a8b
MicroPython: implemented code to deal with multiple devices attached to the computer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8055
diff
changeset
|
589 | self.tr("Select Device Directory"), |
8dc5acb30a8b
MicroPython: implemented code to deal with multiple devices attached to the computer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8055
diff
changeset
|
590 | self.tr("Select the directory for the connected device:"), |
8dc5acb30a8b
MicroPython: implemented code to deal with multiple devices attached to the computer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8055
diff
changeset
|
591 | [""] + deviceDirectories, |
8dc5acb30a8b
MicroPython: implemented code to deal with multiple devices attached to the computer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8055
diff
changeset
|
592 | 0, False) |
8dc5acb30a8b
MicroPython: implemented code to deal with multiple devices attached to the computer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8055
diff
changeset
|
593 | if ok: |
8dc5acb30a8b
MicroPython: implemented code to deal with multiple devices attached to the computer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8055
diff
changeset
|
594 | return deviceDirectory |
8dc5acb30a8b
MicroPython: implemented code to deal with multiple devices attached to the computer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8055
diff
changeset
|
595 | else: |
8dc5acb30a8b
MicroPython: implemented code to deal with multiple devices attached to the computer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8055
diff
changeset
|
596 | # user cancelled |
8dc5acb30a8b
MicroPython: implemented code to deal with multiple devices attached to the computer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8055
diff
changeset
|
597 | return "" |
8dc5acb30a8b
MicroPython: implemented code to deal with multiple devices attached to the computer.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8055
diff
changeset
|
598 | |
7059
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
599 | def sendCommands(self, commandsList): |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
600 | """ |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
601 | Public method to send a list of commands to the device. |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
602 | |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
603 | @param commandsList list of commands to be sent to the device |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
604 | @type list of str |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
605 | """ |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
606 | rawOn = [ # sequence of commands to enter raw mode |
7068
e3200e4dfa63
MicroPythonDevices: modifie the rawOn sequence slightly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7065
diff
changeset
|
607 | b'\x02', # Ctrl-B: exit raw repl (just in case) |
e3200e4dfa63
MicroPythonDevices: modifie the rawOn sequence slightly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7065
diff
changeset
|
608 | b'\r\x03\x03\x03', # Ctrl-C three times: interrupt any running |
e3200e4dfa63
MicroPythonDevices: modifie the rawOn sequence slightly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7065
diff
changeset
|
609 | # program |
e3200e4dfa63
MicroPythonDevices: modifie the rawOn sequence slightly.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7065
diff
changeset
|
610 | b'\r\x01', # Ctrl-A: enter raw REPL |
7059
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
611 | ] |
7065
e3d04faced34
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7061
diff
changeset
|
612 | newLine = [b'print("\\n")\r', ] |
7059
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
613 | commands = [c.encode("utf-8)") + b'\r' for c in commandsList] |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
614 | commands.append(b'\r') |
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
615 | commands.append(b'\x04') |
8122 | 616 | rawOff = [b'\x02', b'\x02'] |
7059
a8fad276cbd5
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7058
diff
changeset
|
617 | commandSequence = rawOn + newLine + commands + rawOff |
7095
8e10acb1cd85
Refactored and improved the MicroPython code to be able to show the file manager and the REPL simultaneously.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7091
diff
changeset
|
618 | self.microPython.commandsInterface().executeAsync(commandSequence) |
7065
e3d04faced34
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7061
diff
changeset
|
619 | |
e3d04faced34
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7061
diff
changeset
|
620 | @pyqtSlot() |
e3d04faced34
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7061
diff
changeset
|
621 | def handleDataFlood(self): |
e3d04faced34
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7061
diff
changeset
|
622 | """ |
e3d04faced34
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7061
diff
changeset
|
623 | Public slot handling a data floof from the device. |
e3d04faced34
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7061
diff
changeset
|
624 | """ |
e3d04faced34
Continued implementing the MicroPython support.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7061
diff
changeset
|
625 | pass |
7082
ec199ef0cfc6
MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7068
diff
changeset
|
626 | |
7108
4f6133a01c6a
Started rearranging menu structure and testing and fixing on CircuitPython.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7095
diff
changeset
|
627 | def addDeviceMenuEntries(self, menu): |
7082
ec199ef0cfc6
MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7068
diff
changeset
|
628 | """ |
ec199ef0cfc6
MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7068
diff
changeset
|
629 | Public method to add device specific entries to the given menu. |
ec199ef0cfc6
MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7068
diff
changeset
|
630 | |
ec199ef0cfc6
MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7068
diff
changeset
|
631 | @param menu reference to the context menu |
ec199ef0cfc6
MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7068
diff
changeset
|
632 | @type QMenu |
ec199ef0cfc6
MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7068
diff
changeset
|
633 | """ |
ec199ef0cfc6
MicroPython: continued implementing the file manager widget.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7068
diff
changeset
|
634 | pass |
7123
94948e2aa0a5
Implemented the support for the 'BBC micro:bit' device.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7108
diff
changeset
|
635 | |
8096 | 636 | def hasFlashMenuEntry(self): |
637 | """ | |
638 | Public method to check, if the device has its own flash menu entry. | |
639 | ||
640 | @return flag indicating a specific flash menu entry | |
641 | @rtype bool | |
642 | """ | |
643 | return False | |
644 | ||
7123
94948e2aa0a5
Implemented the support for the 'BBC micro:bit' device.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7108
diff
changeset
|
645 | def hasTimeCommands(self): |
94948e2aa0a5
Implemented the support for the 'BBC micro:bit' device.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7108
diff
changeset
|
646 | """ |
94948e2aa0a5
Implemented the support for the 'BBC micro:bit' device.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7108
diff
changeset
|
647 | Public method to check, if the device supports time commands. |
94948e2aa0a5
Implemented the support for the 'BBC micro:bit' device.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7108
diff
changeset
|
648 | |
94948e2aa0a5
Implemented the support for the 'BBC micro:bit' device.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7108
diff
changeset
|
649 | The default returns True. |
94948e2aa0a5
Implemented the support for the 'BBC micro:bit' device.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7108
diff
changeset
|
650 | |
94948e2aa0a5
Implemented the support for the 'BBC micro:bit' device.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7108
diff
changeset
|
651 | @return flag indicating support for time commands |
94948e2aa0a5
Implemented the support for the 'BBC micro:bit' device.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7108
diff
changeset
|
652 | @rtype bool |
94948e2aa0a5
Implemented the support for the 'BBC micro:bit' device.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7108
diff
changeset
|
653 | """ |
94948e2aa0a5
Implemented the support for the 'BBC micro:bit' device.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7108
diff
changeset
|
654 | return True |
7161
728018c32b09
MicroPythonWidget: added actions to show the device documentation and to open the configuration page to the hamburger menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7145
diff
changeset
|
655 | |
728018c32b09
MicroPythonWidget: added actions to show the device documentation and to open the configuration page to the hamburger menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7145
diff
changeset
|
656 | def hasDocumentationUrl(self): |
728018c32b09
MicroPythonWidget: added actions to show the device documentation and to open the configuration page to the hamburger menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7145
diff
changeset
|
657 | """ |
728018c32b09
MicroPythonWidget: added actions to show the device documentation and to open the configuration page to the hamburger menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7145
diff
changeset
|
658 | Public method to check, if the device has a configured documentation |
728018c32b09
MicroPythonWidget: added actions to show the device documentation and to open the configuration page to the hamburger menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7145
diff
changeset
|
659 | URL. |
728018c32b09
MicroPythonWidget: added actions to show the device documentation and to open the configuration page to the hamburger menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7145
diff
changeset
|
660 | |
728018c32b09
MicroPythonWidget: added actions to show the device documentation and to open the configuration page to the hamburger menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7145
diff
changeset
|
661 | @return flag indicating a configured documentation URL |
728018c32b09
MicroPythonWidget: added actions to show the device documentation and to open the configuration page to the hamburger menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7145
diff
changeset
|
662 | @rtype bool |
728018c32b09
MicroPythonWidget: added actions to show the device documentation and to open the configuration page to the hamburger menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7145
diff
changeset
|
663 | """ |
728018c32b09
MicroPythonWidget: added actions to show the device documentation and to open the configuration page to the hamburger menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7145
diff
changeset
|
664 | return bool(self.getDocumentationUrl()) |
728018c32b09
MicroPythonWidget: added actions to show the device documentation and to open the configuration page to the hamburger menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7145
diff
changeset
|
665 | |
728018c32b09
MicroPythonWidget: added actions to show the device documentation and to open the configuration page to the hamburger menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7145
diff
changeset
|
666 | def getDocumentationUrl(self): |
728018c32b09
MicroPythonWidget: added actions to show the device documentation and to open the configuration page to the hamburger menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7145
diff
changeset
|
667 | """ |
728018c32b09
MicroPythonWidget: added actions to show the device documentation and to open the configuration page to the hamburger menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7145
diff
changeset
|
668 | Public method to get the device documentation URL. |
728018c32b09
MicroPythonWidget: added actions to show the device documentation and to open the configuration page to the hamburger menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7145
diff
changeset
|
669 | |
728018c32b09
MicroPythonWidget: added actions to show the device documentation and to open the configuration page to the hamburger menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7145
diff
changeset
|
670 | @return documentation URL of the device |
728018c32b09
MicroPythonWidget: added actions to show the device documentation and to open the configuration page to the hamburger menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7145
diff
changeset
|
671 | @rtype str |
728018c32b09
MicroPythonWidget: added actions to show the device documentation and to open the configuration page to the hamburger menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7145
diff
changeset
|
672 | """ |
728018c32b09
MicroPythonWidget: added actions to show the device documentation and to open the configuration page to the hamburger menu.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
7145
diff
changeset
|
673 | return "" |
7328 | 674 | |
675 | def hasFirmwareUrl(self): | |
676 | """ | |
677 | Public method to check, if the device has a configured firmware | |
678 | download URL. | |
679 | ||
680 | @return flag indicating a configured firmware download URL | |
681 | @rtype bool | |
682 | """ | |
683 | return bool(self.getFirmwareUrl()) | |
684 | ||
685 | def getFirmwareUrl(self): | |
686 | """ | |
687 | Public method to get the device firmware download URL. | |
688 | ||
689 | @return firmware download URL of the device | |
690 | @rtype str | |
691 | """ | |
692 | return "" | |
8038
73ec029d4107
MicroPython: improved the support for "BBC micro:bit" and "Calliope mini".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8024
diff
changeset
|
693 | |
73ec029d4107
MicroPython: improved the support for "BBC micro:bit" and "Calliope mini".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8024
diff
changeset
|
694 | def downloadFirmware(self): |
73ec029d4107
MicroPython: improved the support for "BBC micro:bit" and "Calliope mini".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8024
diff
changeset
|
695 | """ |
73ec029d4107
MicroPython: improved the support for "BBC micro:bit" and "Calliope mini".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8024
diff
changeset
|
696 | Public method to download the device firmware. |
73ec029d4107
MicroPython: improved the support for "BBC micro:bit" and "Calliope mini".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8024
diff
changeset
|
697 | """ |
73ec029d4107
MicroPython: improved the support for "BBC micro:bit" and "Calliope mini".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8024
diff
changeset
|
698 | url = self.getFirmwareUrl() |
73ec029d4107
MicroPython: improved the support for "BBC micro:bit" and "Calliope mini".
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8024
diff
changeset
|
699 | if url: |
8356
68ec9c3d4de5
Renamed the modules and classes of the E5Gui package to have the prefix 'Eric' instead of 'E5'.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8318
diff
changeset
|
700 | ericApp().getObject("UserInterface").launchHelpViewer(url) |
8051
b78279548993
MicroPython: changed the handling of the download stuff and corrected/extended the Calliope mini path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8038
diff
changeset
|
701 | |
b78279548993
MicroPython: changed the handling of the download stuff and corrected/extended the Calliope mini path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8038
diff
changeset
|
702 | def getDownloadMenuEntries(self): |
b78279548993
MicroPython: changed the handling of the download stuff and corrected/extended the Calliope mini path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8038
diff
changeset
|
703 | """ |
b78279548993
MicroPython: changed the handling of the download stuff and corrected/extended the Calliope mini path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8038
diff
changeset
|
704 | Public method to retrieve the entries for the downloads menu. |
b78279548993
MicroPython: changed the handling of the download stuff and corrected/extended the Calliope mini path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8038
diff
changeset
|
705 | |
b78279548993
MicroPython: changed the handling of the download stuff and corrected/extended the Calliope mini path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8038
diff
changeset
|
706 | @return list of tuples with menu text and URL to be opened for each |
b78279548993
MicroPython: changed the handling of the download stuff and corrected/extended the Calliope mini path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8038
diff
changeset
|
707 | entry |
b78279548993
MicroPython: changed the handling of the download stuff and corrected/extended the Calliope mini path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8038
diff
changeset
|
708 | @rtype list of tuple of (str, str) |
b78279548993
MicroPython: changed the handling of the download stuff and corrected/extended the Calliope mini path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8038
diff
changeset
|
709 | """ |
b78279548993
MicroPython: changed the handling of the download stuff and corrected/extended the Calliope mini path.
Detlev Offenbach <detlev@die-offenbachs.de>
parents:
8038
diff
changeset
|
710 | return [] |