src/eric7/Documentation/Source/eric7.MicroPython.Devices.STLinkDevices.html

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

eric ide

mercurial