src/eric7/MicroPython/MicroPythonDevices.py

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

eric ide

mercurial