|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric6.MicroPython.CircuitPythonDevices</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>eric6.MicroPython.CircuitPythonDevices</h1> |
|
24 |
|
25 <p> |
|
26 Module implementing the device interface class for CircuitPython boards. |
|
27 </p> |
|
28 <h3>Global Attributes</h3> |
|
29 |
|
30 <table> |
|
31 <tr><td>None</td></tr> |
|
32 </table> |
|
33 <h3>Classes</h3> |
|
34 |
|
35 <table> |
|
36 |
|
37 <tr> |
|
38 <td><a href="#CircuitPythonDevice">CircuitPythonDevice</a></td> |
|
39 <td>Class implementing the device for CircuitPython boards.</td> |
|
40 </tr> |
|
41 </table> |
|
42 <h3>Functions</h3> |
|
43 |
|
44 <table> |
|
45 <tr><td>None</td></tr> |
|
46 </table> |
|
47 <hr /> |
|
48 <hr /> |
|
49 <a NAME="CircuitPythonDevice" ID="CircuitPythonDevice"></a> |
|
50 <h2>CircuitPythonDevice</h2> |
|
51 |
|
52 <p> |
|
53 Class implementing the device for CircuitPython boards. |
|
54 </p> |
|
55 <h3>Derived from</h3> |
|
56 MicroPythonDevice |
|
57 <h3>Class Attributes</h3> |
|
58 |
|
59 <table> |
|
60 <tr><td>DeviceVolumeName</td></tr> |
|
61 </table> |
|
62 <h3>Class Methods</h3> |
|
63 |
|
64 <table> |
|
65 <tr><td>None</td></tr> |
|
66 </table> |
|
67 <h3>Methods</h3> |
|
68 |
|
69 <table> |
|
70 |
|
71 <tr> |
|
72 <td><a href="#CircuitPythonDevice.__init__">CircuitPythonDevice</a></td> |
|
73 <td>Constructor</td> |
|
74 </tr> |
|
75 <tr> |
|
76 <td><a href="#CircuitPythonDevice.__deviceVolumeMounted">__deviceVolumeMounted</a></td> |
|
77 <td>Private method to check, if the device volume is mounted.</td> |
|
78 </tr> |
|
79 <tr> |
|
80 <td><a href="#CircuitPythonDevice.__findWorkspace">__findWorkspace</a></td> |
|
81 <td>Private method to find the workspace directory.</td> |
|
82 </tr> |
|
83 <tr> |
|
84 <td><a href="#CircuitPythonDevice.__flashCircuitPython">__flashCircuitPython</a></td> |
|
85 <td>Private slot to flash a CircuitPython firmware to the device.</td> |
|
86 </tr> |
|
87 <tr> |
|
88 <td><a href="#CircuitPythonDevice.__flashTeensy">__flashTeensy</a></td> |
|
89 <td>Private method to show a message box because Teens does not support the UF2 bootloader yet.</td> |
|
90 </tr> |
|
91 <tr> |
|
92 <td><a href="#CircuitPythonDevice.__installLibraryFiles">__installLibraryFiles</a></td> |
|
93 <td>Private slot to install Python files into the onboard library.</td> |
|
94 </tr> |
|
95 <tr> |
|
96 <td><a href="#CircuitPythonDevice.addDeviceMenuEntries">addDeviceMenuEntries</a></td> |
|
97 <td>Public method to add device specific entries to the given menu.</td> |
|
98 </tr> |
|
99 <tr> |
|
100 <td><a href="#CircuitPythonDevice.canRunScript">canRunScript</a></td> |
|
101 <td>Public method to determine, if a script can be executed.</td> |
|
102 </tr> |
|
103 <tr> |
|
104 <td><a href="#CircuitPythonDevice.canStartFileManager">canStartFileManager</a></td> |
|
105 <td>Public method to determine, if a File Manager can be started.</td> |
|
106 </tr> |
|
107 <tr> |
|
108 <td><a href="#CircuitPythonDevice.canStartPlotter">canStartPlotter</a></td> |
|
109 <td>Public method to determine, if a Plotter can be started.</td> |
|
110 </tr> |
|
111 <tr> |
|
112 <td><a href="#CircuitPythonDevice.canStartRepl">canStartRepl</a></td> |
|
113 <td>Public method to determine, if a REPL can be started.</td> |
|
114 </tr> |
|
115 <tr> |
|
116 <td><a href="#CircuitPythonDevice.deviceName">deviceName</a></td> |
|
117 <td>Public method to get the name of the device.</td> |
|
118 </tr> |
|
119 <tr> |
|
120 <td><a href="#CircuitPythonDevice.forceInterrupt">forceInterrupt</a></td> |
|
121 <td>Public method to determine the need for an interrupt when opening the serial connection.</td> |
|
122 </tr> |
|
123 <tr> |
|
124 <td><a href="#CircuitPythonDevice.getDocumentationUrl">getDocumentationUrl</a></td> |
|
125 <td>Public method to get the device documentation URL.</td> |
|
126 </tr> |
|
127 <tr> |
|
128 <td><a href="#CircuitPythonDevice.getDownloadMenuEntries">getDownloadMenuEntries</a></td> |
|
129 <td>Public method to retrieve the entries for the downloads menu.</td> |
|
130 </tr> |
|
131 <tr> |
|
132 <td><a href="#CircuitPythonDevice.getWorkspace">getWorkspace</a></td> |
|
133 <td>Public method to get the workspace directory.</td> |
|
134 </tr> |
|
135 <tr> |
|
136 <td><a href="#CircuitPythonDevice.hasFlashMenuEntry">hasFlashMenuEntry</a></td> |
|
137 <td>Public method to check, if the device has its own flash menu entry.</td> |
|
138 </tr> |
|
139 <tr> |
|
140 <td><a href="#CircuitPythonDevice.runScript">runScript</a></td> |
|
141 <td>Public method to run the given Python script.</td> |
|
142 </tr> |
|
143 <tr> |
|
144 <td><a href="#CircuitPythonDevice.setButtons">setButtons</a></td> |
|
145 <td>Public method to enable the supported action buttons.</td> |
|
146 </tr> |
|
147 <tr> |
|
148 <td><a href="#CircuitPythonDevice.supportsLocalFileAccess">supportsLocalFileAccess</a></td> |
|
149 <td>Public method to indicate file access via a local directory.</td> |
|
150 </tr> |
|
151 </table> |
|
152 <h3>Static Methods</h3> |
|
153 |
|
154 <table> |
|
155 <tr><td>None</td></tr> |
|
156 </table> |
|
157 |
|
158 <a NAME="CircuitPythonDevice.__init__" ID="CircuitPythonDevice.__init__"></a> |
|
159 <h4>CircuitPythonDevice (Constructor)</h4> |
|
160 <b>CircuitPythonDevice</b>(<i>microPythonWidget, parent=None</i>) |
|
161 |
|
162 <p> |
|
163 Constructor |
|
164 </p> |
|
165 <dl> |
|
166 |
|
167 <dt><i>microPythonWidget</i> (MicroPythonWidget)</dt> |
|
168 <dd> |
|
169 reference to the main MicroPython widget |
|
170 </dd> |
|
171 <dt><i>parent</i> (QObject)</dt> |
|
172 <dd> |
|
173 reference to the parent object |
|
174 </dd> |
|
175 </dl> |
|
176 <a NAME="CircuitPythonDevice.__deviceVolumeMounted" ID="CircuitPythonDevice.__deviceVolumeMounted"></a> |
|
177 <h4>CircuitPythonDevice.__deviceVolumeMounted</h4> |
|
178 <b>__deviceVolumeMounted</b>(<i></i>) |
|
179 |
|
180 <p> |
|
181 Private method to check, if the device volume is mounted. |
|
182 </p> |
|
183 <dl> |
|
184 <dt>Return:</dt> |
|
185 <dd> |
|
186 flag indicated a mounted device |
|
187 </dd> |
|
188 </dl> |
|
189 <dl> |
|
190 <dt>Return Type:</dt> |
|
191 <dd> |
|
192 bool |
|
193 </dd> |
|
194 </dl> |
|
195 <a NAME="CircuitPythonDevice.__findWorkspace" ID="CircuitPythonDevice.__findWorkspace"></a> |
|
196 <h4>CircuitPythonDevice.__findWorkspace</h4> |
|
197 <b>__findWorkspace</b>(<i>silent=False</i>) |
|
198 |
|
199 <p> |
|
200 Private method to find the workspace directory. |
|
201 </p> |
|
202 <dl> |
|
203 |
|
204 <dt><i>silent</i> (bool)</dt> |
|
205 <dd> |
|
206 flag indicating silent operations |
|
207 </dd> |
|
208 </dl> |
|
209 <dl> |
|
210 <dt>Return:</dt> |
|
211 <dd> |
|
212 workspace directory used for saving files |
|
213 </dd> |
|
214 </dl> |
|
215 <dl> |
|
216 <dt>Return Type:</dt> |
|
217 <dd> |
|
218 str |
|
219 </dd> |
|
220 </dl> |
|
221 <a NAME="CircuitPythonDevice.__flashCircuitPython" ID="CircuitPythonDevice.__flashCircuitPython"></a> |
|
222 <h4>CircuitPythonDevice.__flashCircuitPython</h4> |
|
223 <b>__flashCircuitPython</b>(<i></i>) |
|
224 |
|
225 <p> |
|
226 Private slot to flash a CircuitPython firmware to the device. |
|
227 </p> |
|
228 <a NAME="CircuitPythonDevice.__flashTeensy" ID="CircuitPythonDevice.__flashTeensy"></a> |
|
229 <h4>CircuitPythonDevice.__flashTeensy</h4> |
|
230 <b>__flashTeensy</b>(<i></i>) |
|
231 |
|
232 <p> |
|
233 Private method to show a message box because Teens does not support |
|
234 the UF2 bootloader yet. |
|
235 </p> |
|
236 <a NAME="CircuitPythonDevice.__installLibraryFiles" ID="CircuitPythonDevice.__installLibraryFiles"></a> |
|
237 <h4>CircuitPythonDevice.__installLibraryFiles</h4> |
|
238 <b>__installLibraryFiles</b>(<i></i>) |
|
239 |
|
240 <p> |
|
241 Private slot to install Python files into the onboard library. |
|
242 </p> |
|
243 <a NAME="CircuitPythonDevice.addDeviceMenuEntries" ID="CircuitPythonDevice.addDeviceMenuEntries"></a> |
|
244 <h4>CircuitPythonDevice.addDeviceMenuEntries</h4> |
|
245 <b>addDeviceMenuEntries</b>(<i>menu</i>) |
|
246 |
|
247 <p> |
|
248 Public method to add device specific entries to the given menu. |
|
249 </p> |
|
250 <dl> |
|
251 |
|
252 <dt><i>menu</i> (QMenu)</dt> |
|
253 <dd> |
|
254 reference to the context menu |
|
255 </dd> |
|
256 </dl> |
|
257 <a NAME="CircuitPythonDevice.canRunScript" ID="CircuitPythonDevice.canRunScript"></a> |
|
258 <h4>CircuitPythonDevice.canRunScript</h4> |
|
259 <b>canRunScript</b>(<i></i>) |
|
260 |
|
261 <p> |
|
262 Public method to determine, if a script can be executed. |
|
263 </p> |
|
264 <dl> |
|
265 <dt>Return:</dt> |
|
266 <dd> |
|
267 tuple containing a flag indicating it is safe to start a |
|
268 Plotter and a reason why it cannot. |
|
269 </dd> |
|
270 </dl> |
|
271 <dl> |
|
272 <dt>Return Type:</dt> |
|
273 <dd> |
|
274 tuple of (bool, str) |
|
275 </dd> |
|
276 </dl> |
|
277 <a NAME="CircuitPythonDevice.canStartFileManager" ID="CircuitPythonDevice.canStartFileManager"></a> |
|
278 <h4>CircuitPythonDevice.canStartFileManager</h4> |
|
279 <b>canStartFileManager</b>(<i></i>) |
|
280 |
|
281 <p> |
|
282 Public method to determine, if a File Manager can be started. |
|
283 </p> |
|
284 <dl> |
|
285 <dt>Return:</dt> |
|
286 <dd> |
|
287 tuple containing a flag indicating it is safe to start a |
|
288 File Manager and a reason why it cannot. |
|
289 </dd> |
|
290 </dl> |
|
291 <dl> |
|
292 <dt>Return Type:</dt> |
|
293 <dd> |
|
294 tuple of (bool, str) |
|
295 </dd> |
|
296 </dl> |
|
297 <a NAME="CircuitPythonDevice.canStartPlotter" ID="CircuitPythonDevice.canStartPlotter"></a> |
|
298 <h4>CircuitPythonDevice.canStartPlotter</h4> |
|
299 <b>canStartPlotter</b>(<i></i>) |
|
300 |
|
301 <p> |
|
302 Public method to determine, if a Plotter can be started. |
|
303 </p> |
|
304 <dl> |
|
305 <dt>Return:</dt> |
|
306 <dd> |
|
307 tuple containing a flag indicating it is safe to start a |
|
308 Plotter and a reason why it cannot. |
|
309 </dd> |
|
310 </dl> |
|
311 <dl> |
|
312 <dt>Return Type:</dt> |
|
313 <dd> |
|
314 tuple of (bool, str) |
|
315 </dd> |
|
316 </dl> |
|
317 <a NAME="CircuitPythonDevice.canStartRepl" ID="CircuitPythonDevice.canStartRepl"></a> |
|
318 <h4>CircuitPythonDevice.canStartRepl</h4> |
|
319 <b>canStartRepl</b>(<i></i>) |
|
320 |
|
321 <p> |
|
322 Public method to determine, if a REPL can be started. |
|
323 </p> |
|
324 <dl> |
|
325 <dt>Return:</dt> |
|
326 <dd> |
|
327 tuple containing a flag indicating it is safe to start a REPL |
|
328 and a reason why it cannot. |
|
329 </dd> |
|
330 </dl> |
|
331 <dl> |
|
332 <dt>Return Type:</dt> |
|
333 <dd> |
|
334 tuple of (bool, str) |
|
335 </dd> |
|
336 </dl> |
|
337 <a NAME="CircuitPythonDevice.deviceName" ID="CircuitPythonDevice.deviceName"></a> |
|
338 <h4>CircuitPythonDevice.deviceName</h4> |
|
339 <b>deviceName</b>(<i></i>) |
|
340 |
|
341 <p> |
|
342 Public method to get the name of the device. |
|
343 </p> |
|
344 <dl> |
|
345 <dt>Return:</dt> |
|
346 <dd> |
|
347 name of the device |
|
348 </dd> |
|
349 </dl> |
|
350 <dl> |
|
351 <dt>Return Type:</dt> |
|
352 <dd> |
|
353 str |
|
354 </dd> |
|
355 </dl> |
|
356 <a NAME="CircuitPythonDevice.forceInterrupt" ID="CircuitPythonDevice.forceInterrupt"></a> |
|
357 <h4>CircuitPythonDevice.forceInterrupt</h4> |
|
358 <b>forceInterrupt</b>(<i></i>) |
|
359 |
|
360 <p> |
|
361 Public method to determine the need for an interrupt when opening the |
|
362 serial connection. |
|
363 </p> |
|
364 <dl> |
|
365 <dt>Return:</dt> |
|
366 <dd> |
|
367 flag indicating an interrupt is needed |
|
368 </dd> |
|
369 </dl> |
|
370 <dl> |
|
371 <dt>Return Type:</dt> |
|
372 <dd> |
|
373 bool |
|
374 </dd> |
|
375 </dl> |
|
376 <a NAME="CircuitPythonDevice.getDocumentationUrl" ID="CircuitPythonDevice.getDocumentationUrl"></a> |
|
377 <h4>CircuitPythonDevice.getDocumentationUrl</h4> |
|
378 <b>getDocumentationUrl</b>(<i></i>) |
|
379 |
|
380 <p> |
|
381 Public method to get the device documentation URL. |
|
382 </p> |
|
383 <dl> |
|
384 <dt>Return:</dt> |
|
385 <dd> |
|
386 documentation URL of the device |
|
387 </dd> |
|
388 </dl> |
|
389 <dl> |
|
390 <dt>Return Type:</dt> |
|
391 <dd> |
|
392 str |
|
393 </dd> |
|
394 </dl> |
|
395 <a NAME="CircuitPythonDevice.getDownloadMenuEntries" ID="CircuitPythonDevice.getDownloadMenuEntries"></a> |
|
396 <h4>CircuitPythonDevice.getDownloadMenuEntries</h4> |
|
397 <b>getDownloadMenuEntries</b>(<i></i>) |
|
398 |
|
399 <p> |
|
400 Public method to retrieve the entries for the downloads menu. |
|
401 </p> |
|
402 <dl> |
|
403 <dt>Return:</dt> |
|
404 <dd> |
|
405 list of tuples with menu text and URL to be opened for each |
|
406 entry |
|
407 </dd> |
|
408 </dl> |
|
409 <dl> |
|
410 <dt>Return Type:</dt> |
|
411 <dd> |
|
412 list of tuple of (str, str) |
|
413 </dd> |
|
414 </dl> |
|
415 <a NAME="CircuitPythonDevice.getWorkspace" ID="CircuitPythonDevice.getWorkspace"></a> |
|
416 <h4>CircuitPythonDevice.getWorkspace</h4> |
|
417 <b>getWorkspace</b>(<i>silent=False</i>) |
|
418 |
|
419 <p> |
|
420 Public method to get the workspace directory. |
|
421 </p> |
|
422 <dl> |
|
423 |
|
424 <dt><i>silent</i> (bool)</dt> |
|
425 <dd> |
|
426 flag indicating silent operations |
|
427 </dd> |
|
428 </dl> |
|
429 <dl> |
|
430 <dt>Return:</dt> |
|
431 <dd> |
|
432 workspace directory used for saving files |
|
433 </dd> |
|
434 </dl> |
|
435 <dl> |
|
436 <dt>Return Type:</dt> |
|
437 <dd> |
|
438 str |
|
439 </dd> |
|
440 </dl> |
|
441 <a NAME="CircuitPythonDevice.hasFlashMenuEntry" ID="CircuitPythonDevice.hasFlashMenuEntry"></a> |
|
442 <h4>CircuitPythonDevice.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="CircuitPythonDevice.runScript" ID="CircuitPythonDevice.runScript"></a> |
|
461 <h4>CircuitPythonDevice.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="CircuitPythonDevice.setButtons" ID="CircuitPythonDevice.setButtons"></a> |
|
475 <h4>CircuitPythonDevice.setButtons</h4> |
|
476 <b>setButtons</b>(<i></i>) |
|
477 |
|
478 <p> |
|
479 Public method to enable the supported action buttons. |
|
480 </p> |
|
481 <a NAME="CircuitPythonDevice.supportsLocalFileAccess" ID="CircuitPythonDevice.supportsLocalFileAccess"></a> |
|
482 <h4>CircuitPythonDevice.supportsLocalFileAccess</h4> |
|
483 <b>supportsLocalFileAccess</b>(<i></i>) |
|
484 |
|
485 <p> |
|
486 Public method to indicate file access via a local directory. |
|
487 </p> |
|
488 <dl> |
|
489 <dt>Return:</dt> |
|
490 <dd> |
|
491 flag indicating file access via local directory |
|
492 </dd> |
|
493 </dl> |
|
494 <dl> |
|
495 <dt>Return Type:</dt> |
|
496 <dd> |
|
497 bool |
|
498 </dd> |
|
499 </dl> |
|
500 <div align="right"><a href="#top">Up</a></div> |
|
501 <hr /> |
|
502 </body></html> |