eric7/Documentation/Source/eric7.MicroPython.EspDevices.html

branch
eric7
changeset 8372
e0227a7c850e
child 8596
d64760b2da50
equal deleted inserted replaced
8371:d6062691d424 8372:e0227a7c850e
1 <!DOCTYPE html>
2 <html><head>
3 <title>eric7.MicroPython.EspDevices</title>
4 <meta charset="UTF-8">
5 <style>
6 body {
7 background: #EDECE6;
8 margin: 0em 1em 10em 1em;
9 color: black;
10 }
11
12 h1 { color: white; background: #85774A; }
13 h2 { color: white; background: #85774A; }
14 h3 { color: white; background: #9D936E; }
15 h4 { color: white; background: #9D936E; }
16
17 a { color: #BA6D36; }
18
19 </style>
20 </head>
21 <body>
22 <a NAME="top" ID="top"></a>
23 <h1>eric7.MicroPython.EspDevices</h1>
24
25 <p>
26 Module implementing the device interface class for ESP32 and ESP8266 based
27 boards.
28 </p>
29 <h3>Global Attributes</h3>
30
31 <table>
32 <tr><td>None</td></tr>
33 </table>
34 <h3>Classes</h3>
35
36 <table>
37
38 <tr>
39 <td><a href="#EspDevice">EspDevice</a></td>
40 <td>Class implementing the device for ESP32 and ESP8266 based boards.</td>
41 </tr>
42 </table>
43 <h3>Functions</h3>
44
45 <table>
46 <tr><td>None</td></tr>
47 </table>
48 <hr />
49 <hr />
50 <a NAME="EspDevice" ID="EspDevice"></a>
51 <h2>EspDevice</h2>
52
53 <p>
54 Class implementing the device for ESP32 and ESP8266 based boards.
55 </p>
56 <h3>Derived from</h3>
57 MicroPythonDevice
58 <h3>Class Attributes</h3>
59
60 <table>
61 <tr><td>None</td></tr>
62 </table>
63 <h3>Class Methods</h3>
64
65 <table>
66 <tr><td>None</td></tr>
67 </table>
68 <h3>Methods</h3>
69
70 <table>
71
72 <tr>
73 <td><a href="#EspDevice.__init__">EspDevice</a></td>
74 <td>Constructor</td>
75 </tr>
76 <tr>
77 <td><a href="#EspDevice.__backupFlash">__backupFlash</a></td>
78 <td>Private slot to backup the currently flashed firmware.</td>
79 </tr>
80 <tr>
81 <td><a href="#EspDevice.__eraseFlash">__eraseFlash</a></td>
82 <td>Private slot to erase the device flash memory.</td>
83 </tr>
84 <tr>
85 <td><a href="#EspDevice.__flashAddons">__flashAddons</a></td>
86 <td>Private slot to flash some additional firmware images.</td>
87 </tr>
88 <tr>
89 <td><a href="#EspDevice.__flashMicroPython">__flashMicroPython</a></td>
90 <td>Private slot to flash a MicroPython firmware to the device.</td>
91 </tr>
92 <tr>
93 <td><a href="#EspDevice.__installEspTool">__installEspTool</a></td>
94 <td>Private slot to install the esptool package via pip.</td>
95 </tr>
96 <tr>
97 <td><a href="#EspDevice.__resetDevice">__resetDevice</a></td>
98 <td>Private slot to reset the connected device.</td>
99 </tr>
100 <tr>
101 <td><a href="#EspDevice.__restoreFlash">__restoreFlash</a></td>
102 <td>Private slot to restore a previously saved firmware.</td>
103 </tr>
104 <tr>
105 <td><a href="#EspDevice.__showChipID">__showChipID</a></td>
106 <td>Private slot to show the ID of the ESP chip.</td>
107 </tr>
108 <tr>
109 <td><a href="#EspDevice.__showFlashID">__showFlashID</a></td>
110 <td>Private slot to show the ID of the ESP flash chip.</td>
111 </tr>
112 <tr>
113 <td><a href="#EspDevice.__showMACAddress">__showMACAddress</a></td>
114 <td>Private slot to show the MAC address of the ESP chip.</td>
115 </tr>
116 <tr>
117 <td><a href="#EspDevice.addDeviceMenuEntries">addDeviceMenuEntries</a></td>
118 <td>Public method to add device specific entries to the given menu.</td>
119 </tr>
120 <tr>
121 <td><a href="#EspDevice.canRunScript">canRunScript</a></td>
122 <td>Public method to determine, if a script can be executed.</td>
123 </tr>
124 <tr>
125 <td><a href="#EspDevice.canStartFileManager">canStartFileManager</a></td>
126 <td>Public method to determine, if a File Manager can be started.</td>
127 </tr>
128 <tr>
129 <td><a href="#EspDevice.canStartPlotter">canStartPlotter</a></td>
130 <td>Public method to determine, if a Plotter can be started.</td>
131 </tr>
132 <tr>
133 <td><a href="#EspDevice.canStartRepl">canStartRepl</a></td>
134 <td>Public method to determine, if a REPL can be started.</td>
135 </tr>
136 <tr>
137 <td><a href="#EspDevice.deviceName">deviceName</a></td>
138 <td>Public method to get the name of the device.</td>
139 </tr>
140 <tr>
141 <td><a href="#EspDevice.forceInterrupt">forceInterrupt</a></td>
142 <td>Public method to determine the need for an interrupt when opening the serial connection.</td>
143 </tr>
144 <tr>
145 <td><a href="#EspDevice.getDocumentationUrl">getDocumentationUrl</a></td>
146 <td>Public method to get the device documentation URL.</td>
147 </tr>
148 <tr>
149 <td><a href="#EspDevice.getFirmwareUrl">getFirmwareUrl</a></td>
150 <td>Public method to get the device firmware download URL.</td>
151 </tr>
152 <tr>
153 <td><a href="#EspDevice.hasFlashMenuEntry">hasFlashMenuEntry</a></td>
154 <td>Public method to check, if the device has its own flash menu entry.</td>
155 </tr>
156 <tr>
157 <td><a href="#EspDevice.runScript">runScript</a></td>
158 <td>Public method to run the given Python script.</td>
159 </tr>
160 <tr>
161 <td><a href="#EspDevice.setButtons">setButtons</a></td>
162 <td>Public method to enable the supported action buttons.</td>
163 </tr>
164 </table>
165 <h3>Static Methods</h3>
166
167 <table>
168 <tr><td>None</td></tr>
169 </table>
170
171 <a NAME="EspDevice.__init__" ID="EspDevice.__init__"></a>
172 <h4>EspDevice (Constructor)</h4>
173 <b>EspDevice</b>(<i>microPythonWidget, deviceType, parent=None</i>)
174
175 <p>
176 Constructor
177 </p>
178 <dl>
179
180 <dt><i>microPythonWidget</i> (MicroPythonWidget)</dt>
181 <dd>
182 reference to the main MicroPython widget
183 </dd>
184 <dt><i>deviceType</i> (str)</dt>
185 <dd>
186 device type assigned to this device interface
187 </dd>
188 <dt><i>parent</i> (QObject)</dt>
189 <dd>
190 reference to the parent object
191 </dd>
192 </dl>
193 <a NAME="EspDevice.__backupFlash" ID="EspDevice.__backupFlash"></a>
194 <h4>EspDevice.__backupFlash</h4>
195 <b>__backupFlash</b>(<i></i>)
196
197 <p>
198 Private slot to backup the currently flashed firmware.
199 </p>
200 <a NAME="EspDevice.__eraseFlash" ID="EspDevice.__eraseFlash"></a>
201 <h4>EspDevice.__eraseFlash</h4>
202 <b>__eraseFlash</b>(<i></i>)
203
204 <p>
205 Private slot to erase the device flash memory.
206 </p>
207 <a NAME="EspDevice.__flashAddons" ID="EspDevice.__flashAddons"></a>
208 <h4>EspDevice.__flashAddons</h4>
209 <b>__flashAddons</b>(<i></i>)
210
211 <p>
212 Private slot to flash some additional firmware images.
213 </p>
214 <a NAME="EspDevice.__flashMicroPython" ID="EspDevice.__flashMicroPython"></a>
215 <h4>EspDevice.__flashMicroPython</h4>
216 <b>__flashMicroPython</b>(<i></i>)
217
218 <p>
219 Private slot to flash a MicroPython firmware to the device.
220 </p>
221 <dl>
222
223 <dt>Raises <b>ValueError</b>:</dt>
224 <dd>
225 raised to indicate an unsupported chip type
226 </dd>
227 </dl>
228 <a NAME="EspDevice.__installEspTool" ID="EspDevice.__installEspTool"></a>
229 <h4>EspDevice.__installEspTool</h4>
230 <b>__installEspTool</b>(<i></i>)
231
232 <p>
233 Private slot to install the esptool package via pip.
234 </p>
235 <a NAME="EspDevice.__resetDevice" ID="EspDevice.__resetDevice"></a>
236 <h4>EspDevice.__resetDevice</h4>
237 <b>__resetDevice</b>(<i></i>)
238
239 <p>
240 Private slot to reset the connected device.
241 </p>
242 <a NAME="EspDevice.__restoreFlash" ID="EspDevice.__restoreFlash"></a>
243 <h4>EspDevice.__restoreFlash</h4>
244 <b>__restoreFlash</b>(<i></i>)
245
246 <p>
247 Private slot to restore a previously saved firmware.
248 </p>
249 <a NAME="EspDevice.__showChipID" ID="EspDevice.__showChipID"></a>
250 <h4>EspDevice.__showChipID</h4>
251 <b>__showChipID</b>(<i></i>)
252
253 <p>
254 Private slot to show the ID of the ESP chip.
255 </p>
256 <a NAME="EspDevice.__showFlashID" ID="EspDevice.__showFlashID"></a>
257 <h4>EspDevice.__showFlashID</h4>
258 <b>__showFlashID</b>(<i></i>)
259
260 <p>
261 Private slot to show the ID of the ESP flash chip.
262 </p>
263 <a NAME="EspDevice.__showMACAddress" ID="EspDevice.__showMACAddress"></a>
264 <h4>EspDevice.__showMACAddress</h4>
265 <b>__showMACAddress</b>(<i></i>)
266
267 <p>
268 Private slot to show the MAC address of the ESP chip.
269 </p>
270 <a NAME="EspDevice.addDeviceMenuEntries" ID="EspDevice.addDeviceMenuEntries"></a>
271 <h4>EspDevice.addDeviceMenuEntries</h4>
272 <b>addDeviceMenuEntries</b>(<i>menu</i>)
273
274 <p>
275 Public method to add device specific entries to the given menu.
276 </p>
277 <dl>
278
279 <dt><i>menu</i> (QMenu)</dt>
280 <dd>
281 reference to the context menu
282 </dd>
283 </dl>
284 <a NAME="EspDevice.canRunScript" ID="EspDevice.canRunScript"></a>
285 <h4>EspDevice.canRunScript</h4>
286 <b>canRunScript</b>(<i></i>)
287
288 <p>
289 Public method to determine, if a script can be executed.
290 </p>
291 <dl>
292 <dt>Return:</dt>
293 <dd>
294 tuple containing a flag indicating it is safe to start a
295 Plotter and a reason why it cannot.
296 </dd>
297 </dl>
298 <dl>
299 <dt>Return Type:</dt>
300 <dd>
301 tuple of (bool, str)
302 </dd>
303 </dl>
304 <a NAME="EspDevice.canStartFileManager" ID="EspDevice.canStartFileManager"></a>
305 <h4>EspDevice.canStartFileManager</h4>
306 <b>canStartFileManager</b>(<i></i>)
307
308 <p>
309 Public method to determine, if a File Manager can be started.
310 </p>
311 <dl>
312 <dt>Return:</dt>
313 <dd>
314 tuple containing a flag indicating it is safe to start a
315 File Manager and a reason why it cannot.
316 </dd>
317 </dl>
318 <dl>
319 <dt>Return Type:</dt>
320 <dd>
321 tuple of (bool, str)
322 </dd>
323 </dl>
324 <a NAME="EspDevice.canStartPlotter" ID="EspDevice.canStartPlotter"></a>
325 <h4>EspDevice.canStartPlotter</h4>
326 <b>canStartPlotter</b>(<i></i>)
327
328 <p>
329 Public method to determine, if a Plotter can be started.
330 </p>
331 <dl>
332 <dt>Return:</dt>
333 <dd>
334 tuple containing a flag indicating it is safe to start a
335 Plotter and a reason why it cannot.
336 </dd>
337 </dl>
338 <dl>
339 <dt>Return Type:</dt>
340 <dd>
341 tuple of (bool, str)
342 </dd>
343 </dl>
344 <a NAME="EspDevice.canStartRepl" ID="EspDevice.canStartRepl"></a>
345 <h4>EspDevice.canStartRepl</h4>
346 <b>canStartRepl</b>(<i></i>)
347
348 <p>
349 Public method to determine, if a REPL can be started.
350 </p>
351 <dl>
352 <dt>Return:</dt>
353 <dd>
354 tuple containing a flag indicating it is safe to start a REPL
355 and a reason why it cannot.
356 </dd>
357 </dl>
358 <dl>
359 <dt>Return Type:</dt>
360 <dd>
361 tuple of (bool, str)
362 </dd>
363 </dl>
364 <a NAME="EspDevice.deviceName" ID="EspDevice.deviceName"></a>
365 <h4>EspDevice.deviceName</h4>
366 <b>deviceName</b>(<i></i>)
367
368 <p>
369 Public method to get the name of the device.
370 </p>
371 <dl>
372 <dt>Return:</dt>
373 <dd>
374 name of the device
375 </dd>
376 </dl>
377 <dl>
378 <dt>Return Type:</dt>
379 <dd>
380 str
381 </dd>
382 </dl>
383 <a NAME="EspDevice.forceInterrupt" ID="EspDevice.forceInterrupt"></a>
384 <h4>EspDevice.forceInterrupt</h4>
385 <b>forceInterrupt</b>(<i></i>)
386
387 <p>
388 Public method to determine the need for an interrupt when opening the
389 serial connection.
390 </p>
391 <dl>
392 <dt>Return:</dt>
393 <dd>
394 flag indicating an interrupt is needed
395 </dd>
396 </dl>
397 <dl>
398 <dt>Return Type:</dt>
399 <dd>
400 bool
401 </dd>
402 </dl>
403 <a NAME="EspDevice.getDocumentationUrl" ID="EspDevice.getDocumentationUrl"></a>
404 <h4>EspDevice.getDocumentationUrl</h4>
405 <b>getDocumentationUrl</b>(<i></i>)
406
407 <p>
408 Public method to get the device documentation URL.
409 </p>
410 <dl>
411 <dt>Return:</dt>
412 <dd>
413 documentation URL of the device
414 </dd>
415 </dl>
416 <dl>
417 <dt>Return Type:</dt>
418 <dd>
419 str
420 </dd>
421 </dl>
422 <a NAME="EspDevice.getFirmwareUrl" ID="EspDevice.getFirmwareUrl"></a>
423 <h4>EspDevice.getFirmwareUrl</h4>
424 <b>getFirmwareUrl</b>(<i></i>)
425
426 <p>
427 Public method to get the device firmware download URL.
428 </p>
429 <dl>
430 <dt>Return:</dt>
431 <dd>
432 firmware download URL of the device
433 </dd>
434 </dl>
435 <dl>
436 <dt>Return Type:</dt>
437 <dd>
438 str
439 </dd>
440 </dl>
441 <a NAME="EspDevice.hasFlashMenuEntry" ID="EspDevice.hasFlashMenuEntry"></a>
442 <h4>EspDevice.hasFlashMenuEntry</h4>
443 <b>hasFlashMenuEntry</b>(<i></i>)
444
445 <p>
446 Public method to check, if the device has its own flash menu entry.
447 </p>
448 <dl>
449 <dt>Return:</dt>
450 <dd>
451 flag indicating a specific flash menu entry
452 </dd>
453 </dl>
454 <dl>
455 <dt>Return Type:</dt>
456 <dd>
457 bool
458 </dd>
459 </dl>
460 <a NAME="EspDevice.runScript" ID="EspDevice.runScript"></a>
461 <h4>EspDevice.runScript</h4>
462 <b>runScript</b>(<i>script</i>)
463
464 <p>
465 Public method to run the given Python script.
466 </p>
467 <dl>
468
469 <dt><i>script</i> (str)</dt>
470 <dd>
471 script to be executed
472 </dd>
473 </dl>
474 <a NAME="EspDevice.setButtons" ID="EspDevice.setButtons"></a>
475 <h4>EspDevice.setButtons</h4>
476 <b>setButtons</b>(<i></i>)
477
478 <p>
479 Public method to enable the supported action buttons.
480 </p>
481 <div align="right"><a href="#top">Up</a></div>
482 <hr />
483 </body></html>

eric ide

mercurial