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