src/eric7/Documentation/Source/eric7.MicroPython.PyBoardDevices.html

branch
eric7
changeset 9756
9854647c8c5c
parent 9755
1a09700229e7
child 9757
ab6e87f6f1c4
equal deleted inserted replaced
9755:1a09700229e7 9756:9854647c8c5c
1 <!DOCTYPE html>
2 <html><head>
3 <title>eric7.MicroPython.PyBoardDevices</title>
4 <meta charset="UTF-8">
5 <link rel="stylesheet" href="styles.css">
6 </head>
7 <body>
8 <a NAME="top" ID="top"></a>
9 <h1>eric7.MicroPython.PyBoardDevices</h1>
10
11 <p>
12 Module implementing the device interface class for PyBoard boards.
13 </p>
14 <h3>Global Attributes</h3>
15
16 <table>
17 <tr><td>None</td></tr>
18 </table>
19 <h3>Classes</h3>
20
21 <table>
22
23 <tr>
24 <td><a href="#PyBoardDevice">PyBoardDevice</a></td>
25 <td>Class implementing the device for PyBoard boards.</td>
26 </tr>
27 </table>
28 <h3>Functions</h3>
29
30 <table>
31
32 <tr>
33 <td><a href="#createDevice">createDevice</a></td>
34 <td>Function to instantiate a MicroPython device object.</td>
35 </tr>
36 </table>
37 <hr />
38 <hr />
39 <a NAME="PyBoardDevice" ID="PyBoardDevice"></a>
40 <h2>PyBoardDevice</h2>
41
42 <p>
43 Class implementing the device for PyBoard boards.
44 </p>
45 <h3>Derived from</h3>
46 MicroPythonDevice
47 <h3>Class Attributes</h3>
48
49 <table>
50 <tr><td>DeviceVolumeName</td></tr><tr><td>FlashInstructionsURL</td></tr>
51 </table>
52 <h3>Class Methods</h3>
53
54 <table>
55 <tr><td>None</td></tr>
56 </table>
57 <h3>Methods</h3>
58
59 <table>
60
61 <tr>
62 <td><a href="#PyBoardDevice.__init__">PyBoardDevice</a></td>
63 <td>Constructor</td>
64 </tr>
65 <tr>
66 <td><a href="#PyBoardDevice.__activateBootloader">__activateBootloader</a></td>
67 <td>Private slot to activate the bootloader and disconnect.</td>
68 </tr>
69 <tr>
70 <td><a href="#PyBoardDevice.__createPyboardMenu">__createPyboardMenu</a></td>
71 <td>Private method to create the pyboard submenu.</td>
72 </tr>
73 <tr>
74 <td><a href="#PyBoardDevice.__deviceVolumeMounted">__deviceVolumeMounted</a></td>
75 <td>Private method to check, if the device volume is mounted.</td>
76 </tr>
77 <tr>
78 <td><a href="#PyBoardDevice.__dfuUtilAvailable">__dfuUtilAvailable</a></td>
79 <td>Private method to check the availability of dfu-util.</td>
80 </tr>
81 <tr>
82 <td><a href="#PyBoardDevice.__findWorkspace">__findWorkspace</a></td>
83 <td>Private method to find the workspace directory.</td>
84 </tr>
85 <tr>
86 <td><a href="#PyBoardDevice.__firmwareVersionResponse">__firmwareVersionResponse</a></td>
87 <td>Private method handling the response of the latest version request.</td>
88 </tr>
89 <tr>
90 <td><a href="#PyBoardDevice.__flashMicroPython">__flashMicroPython</a></td>
91 <td>Private slot to flash a MicroPython firmware.</td>
92 </tr>
93 <tr>
94 <td><a href="#PyBoardDevice.__listDfuCapableDevices">__listDfuCapableDevices</a></td>
95 <td>Private slot to list all DFU-capable devices.</td>
96 </tr>
97 <tr>
98 <td><a href="#PyBoardDevice.__showDfuDisableInstructions">__showDfuDisableInstructions</a></td>
99 <td>Private method to show some instructions to disable the DFU mode.</td>
100 </tr>
101 <tr>
102 <td><a href="#PyBoardDevice.__showDfuEnableInstructions">__showDfuEnableInstructions</a></td>
103 <td>Private method to show some instructions to enable the DFU mode.</td>
104 </tr>
105 <tr>
106 <td><a href="#PyBoardDevice.__showFirmwareVersions">__showFirmwareVersions</a></td>
107 <td>Private slot to show the firmware version of the connected device and the available firmware version.</td>
108 </tr>
109 <tr>
110 <td><a href="#PyBoardDevice.__showFlashInstructions">__showFlashInstructions</a></td>
111 <td>Private slot to open the URL containing instructions for installing MicroPython on the pyboard.</td>
112 </tr>
113 <tr>
114 <td><a href="#PyBoardDevice.addDeviceMenuEntries">addDeviceMenuEntries</a></td>
115 <td>Public method to add device specific entries to the given menu.</td>
116 </tr>
117 <tr>
118 <td><a href="#PyBoardDevice.canRunScript">canRunScript</a></td>
119 <td>Public method to determine, if a script can be executed.</td>
120 </tr>
121 <tr>
122 <td><a href="#PyBoardDevice.canStartFileManager">canStartFileManager</a></td>
123 <td>Public method to determine, if a File Manager can be started.</td>
124 </tr>
125 <tr>
126 <td><a href="#PyBoardDevice.canStartPlotter">canStartPlotter</a></td>
127 <td>Public method to determine, if a Plotter can be started.</td>
128 </tr>
129 <tr>
130 <td><a href="#PyBoardDevice.canStartRepl">canStartRepl</a></td>
131 <td>Public method to determine, if a REPL can be started.</td>
132 </tr>
133 <tr>
134 <td><a href="#PyBoardDevice.deviceName">deviceName</a></td>
135 <td>Public method to get the name of the device.</td>
136 </tr>
137 <tr>
138 <td><a href="#PyBoardDevice.forceInterrupt">forceInterrupt</a></td>
139 <td>Public method to determine the need for an interrupt when opening the serial connection.</td>
140 </tr>
141 <tr>
142 <td><a href="#PyBoardDevice.getDocumentationUrl">getDocumentationUrl</a></td>
143 <td>Public method to get the device documentation URL.</td>
144 </tr>
145 <tr>
146 <td><a href="#PyBoardDevice.getFirmwareUrl">getFirmwareUrl</a></td>
147 <td>Public method to get the device firmware download URL.</td>
148 </tr>
149 <tr>
150 <td><a href="#PyBoardDevice.getWorkspace">getWorkspace</a></td>
151 <td>Public method to get the workspace directory.</td>
152 </tr>
153 <tr>
154 <td><a href="#PyBoardDevice.hasFlashMenuEntry">hasFlashMenuEntry</a></td>
155 <td>Public method to check, if the device has its own flash menu entry.</td>
156 </tr>
157 <tr>
158 <td><a href="#PyBoardDevice.runScript">runScript</a></td>
159 <td>Public method to run the given Python script.</td>
160 </tr>
161 <tr>
162 <td><a href="#PyBoardDevice.setButtons">setButtons</a></td>
163 <td>Public method to enable the supported action buttons.</td>
164 </tr>
165 <tr>
166 <td><a href="#PyBoardDevice.supportsLocalFileAccess">supportsLocalFileAccess</a></td>
167 <td>Public method to indicate file access via a local directory.</td>
168 </tr>
169 </table>
170 <h3>Static Methods</h3>
171
172 <table>
173 <tr><td>None</td></tr>
174 </table>
175
176 <a NAME="PyBoardDevice.__init__" ID="PyBoardDevice.__init__"></a>
177 <h4>PyBoardDevice (Constructor)</h4>
178 <b>PyBoardDevice</b>(<i>microPythonWidget, deviceType, parent=None</i>)
179
180 <p>
181 Constructor
182 </p>
183 <dl>
184
185 <dt><i>microPythonWidget</i> (MicroPythonWidget)</dt>
186 <dd>
187 reference to the main MicroPython widget
188 </dd>
189 <dt><i>deviceType</i> (str)</dt>
190 <dd>
191 device type assigned to this device interface
192 </dd>
193 <dt><i>parent</i> (QObject)</dt>
194 <dd>
195 reference to the parent object
196 </dd>
197 </dl>
198 <a NAME="PyBoardDevice.__activateBootloader" ID="PyBoardDevice.__activateBootloader"></a>
199 <h4>PyBoardDevice.__activateBootloader</h4>
200 <b>__activateBootloader</b>(<i></i>)
201
202 <p>
203 Private slot to activate the bootloader and disconnect.
204 </p>
205 <a NAME="PyBoardDevice.__createPyboardMenu" ID="PyBoardDevice.__createPyboardMenu"></a>
206 <h4>PyBoardDevice.__createPyboardMenu</h4>
207 <b>__createPyboardMenu</b>(<i></i>)
208
209 <p>
210 Private method to create the pyboard submenu.
211 </p>
212 <a NAME="PyBoardDevice.__deviceVolumeMounted" ID="PyBoardDevice.__deviceVolumeMounted"></a>
213 <h4>PyBoardDevice.__deviceVolumeMounted</h4>
214 <b>__deviceVolumeMounted</b>(<i></i>)
215
216 <p>
217 Private method to check, if the device volume is mounted.
218 </p>
219 <dl>
220 <dt>Return:</dt>
221 <dd>
222 flag indicated a mounted device
223 </dd>
224 </dl>
225 <dl>
226 <dt>Return Type:</dt>
227 <dd>
228 bool
229 </dd>
230 </dl>
231 <a NAME="PyBoardDevice.__dfuUtilAvailable" ID="PyBoardDevice.__dfuUtilAvailable"></a>
232 <h4>PyBoardDevice.__dfuUtilAvailable</h4>
233 <b>__dfuUtilAvailable</b>(<i></i>)
234
235 <p>
236 Private method to check the availability of dfu-util.
237 </p>
238 <dl>
239 <dt>Return:</dt>
240 <dd>
241 flag indicating the availability of dfu-util
242 </dd>
243 </dl>
244 <dl>
245 <dt>Return Type:</dt>
246 <dd>
247 bool
248 </dd>
249 </dl>
250 <a NAME="PyBoardDevice.__findWorkspace" ID="PyBoardDevice.__findWorkspace"></a>
251 <h4>PyBoardDevice.__findWorkspace</h4>
252 <b>__findWorkspace</b>(<i>silent=False</i>)
253
254 <p>
255 Private method to find the workspace directory.
256 </p>
257 <dl>
258
259 <dt><i>silent</i> (bool)</dt>
260 <dd>
261 flag indicating silent operations
262 </dd>
263 </dl>
264 <dl>
265 <dt>Return:</dt>
266 <dd>
267 workspace directory used for saving files
268 </dd>
269 </dl>
270 <dl>
271 <dt>Return Type:</dt>
272 <dd>
273 str
274 </dd>
275 </dl>
276 <a NAME="PyBoardDevice.__firmwareVersionResponse" ID="PyBoardDevice.__firmwareVersionResponse"></a>
277 <h4>PyBoardDevice.__firmwareVersionResponse</h4>
278 <b>__firmwareVersionResponse</b>(<i>reply</i>)
279
280 <p>
281 Private method handling the response of the latest version request.
282 </p>
283 <dl>
284
285 <dt><i>reply</i> (QNetworkReply)</dt>
286 <dd>
287 reference to the reply object
288 </dd>
289 </dl>
290 <a NAME="PyBoardDevice.__flashMicroPython" ID="PyBoardDevice.__flashMicroPython"></a>
291 <h4>PyBoardDevice.__flashMicroPython</h4>
292 <b>__flashMicroPython</b>(<i></i>)
293
294 <p>
295 Private slot to flash a MicroPython firmware.
296 </p>
297 <a NAME="PyBoardDevice.__listDfuCapableDevices" ID="PyBoardDevice.__listDfuCapableDevices"></a>
298 <h4>PyBoardDevice.__listDfuCapableDevices</h4>
299 <b>__listDfuCapableDevices</b>(<i></i>)
300
301 <p>
302 Private slot to list all DFU-capable devices.
303 </p>
304 <a NAME="PyBoardDevice.__showDfuDisableInstructions" ID="PyBoardDevice.__showDfuDisableInstructions"></a>
305 <h4>PyBoardDevice.__showDfuDisableInstructions</h4>
306 <b>__showDfuDisableInstructions</b>(<i></i>)
307
308 <p>
309 Private method to show some instructions to disable the DFU mode.
310 </p>
311 <a NAME="PyBoardDevice.__showDfuEnableInstructions" ID="PyBoardDevice.__showDfuEnableInstructions"></a>
312 <h4>PyBoardDevice.__showDfuEnableInstructions</h4>
313 <b>__showDfuEnableInstructions</b>(<i>flash=True</i>)
314
315 <p>
316 Private method to show some instructions to enable the DFU mode.
317 </p>
318 <dl>
319
320 <dt><i>flash</i> (bool)</dt>
321 <dd>
322 flag indicating to show a warning message for flashing
323 </dd>
324 </dl>
325 <dl>
326 <dt>Return:</dt>
327 <dd>
328 flag indicating OK to continue or abort
329 </dd>
330 </dl>
331 <dl>
332 <dt>Return Type:</dt>
333 <dd>
334 bool
335 </dd>
336 </dl>
337 <a NAME="PyBoardDevice.__showFirmwareVersions" ID="PyBoardDevice.__showFirmwareVersions"></a>
338 <h4>PyBoardDevice.__showFirmwareVersions</h4>
339 <b>__showFirmwareVersions</b>(<i></i>)
340
341 <p>
342 Private slot to show the firmware version of the connected device and the
343 available firmware version.
344 </p>
345 <a NAME="PyBoardDevice.__showFlashInstructions" ID="PyBoardDevice.__showFlashInstructions"></a>
346 <h4>PyBoardDevice.__showFlashInstructions</h4>
347 <b>__showFlashInstructions</b>(<i></i>)
348
349 <p>
350 Private slot to open the URL containing instructions for installing
351 MicroPython on the pyboard.
352 </p>
353 <a NAME="PyBoardDevice.addDeviceMenuEntries" ID="PyBoardDevice.addDeviceMenuEntries"></a>
354 <h4>PyBoardDevice.addDeviceMenuEntries</h4>
355 <b>addDeviceMenuEntries</b>(<i>menu</i>)
356
357 <p>
358 Public method to add device specific entries to the given menu.
359 </p>
360 <dl>
361
362 <dt><i>menu</i> (QMenu)</dt>
363 <dd>
364 reference to the context menu
365 </dd>
366 </dl>
367 <a NAME="PyBoardDevice.canRunScript" ID="PyBoardDevice.canRunScript"></a>
368 <h4>PyBoardDevice.canRunScript</h4>
369 <b>canRunScript</b>(<i></i>)
370
371 <p>
372 Public method to determine, if a script can be executed.
373 </p>
374 <dl>
375 <dt>Return:</dt>
376 <dd>
377 tuple containing a flag indicating it is safe to start a
378 Plotter and a reason why it cannot.
379 </dd>
380 </dl>
381 <dl>
382 <dt>Return Type:</dt>
383 <dd>
384 tuple of (bool, str)
385 </dd>
386 </dl>
387 <a NAME="PyBoardDevice.canStartFileManager" ID="PyBoardDevice.canStartFileManager"></a>
388 <h4>PyBoardDevice.canStartFileManager</h4>
389 <b>canStartFileManager</b>(<i></i>)
390
391 <p>
392 Public method to determine, if a File Manager can be started.
393 </p>
394 <dl>
395 <dt>Return:</dt>
396 <dd>
397 tuple containing a flag indicating it is safe to start a
398 File Manager and a reason why it cannot.
399 </dd>
400 </dl>
401 <dl>
402 <dt>Return Type:</dt>
403 <dd>
404 tuple of (bool, str)
405 </dd>
406 </dl>
407 <a NAME="PyBoardDevice.canStartPlotter" ID="PyBoardDevice.canStartPlotter"></a>
408 <h4>PyBoardDevice.canStartPlotter</h4>
409 <b>canStartPlotter</b>(<i></i>)
410
411 <p>
412 Public method to determine, if a Plotter can be started.
413 </p>
414 <dl>
415 <dt>Return:</dt>
416 <dd>
417 tuple containing a flag indicating it is safe to start a
418 Plotter and a reason why it cannot.
419 </dd>
420 </dl>
421 <dl>
422 <dt>Return Type:</dt>
423 <dd>
424 tuple of (bool, str)
425 </dd>
426 </dl>
427 <a NAME="PyBoardDevice.canStartRepl" ID="PyBoardDevice.canStartRepl"></a>
428 <h4>PyBoardDevice.canStartRepl</h4>
429 <b>canStartRepl</b>(<i></i>)
430
431 <p>
432 Public method to determine, if a REPL can be started.
433 </p>
434 <dl>
435 <dt>Return:</dt>
436 <dd>
437 tuple containing a flag indicating it is safe to start a REPL
438 and a reason why it cannot.
439 </dd>
440 </dl>
441 <dl>
442 <dt>Return Type:</dt>
443 <dd>
444 tuple of (bool, str)
445 </dd>
446 </dl>
447 <a NAME="PyBoardDevice.deviceName" ID="PyBoardDevice.deviceName"></a>
448 <h4>PyBoardDevice.deviceName</h4>
449 <b>deviceName</b>(<i></i>)
450
451 <p>
452 Public method to get the name of the device.
453 </p>
454 <dl>
455 <dt>Return:</dt>
456 <dd>
457 name of the device
458 </dd>
459 </dl>
460 <dl>
461 <dt>Return Type:</dt>
462 <dd>
463 str
464 </dd>
465 </dl>
466 <a NAME="PyBoardDevice.forceInterrupt" ID="PyBoardDevice.forceInterrupt"></a>
467 <h4>PyBoardDevice.forceInterrupt</h4>
468 <b>forceInterrupt</b>(<i></i>)
469
470 <p>
471 Public method to determine the need for an interrupt when opening the
472 serial connection.
473 </p>
474 <dl>
475 <dt>Return:</dt>
476 <dd>
477 flag indicating an interrupt is needed
478 </dd>
479 </dl>
480 <dl>
481 <dt>Return Type:</dt>
482 <dd>
483 bool
484 </dd>
485 </dl>
486 <a NAME="PyBoardDevice.getDocumentationUrl" ID="PyBoardDevice.getDocumentationUrl"></a>
487 <h4>PyBoardDevice.getDocumentationUrl</h4>
488 <b>getDocumentationUrl</b>(<i></i>)
489
490 <p>
491 Public method to get the device documentation URL.
492 </p>
493 <dl>
494 <dt>Return:</dt>
495 <dd>
496 documentation URL of the device
497 </dd>
498 </dl>
499 <dl>
500 <dt>Return Type:</dt>
501 <dd>
502 str
503 </dd>
504 </dl>
505 <a NAME="PyBoardDevice.getFirmwareUrl" ID="PyBoardDevice.getFirmwareUrl"></a>
506 <h4>PyBoardDevice.getFirmwareUrl</h4>
507 <b>getFirmwareUrl</b>(<i></i>)
508
509 <p>
510 Public method to get the device firmware download URL.
511 </p>
512 <dl>
513 <dt>Return:</dt>
514 <dd>
515 firmware download URL of the device
516 </dd>
517 </dl>
518 <dl>
519 <dt>Return Type:</dt>
520 <dd>
521 str
522 </dd>
523 </dl>
524 <a NAME="PyBoardDevice.getWorkspace" ID="PyBoardDevice.getWorkspace"></a>
525 <h4>PyBoardDevice.getWorkspace</h4>
526 <b>getWorkspace</b>(<i>silent=False</i>)
527
528 <p>
529 Public method to get the workspace directory.
530 </p>
531 <dl>
532
533 <dt><i>silent</i> (bool)</dt>
534 <dd>
535 flag indicating silent operations
536 </dd>
537 </dl>
538 <dl>
539 <dt>Return:</dt>
540 <dd>
541 workspace directory used for saving files
542 </dd>
543 </dl>
544 <dl>
545 <dt>Return Type:</dt>
546 <dd>
547 str
548 </dd>
549 </dl>
550 <a NAME="PyBoardDevice.hasFlashMenuEntry" ID="PyBoardDevice.hasFlashMenuEntry"></a>
551 <h4>PyBoardDevice.hasFlashMenuEntry</h4>
552 <b>hasFlashMenuEntry</b>(<i></i>)
553
554 <p>
555 Public method to check, if the device has its own flash menu entry.
556 </p>
557 <dl>
558 <dt>Return:</dt>
559 <dd>
560 flag indicating a specific flash menu entry
561 </dd>
562 </dl>
563 <dl>
564 <dt>Return Type:</dt>
565 <dd>
566 bool
567 </dd>
568 </dl>
569 <a NAME="PyBoardDevice.runScript" ID="PyBoardDevice.runScript"></a>
570 <h4>PyBoardDevice.runScript</h4>
571 <b>runScript</b>(<i>script</i>)
572
573 <p>
574 Public method to run the given Python script.
575 </p>
576 <dl>
577
578 <dt><i>script</i> (str)</dt>
579 <dd>
580 script to be executed
581 </dd>
582 </dl>
583 <a NAME="PyBoardDevice.setButtons" ID="PyBoardDevice.setButtons"></a>
584 <h4>PyBoardDevice.setButtons</h4>
585 <b>setButtons</b>(<i></i>)
586
587 <p>
588 Public method to enable the supported action buttons.
589 </p>
590 <a NAME="PyBoardDevice.supportsLocalFileAccess" ID="PyBoardDevice.supportsLocalFileAccess"></a>
591 <h4>PyBoardDevice.supportsLocalFileAccess</h4>
592 <b>supportsLocalFileAccess</b>(<i></i>)
593
594 <p>
595 Public method to indicate file access via a local directory.
596 </p>
597 <dl>
598 <dt>Return:</dt>
599 <dd>
600 flag indicating file access via local directory
601 </dd>
602 </dl>
603 <dl>
604 <dt>Return Type:</dt>
605 <dd>
606 bool
607 </dd>
608 </dl>
609 <div align="right"><a href="#top">Up</a></div>
610 <hr />
611 <hr />
612 <a NAME="createDevice" ID="createDevice"></a>
613 <h2>createDevice</h2>
614 <b>createDevice</b>(<i>microPythonWidget, deviceType, vid, pid, boardName, serialNumber</i>)
615
616 <p>
617 Function to instantiate a MicroPython device object.
618 </p>
619 <dl>
620
621 <dt><i>microPythonWidget</i> (MicroPythonWidget)</dt>
622 <dd>
623 reference to the main MicroPython widget
624 </dd>
625 <dt><i>deviceType</i> (str)</dt>
626 <dd>
627 device type assigned to this device interface
628 </dd>
629 <dt><i>vid</i> (int)</dt>
630 <dd>
631 vendor ID
632 </dd>
633 <dt><i>pid</i> (int)</dt>
634 <dd>
635 product ID
636 </dd>
637 <dt><i>boardName</i> (str)</dt>
638 <dd>
639 name of the board
640 </dd>
641 <dt><i>serialNumber</i> (str)</dt>
642 <dd>
643 serial number of the board
644 </dd>
645 </dl>
646 <dl>
647 <dt>Return:</dt>
648 <dd>
649 reference to the instantiated device object
650 </dd>
651 </dl>
652 <dl>
653 <dt>Return Type:</dt>
654 <dd>
655 PyBoardDevice
656 </dd>
657 </dl>
658 <div align="right"><a href="#top">Up</a></div>
659 <hr />
660 </body></html>

eric ide

mercurial