5 <link rel="stylesheet" href="styles.css"> |
5 <link rel="stylesheet" href="styles.css"> |
6 </head> |
6 </head> |
7 <body> |
7 <body> |
8 <a NAME="top" ID="top"></a> |
8 <a NAME="top" ID="top"></a> |
9 <h1>eric7.MicroPython.Devices.STLinkDevices</h1> |
9 <h1>eric7.MicroPython.Devices.STLinkDevices</h1> |
10 |
|
11 <p> |
10 <p> |
12 Module implementing the device interface class for STM32 STLink boards. |
11 Module implementing the device interface class for STM32 STLink boards. |
13 </p> |
12 </p> |
|
13 |
14 <h3>Global Attributes</h3> |
14 <h3>Global Attributes</h3> |
15 |
|
16 <table> |
15 <table> |
17 <tr><td>None</td></tr> |
16 <tr><td>None</td></tr> |
18 </table> |
17 </table> |
|
18 |
19 <h3>Classes</h3> |
19 <h3>Classes</h3> |
20 |
|
21 <table> |
20 <table> |
22 |
|
23 <tr> |
21 <tr> |
24 <td><a href="#STLinkDevice">STLinkDevice</a></td> |
22 <td><a href="#STLinkDevice">STLinkDevice</a></td> |
25 <td>Class implementing the device for PyBoard boards.</td> |
23 <td>Class implementing the device for PyBoard boards.</td> |
26 </tr> |
24 </tr> |
27 </table> |
25 </table> |
|
26 |
28 <h3>Functions</h3> |
27 <h3>Functions</h3> |
29 |
|
30 <table> |
28 <table> |
31 |
|
32 <tr> |
29 <tr> |
33 <td><a href="#createDevice">createDevice</a></td> |
30 <td><a href="#createDevice">createDevice</a></td> |
34 <td>Function to instantiate a MicroPython device object.</td> |
31 <td>Function to instantiate a MicroPython device object.</td> |
35 </tr> |
32 </tr> |
36 </table> |
33 </table> |
|
34 |
37 <hr /> |
35 <hr /> |
38 <hr /> |
36 <hr /> |
39 <a NAME="STLinkDevice" ID="STLinkDevice"></a> |
37 <a NAME="STLinkDevice" ID="STLinkDevice"></a> |
40 <h2>STLinkDevice</h2> |
38 <h2>STLinkDevice</h2> |
41 |
|
42 <p> |
39 <p> |
43 Class implementing the device for PyBoard boards. |
40 Class implementing the device for PyBoard boards. |
44 </p> |
41 </p> |
|
42 |
45 <h3>Derived from</h3> |
43 <h3>Derived from</h3> |
46 BaseDevice |
44 BaseDevice |
47 <h3>Class Attributes</h3> |
45 <h3>Class Attributes</h3> |
48 |
|
49 <table> |
46 <table> |
50 <tr><td>DeviceVolumeName</td></tr> |
47 <tr><td>DeviceVolumeName</td></tr> |
51 </table> |
48 </table> |
|
49 |
52 <h3>Class Methods</h3> |
50 <h3>Class Methods</h3> |
53 |
|
54 <table> |
51 <table> |
55 <tr><td>None</td></tr> |
52 <tr><td>None</td></tr> |
56 </table> |
53 </table> |
|
54 |
57 <h3>Methods</h3> |
55 <h3>Methods</h3> |
58 |
|
59 <table> |
56 <table> |
60 |
|
61 <tr> |
57 <tr> |
62 <td><a href="#STLinkDevice.__init__">STLinkDevice</a></td> |
58 <td><a href="#STLinkDevice.__init__">STLinkDevice</a></td> |
63 <td>Constructor</td> |
59 <td>Constructor</td> |
64 </tr> |
60 </tr> |
65 <tr> |
61 <tr> |
161 <tr> |
157 <tr> |
162 <td><a href="#STLinkDevice.supportsLocalFileAccess">supportsLocalFileAccess</a></td> |
158 <td><a href="#STLinkDevice.supportsLocalFileAccess">supportsLocalFileAccess</a></td> |
163 <td>Public method to indicate file access via a local directory.</td> |
159 <td>Public method to indicate file access via a local directory.</td> |
164 </tr> |
160 </tr> |
165 </table> |
161 </table> |
|
162 |
166 <h3>Static Methods</h3> |
163 <h3>Static Methods</h3> |
167 |
|
168 <table> |
164 <table> |
169 <tr><td>None</td></tr> |
165 <tr><td>None</td></tr> |
170 </table> |
166 </table> |
171 |
167 |
|
168 |
172 <a NAME="STLinkDevice.__init__" ID="STLinkDevice.__init__"></a> |
169 <a NAME="STLinkDevice.__init__" ID="STLinkDevice.__init__"></a> |
173 <h4>STLinkDevice (Constructor)</h4> |
170 <h4>STLinkDevice (Constructor)</h4> |
174 <b>STLinkDevice</b>(<i>microPythonWidget, deviceType, parent=None</i>) |
171 <b>STLinkDevice</b>(<i>microPythonWidget, deviceType, parent=None</i>) |
175 |
|
176 <p> |
172 <p> |
177 Constructor |
173 Constructor |
178 </p> |
174 </p> |
|
175 |
179 <dl> |
176 <dl> |
180 |
177 |
181 <dt><i>microPythonWidget</i> (MicroPythonWidget)</dt> |
178 <dt><i>microPythonWidget</i> (MicroPythonWidget)</dt> |
182 <dd> |
179 <dd> |
183 reference to the main MicroPython widget |
180 reference to the main MicroPython widget |
192 </dd> |
189 </dd> |
193 </dl> |
190 </dl> |
194 <a NAME="STLinkDevice.__createSTLinkMenu" ID="STLinkDevice.__createSTLinkMenu"></a> |
191 <a NAME="STLinkDevice.__createSTLinkMenu" ID="STLinkDevice.__createSTLinkMenu"></a> |
195 <h4>STLinkDevice.__createSTLinkMenu</h4> |
192 <h4>STLinkDevice.__createSTLinkMenu</h4> |
196 <b>__createSTLinkMenu</b>(<i></i>) |
193 <b>__createSTLinkMenu</b>(<i></i>) |
197 |
|
198 <p> |
194 <p> |
199 Private method to create the STLink submenu. |
195 Private method to create the STLink submenu. |
200 </p> |
196 </p> |
|
197 |
201 <a NAME="STLinkDevice.__deviceVolumeMounted" ID="STLinkDevice.__deviceVolumeMounted"></a> |
198 <a NAME="STLinkDevice.__deviceVolumeMounted" ID="STLinkDevice.__deviceVolumeMounted"></a> |
202 <h4>STLinkDevice.__deviceVolumeMounted</h4> |
199 <h4>STLinkDevice.__deviceVolumeMounted</h4> |
203 <b>__deviceVolumeMounted</b>(<i></i>) |
200 <b>__deviceVolumeMounted</b>(<i></i>) |
204 |
|
205 <p> |
201 <p> |
206 Private method to check, if the device volume is mounted. |
202 Private method to check, if the device volume is mounted. |
207 </p> |
203 </p> |
|
204 |
208 <dl> |
205 <dl> |
209 <dt>Return:</dt> |
206 <dt>Return:</dt> |
210 <dd> |
207 <dd> |
211 flag indicated a mounted device |
208 flag indicated a mounted device |
212 </dd> |
209 </dd> |
218 </dd> |
215 </dd> |
219 </dl> |
216 </dl> |
220 <a NAME="STLinkDevice.__findWorkspace" ID="STLinkDevice.__findWorkspace"></a> |
217 <a NAME="STLinkDevice.__findWorkspace" ID="STLinkDevice.__findWorkspace"></a> |
221 <h4>STLinkDevice.__findWorkspace</h4> |
218 <h4>STLinkDevice.__findWorkspace</h4> |
222 <b>__findWorkspace</b>(<i>silent=False</i>) |
219 <b>__findWorkspace</b>(<i>silent=False</i>) |
223 |
|
224 <p> |
220 <p> |
225 Private method to find the workspace directory. |
221 Private method to find the workspace directory. |
226 </p> |
222 </p> |
|
223 |
227 <dl> |
224 <dl> |
228 |
225 |
229 <dt><i>silent</i> (bool)</dt> |
226 <dt><i>silent</i> (bool)</dt> |
230 <dd> |
227 <dd> |
231 flag indicating silent operations |
228 flag indicating silent operations |
244 </dd> |
241 </dd> |
245 </dl> |
242 </dl> |
246 <a NAME="STLinkDevice.__firmwareVersionResponse" ID="STLinkDevice.__firmwareVersionResponse"></a> |
243 <a NAME="STLinkDevice.__firmwareVersionResponse" ID="STLinkDevice.__firmwareVersionResponse"></a> |
247 <h4>STLinkDevice.__firmwareVersionResponse</h4> |
244 <h4>STLinkDevice.__firmwareVersionResponse</h4> |
248 <b>__firmwareVersionResponse</b>(<i>reply</i>) |
245 <b>__firmwareVersionResponse</b>(<i>reply</i>) |
249 |
|
250 <p> |
246 <p> |
251 Private slot handling the response of the latest version request. |
247 Private slot handling the response of the latest version request. |
252 </p> |
248 </p> |
|
249 |
253 <dl> |
250 <dl> |
254 |
251 |
255 <dt><i>reply</i> (QNetworkReply)</dt> |
252 <dt><i>reply</i> (QNetworkReply)</dt> |
256 <dd> |
253 <dd> |
257 reference to the reply object |
254 reference to the reply object |
258 </dd> |
255 </dd> |
259 </dl> |
256 </dl> |
260 <a NAME="STLinkDevice.__flashMicroPython" ID="STLinkDevice.__flashMicroPython"></a> |
257 <a NAME="STLinkDevice.__flashMicroPython" ID="STLinkDevice.__flashMicroPython"></a> |
261 <h4>STLinkDevice.__flashMicroPython</h4> |
258 <h4>STLinkDevice.__flashMicroPython</h4> |
262 <b>__flashMicroPython</b>(<i></i>) |
259 <b>__flashMicroPython</b>(<i></i>) |
263 |
|
264 <p> |
260 <p> |
265 Private slot to flash a MicroPython firmware. |
261 Private slot to flash a MicroPython firmware. |
266 </p> |
262 </p> |
|
263 |
267 <a NAME="STLinkDevice.__resetDevice" ID="STLinkDevice.__resetDevice"></a> |
264 <a NAME="STLinkDevice.__resetDevice" ID="STLinkDevice.__resetDevice"></a> |
268 <h4>STLinkDevice.__resetDevice</h4> |
265 <h4>STLinkDevice.__resetDevice</h4> |
269 <b>__resetDevice</b>(<i></i>) |
266 <b>__resetDevice</b>(<i></i>) |
270 |
|
271 <p> |
267 <p> |
272 Private slot to reset the connected device. |
268 Private slot to reset the connected device. |
273 </p> |
269 </p> |
|
270 |
274 <a NAME="STLinkDevice.__showDeviceInfo" ID="STLinkDevice.__showDeviceInfo"></a> |
271 <a NAME="STLinkDevice.__showDeviceInfo" ID="STLinkDevice.__showDeviceInfo"></a> |
275 <h4>STLinkDevice.__showDeviceInfo</h4> |
272 <h4>STLinkDevice.__showDeviceInfo</h4> |
276 <b>__showDeviceInfo</b>(<i></i>) |
273 <b>__showDeviceInfo</b>(<i></i>) |
277 |
|
278 <p> |
274 <p> |
279 Private slot to show some information about connected STLink devices. |
275 Private slot to show some information about connected STLink devices. |
280 </p> |
276 </p> |
|
277 |
281 <a NAME="STLinkDevice.__showFirmwareVersions" ID="STLinkDevice.__showFirmwareVersions"></a> |
278 <a NAME="STLinkDevice.__showFirmwareVersions" ID="STLinkDevice.__showFirmwareVersions"></a> |
282 <h4>STLinkDevice.__showFirmwareVersions</h4> |
279 <h4>STLinkDevice.__showFirmwareVersions</h4> |
283 <b>__showFirmwareVersions</b>(<i></i>) |
280 <b>__showFirmwareVersions</b>(<i></i>) |
284 |
|
285 <p> |
281 <p> |
286 Private slot to show the firmware version of the connected device and the |
282 Private slot to show the firmware version of the connected device and the |
287 available firmware version. |
283 available firmware version. |
288 </p> |
284 </p> |
|
285 |
289 <a NAME="STLinkDevice.__stflashAvailable" ID="STLinkDevice.__stflashAvailable"></a> |
286 <a NAME="STLinkDevice.__stflashAvailable" ID="STLinkDevice.__stflashAvailable"></a> |
290 <h4>STLinkDevice.__stflashAvailable</h4> |
287 <h4>STLinkDevice.__stflashAvailable</h4> |
291 <b>__stflashAvailable</b>(<i></i>) |
288 <b>__stflashAvailable</b>(<i></i>) |
292 |
|
293 <p> |
289 <p> |
294 Private method to check the availability of the 'st-flash' firmware flashing |
290 Private method to check the availability of the 'st-flash' firmware flashing |
295 tool. |
291 tool. |
296 </p> |
292 </p> |
|
293 |
297 <dl> |
294 <dl> |
298 <dt>Return:</dt> |
295 <dt>Return:</dt> |
299 <dd> |
296 <dd> |
300 flag indicating the availability of the 'st-flash' firmware flashing |
297 flag indicating the availability of the 'st-flash' firmware flashing |
301 tool |
298 tool |
327 </dd> |
324 </dd> |
328 </dl> |
325 </dl> |
329 <a NAME="STLinkDevice.__stlinkToolAvailable" ID="STLinkDevice.__stlinkToolAvailable"></a> |
326 <a NAME="STLinkDevice.__stlinkToolAvailable" ID="STLinkDevice.__stlinkToolAvailable"></a> |
330 <h4>STLinkDevice.__stlinkToolAvailable</h4> |
327 <h4>STLinkDevice.__stlinkToolAvailable</h4> |
331 <b>__stlinkToolAvailable</b>(<i>toolname</i>) |
328 <b>__stlinkToolAvailable</b>(<i>toolname</i>) |
332 |
|
333 <p> |
329 <p> |
334 Private method to check the availability of the given STLink tool. |
330 Private method to check the availability of the given STLink tool. |
335 </p> |
331 </p> |
336 <p> |
332 <p> |
337 Note: supported tools are st-info and st-flash |
333 Note: supported tools are st-info and st-flash |
338 </p> |
334 </p> |
|
335 |
339 <dl> |
336 <dl> |
340 |
337 |
341 <dt><i>toolname</i> (str)</dt> |
338 <dt><i>toolname</i> (str)</dt> |
342 <dd> |
339 <dd> |
343 name of the tool to be checked |
340 name of the tool to be checked |
363 </dd> |
360 </dd> |
364 </dl> |
361 </dl> |
365 <a NAME="STLinkDevice.addDeviceMenuEntries" ID="STLinkDevice.addDeviceMenuEntries"></a> |
362 <a NAME="STLinkDevice.addDeviceMenuEntries" ID="STLinkDevice.addDeviceMenuEntries"></a> |
366 <h4>STLinkDevice.addDeviceMenuEntries</h4> |
363 <h4>STLinkDevice.addDeviceMenuEntries</h4> |
367 <b>addDeviceMenuEntries</b>(<i>menu</i>) |
364 <b>addDeviceMenuEntries</b>(<i>menu</i>) |
368 |
|
369 <p> |
365 <p> |
370 Public method to add device specific entries to the given menu. |
366 Public method to add device specific entries to the given menu. |
371 </p> |
367 </p> |
|
368 |
372 <dl> |
369 <dl> |
373 |
370 |
374 <dt><i>menu</i> (QMenu)</dt> |
371 <dt><i>menu</i> (QMenu)</dt> |
375 <dd> |
372 <dd> |
376 reference to the context menu |
373 reference to the context menu |
377 </dd> |
374 </dd> |
378 </dl> |
375 </dl> |
379 <a NAME="STLinkDevice.canRunScript" ID="STLinkDevice.canRunScript"></a> |
376 <a NAME="STLinkDevice.canRunScript" ID="STLinkDevice.canRunScript"></a> |
380 <h4>STLinkDevice.canRunScript</h4> |
377 <h4>STLinkDevice.canRunScript</h4> |
381 <b>canRunScript</b>(<i></i>) |
378 <b>canRunScript</b>(<i></i>) |
382 |
|
383 <p> |
379 <p> |
384 Public method to determine, if a script can be executed. |
380 Public method to determine, if a script can be executed. |
385 </p> |
381 </p> |
|
382 |
386 <dl> |
383 <dl> |
387 <dt>Return:</dt> |
384 <dt>Return:</dt> |
388 <dd> |
385 <dd> |
389 tuple containing a flag indicating it is safe to start a |
386 tuple containing a flag indicating it is safe to start a |
390 Plotter and a reason why it cannot. |
387 Plotter and a reason why it cannot. |
397 </dd> |
394 </dd> |
398 </dl> |
395 </dl> |
399 <a NAME="STLinkDevice.canStartFileManager" ID="STLinkDevice.canStartFileManager"></a> |
396 <a NAME="STLinkDevice.canStartFileManager" ID="STLinkDevice.canStartFileManager"></a> |
400 <h4>STLinkDevice.canStartFileManager</h4> |
397 <h4>STLinkDevice.canStartFileManager</h4> |
401 <b>canStartFileManager</b>(<i></i>) |
398 <b>canStartFileManager</b>(<i></i>) |
402 |
|
403 <p> |
399 <p> |
404 Public method to determine, if a File Manager can be started. |
400 Public method to determine, if a File Manager can be started. |
405 </p> |
401 </p> |
|
402 |
406 <dl> |
403 <dl> |
407 <dt>Return:</dt> |
404 <dt>Return:</dt> |
408 <dd> |
405 <dd> |
409 tuple containing a flag indicating it is safe to start a |
406 tuple containing a flag indicating it is safe to start a |
410 File Manager and a reason why it cannot. |
407 File Manager and a reason why it cannot. |
417 </dd> |
414 </dd> |
418 </dl> |
415 </dl> |
419 <a NAME="STLinkDevice.canStartPlotter" ID="STLinkDevice.canStartPlotter"></a> |
416 <a NAME="STLinkDevice.canStartPlotter" ID="STLinkDevice.canStartPlotter"></a> |
420 <h4>STLinkDevice.canStartPlotter</h4> |
417 <h4>STLinkDevice.canStartPlotter</h4> |
421 <b>canStartPlotter</b>(<i></i>) |
418 <b>canStartPlotter</b>(<i></i>) |
422 |
|
423 <p> |
419 <p> |
424 Public method to determine, if a Plotter can be started. |
420 Public method to determine, if a Plotter can be started. |
425 </p> |
421 </p> |
|
422 |
426 <dl> |
423 <dl> |
427 <dt>Return:</dt> |
424 <dt>Return:</dt> |
428 <dd> |
425 <dd> |
429 tuple containing a flag indicating it is safe to start a |
426 tuple containing a flag indicating it is safe to start a |
430 Plotter and a reason why it cannot. |
427 Plotter and a reason why it cannot. |
437 </dd> |
434 </dd> |
438 </dl> |
435 </dl> |
439 <a NAME="STLinkDevice.canStartRepl" ID="STLinkDevice.canStartRepl"></a> |
436 <a NAME="STLinkDevice.canStartRepl" ID="STLinkDevice.canStartRepl"></a> |
440 <h4>STLinkDevice.canStartRepl</h4> |
437 <h4>STLinkDevice.canStartRepl</h4> |
441 <b>canStartRepl</b>(<i></i>) |
438 <b>canStartRepl</b>(<i></i>) |
442 |
|
443 <p> |
439 <p> |
444 Public method to determine, if a REPL can be started. |
440 Public method to determine, if a REPL can be started. |
445 </p> |
441 </p> |
|
442 |
446 <dl> |
443 <dl> |
447 <dt>Return:</dt> |
444 <dt>Return:</dt> |
448 <dd> |
445 <dd> |
449 tuple containing a flag indicating it is safe to start a REPL |
446 tuple containing a flag indicating it is safe to start a REPL |
450 and a reason why it cannot. |
447 and a reason why it cannot. |
579 </dd> |
576 </dd> |
580 </dl> |
577 </dl> |
581 <a NAME="STLinkDevice.runScript" ID="STLinkDevice.runScript"></a> |
578 <a NAME="STLinkDevice.runScript" ID="STLinkDevice.runScript"></a> |
582 <h4>STLinkDevice.runScript</h4> |
579 <h4>STLinkDevice.runScript</h4> |
583 <b>runScript</b>(<i>script</i>) |
580 <b>runScript</b>(<i>script</i>) |
584 |
|
585 <p> |
581 <p> |
586 Public method to run the given Python script. |
582 Public method to run the given Python script. |
587 </p> |
583 </p> |
|
584 |
588 <dl> |
585 <dl> |
589 |
586 |
590 <dt><i>script</i> (str)</dt> |
587 <dt><i>script</i> (str)</dt> |
591 <dd> |
588 <dd> |
592 script to be executed |
589 script to be executed |
593 </dd> |
590 </dd> |
594 </dl> |
591 </dl> |
595 <a NAME="STLinkDevice.setButtons" ID="STLinkDevice.setButtons"></a> |
592 <a NAME="STLinkDevice.setButtons" ID="STLinkDevice.setButtons"></a> |
596 <h4>STLinkDevice.setButtons</h4> |
593 <h4>STLinkDevice.setButtons</h4> |
597 <b>setButtons</b>(<i></i>) |
594 <b>setButtons</b>(<i></i>) |
598 |
|
599 <p> |
595 <p> |
600 Public method to enable the supported action buttons. |
596 Public method to enable the supported action buttons. |
601 </p> |
597 </p> |
|
598 |
602 <a NAME="STLinkDevice.supportsLocalFileAccess" ID="STLinkDevice.supportsLocalFileAccess"></a> |
599 <a NAME="STLinkDevice.supportsLocalFileAccess" ID="STLinkDevice.supportsLocalFileAccess"></a> |
603 <h4>STLinkDevice.supportsLocalFileAccess</h4> |
600 <h4>STLinkDevice.supportsLocalFileAccess</h4> |
604 <b>supportsLocalFileAccess</b>(<i></i>) |
601 <b>supportsLocalFileAccess</b>(<i></i>) |
605 |
|
606 <p> |
602 <p> |
607 Public method to indicate file access via a local directory. |
603 Public method to indicate file access via a local directory. |
608 </p> |
604 </p> |
|
605 |
609 <dl> |
606 <dl> |
610 <dt>Return:</dt> |
607 <dt>Return:</dt> |
611 <dd> |
608 <dd> |
612 flag indicating file access via local directory |
609 flag indicating file access via local directory |
613 </dd> |
610 </dd> |
622 <hr /> |
619 <hr /> |
623 <hr /> |
620 <hr /> |
624 <a NAME="createDevice" ID="createDevice"></a> |
621 <a NAME="createDevice" ID="createDevice"></a> |
625 <h2>createDevice</h2> |
622 <h2>createDevice</h2> |
626 <b>createDevice</b>(<i>microPythonWidget, deviceType, vid, pid, boardName, serialNumber</i>) |
623 <b>createDevice</b>(<i>microPythonWidget, deviceType, vid, pid, boardName, serialNumber</i>) |
627 |
|
628 <p> |
624 <p> |
629 Function to instantiate a MicroPython device object. |
625 Function to instantiate a MicroPython device object. |
630 </p> |
626 </p> |
|
627 |
631 <dl> |
628 <dl> |
632 |
629 |
633 <dt><i>microPythonWidget</i> (MicroPythonWidget)</dt> |
630 <dt><i>microPythonWidget</i> (MicroPythonWidget)</dt> |
634 <dd> |
631 <dd> |
635 reference to the main MicroPython widget |
632 reference to the main MicroPython widget |