|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.MicroPython.RP2040Devices</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>eric7.MicroPython.RP2040Devices</h1> |
|
24 |
|
25 <p> |
|
26 Module implementing the device interface class for RP2040 based boards |
|
27 (e.g. Raspberry Pi Pico). |
|
28 </p> |
|
29 <h3>Global Attributes</h3> |
|
30 |
|
31 <table> |
|
32 <tr><td>None</td></tr> |
|
33 </table> |
|
34 <h3>Classes</h3> |
|
35 |
|
36 <table> |
|
37 |
|
38 <tr> |
|
39 <td><a href="#RP2040Device">RP2040Device</a></td> |
|
40 <td>Class implementing the device for RP2040 based boards.</td> |
|
41 </tr> |
|
42 </table> |
|
43 <h3>Functions</h3> |
|
44 |
|
45 <table> |
|
46 <tr><td>None</td></tr> |
|
47 </table> |
|
48 <hr /> |
|
49 <hr /> |
|
50 <a NAME="RP2040Device" ID="RP2040Device"></a> |
|
51 <h2>RP2040Device</h2> |
|
52 |
|
53 <p> |
|
54 Class implementing the device for RP2040 based boards. |
|
55 </p> |
|
56 <h3>Derived from</h3> |
|
57 MicroPythonDevice |
|
58 <h3>Class Attributes</h3> |
|
59 |
|
60 <table> |
|
61 <tr><td>None</td></tr> |
|
62 </table> |
|
63 <h3>Class Methods</h3> |
|
64 |
|
65 <table> |
|
66 <tr><td>None</td></tr> |
|
67 </table> |
|
68 <h3>Methods</h3> |
|
69 |
|
70 <table> |
|
71 |
|
72 <tr> |
|
73 <td><a href="#RP2040Device.__init__">RP2040Device</a></td> |
|
74 <td>Constructor</td> |
|
75 </tr> |
|
76 <tr> |
|
77 <td><a href="#RP2040Device.__activateBootloader">__activateBootloader</a></td> |
|
78 <td>Private method to switch the board into 'bootloader' mode.</td> |
|
79 </tr> |
|
80 <tr> |
|
81 <td><a href="#RP2040Device.__flashPython">__flashPython</a></td> |
|
82 <td>Private slot to flash a MicroPython firmware to the device.</td> |
|
83 </tr> |
|
84 <tr> |
|
85 <td><a href="#RP2040Device.addDeviceMenuEntries">addDeviceMenuEntries</a></td> |
|
86 <td>Public method to add device specific entries to the given menu.</td> |
|
87 </tr> |
|
88 <tr> |
|
89 <td><a href="#RP2040Device.canRunScript">canRunScript</a></td> |
|
90 <td>Public method to determine, if a script can be executed.</td> |
|
91 </tr> |
|
92 <tr> |
|
93 <td><a href="#RP2040Device.canStartFileManager">canStartFileManager</a></td> |
|
94 <td>Public method to determine, if a File Manager can be started.</td> |
|
95 </tr> |
|
96 <tr> |
|
97 <td><a href="#RP2040Device.canStartPlotter">canStartPlotter</a></td> |
|
98 <td>Public method to determine, if a Plotter can be started.</td> |
|
99 </tr> |
|
100 <tr> |
|
101 <td><a href="#RP2040Device.canStartRepl">canStartRepl</a></td> |
|
102 <td>Public method to determine, if a REPL can be started.</td> |
|
103 </tr> |
|
104 <tr> |
|
105 <td><a href="#RP2040Device.deviceName">deviceName</a></td> |
|
106 <td>Public method to get the name of the device.</td> |
|
107 </tr> |
|
108 <tr> |
|
109 <td><a href="#RP2040Device.forceInterrupt">forceInterrupt</a></td> |
|
110 <td>Public method to determine the need for an interrupt when opening the serial connection.</td> |
|
111 </tr> |
|
112 <tr> |
|
113 <td><a href="#RP2040Device.getDocumentationUrl">getDocumentationUrl</a></td> |
|
114 <td>Public method to get the device documentation URL.</td> |
|
115 </tr> |
|
116 <tr> |
|
117 <td><a href="#RP2040Device.getDownloadMenuEntries">getDownloadMenuEntries</a></td> |
|
118 <td>Public method to retrieve the entries for the downloads menu.</td> |
|
119 </tr> |
|
120 <tr> |
|
121 <td><a href="#RP2040Device.hasFlashMenuEntry">hasFlashMenuEntry</a></td> |
|
122 <td>Public method to check, if the device has its own flash menu entry.</td> |
|
123 </tr> |
|
124 <tr> |
|
125 <td><a href="#RP2040Device.runScript">runScript</a></td> |
|
126 <td>Public method to run the given Python script.</td> |
|
127 </tr> |
|
128 <tr> |
|
129 <td><a href="#RP2040Device.setButtons">setButtons</a></td> |
|
130 <td>Public method to enable the supported action buttons.</td> |
|
131 </tr> |
|
132 </table> |
|
133 <h3>Static Methods</h3> |
|
134 |
|
135 <table> |
|
136 <tr><td>None</td></tr> |
|
137 </table> |
|
138 |
|
139 <a NAME="RP2040Device.__init__" ID="RP2040Device.__init__"></a> |
|
140 <h4>RP2040Device (Constructor)</h4> |
|
141 <b>RP2040Device</b>(<i>microPythonWidget, deviceType, parent=None</i>) |
|
142 |
|
143 <p> |
|
144 Constructor |
|
145 </p> |
|
146 <dl> |
|
147 |
|
148 <dt><i>microPythonWidget</i> (MicroPythonWidget)</dt> |
|
149 <dd> |
|
150 reference to the main MicroPython widget |
|
151 </dd> |
|
152 <dt><i>deviceType</i> (str)</dt> |
|
153 <dd> |
|
154 device type assigned to this device interface |
|
155 </dd> |
|
156 <dt><i>parent</i> (QObject)</dt> |
|
157 <dd> |
|
158 reference to the parent object |
|
159 </dd> |
|
160 </dl> |
|
161 <a NAME="RP2040Device.__activateBootloader" ID="RP2040Device.__activateBootloader"></a> |
|
162 <h4>RP2040Device.__activateBootloader</h4> |
|
163 <b>__activateBootloader</b>(<i></i>) |
|
164 |
|
165 <p> |
|
166 Private method to switch the board into 'bootloader' mode. |
|
167 </p> |
|
168 <a NAME="RP2040Device.__flashPython" ID="RP2040Device.__flashPython"></a> |
|
169 <h4>RP2040Device.__flashPython</h4> |
|
170 <b>__flashPython</b>(<i></i>) |
|
171 |
|
172 <p> |
|
173 Private slot to flash a MicroPython firmware to the device. |
|
174 </p> |
|
175 <a NAME="RP2040Device.addDeviceMenuEntries" ID="RP2040Device.addDeviceMenuEntries"></a> |
|
176 <h4>RP2040Device.addDeviceMenuEntries</h4> |
|
177 <b>addDeviceMenuEntries</b>(<i>menu</i>) |
|
178 |
|
179 <p> |
|
180 Public method to add device specific entries to the given menu. |
|
181 </p> |
|
182 <dl> |
|
183 |
|
184 <dt><i>menu</i> (QMenu)</dt> |
|
185 <dd> |
|
186 reference to the context menu |
|
187 </dd> |
|
188 </dl> |
|
189 <a NAME="RP2040Device.canRunScript" ID="RP2040Device.canRunScript"></a> |
|
190 <h4>RP2040Device.canRunScript</h4> |
|
191 <b>canRunScript</b>(<i></i>) |
|
192 |
|
193 <p> |
|
194 Public method to determine, if a script can be executed. |
|
195 </p> |
|
196 <dl> |
|
197 <dt>Return:</dt> |
|
198 <dd> |
|
199 tuple containing a flag indicating it is safe to start a |
|
200 Plotter and a reason why it cannot. |
|
201 </dd> |
|
202 </dl> |
|
203 <dl> |
|
204 <dt>Return Type:</dt> |
|
205 <dd> |
|
206 tuple of (bool, str) |
|
207 </dd> |
|
208 </dl> |
|
209 <a NAME="RP2040Device.canStartFileManager" ID="RP2040Device.canStartFileManager"></a> |
|
210 <h4>RP2040Device.canStartFileManager</h4> |
|
211 <b>canStartFileManager</b>(<i></i>) |
|
212 |
|
213 <p> |
|
214 Public method to determine, if a File Manager can be started. |
|
215 </p> |
|
216 <dl> |
|
217 <dt>Return:</dt> |
|
218 <dd> |
|
219 tuple containing a flag indicating it is safe to start a |
|
220 File Manager and a reason why it cannot. |
|
221 </dd> |
|
222 </dl> |
|
223 <dl> |
|
224 <dt>Return Type:</dt> |
|
225 <dd> |
|
226 tuple of (bool, str) |
|
227 </dd> |
|
228 </dl> |
|
229 <a NAME="RP2040Device.canStartPlotter" ID="RP2040Device.canStartPlotter"></a> |
|
230 <h4>RP2040Device.canStartPlotter</h4> |
|
231 <b>canStartPlotter</b>(<i></i>) |
|
232 |
|
233 <p> |
|
234 Public method to determine, if a Plotter can be started. |
|
235 </p> |
|
236 <dl> |
|
237 <dt>Return:</dt> |
|
238 <dd> |
|
239 tuple containing a flag indicating it is safe to start a |
|
240 Plotter and a reason why it cannot. |
|
241 </dd> |
|
242 </dl> |
|
243 <dl> |
|
244 <dt>Return Type:</dt> |
|
245 <dd> |
|
246 tuple of (bool, str) |
|
247 </dd> |
|
248 </dl> |
|
249 <a NAME="RP2040Device.canStartRepl" ID="RP2040Device.canStartRepl"></a> |
|
250 <h4>RP2040Device.canStartRepl</h4> |
|
251 <b>canStartRepl</b>(<i></i>) |
|
252 |
|
253 <p> |
|
254 Public method to determine, if a REPL can be started. |
|
255 </p> |
|
256 <dl> |
|
257 <dt>Return:</dt> |
|
258 <dd> |
|
259 tuple containing a flag indicating it is safe to start a REPL |
|
260 and a reason why it cannot. |
|
261 </dd> |
|
262 </dl> |
|
263 <dl> |
|
264 <dt>Return Type:</dt> |
|
265 <dd> |
|
266 tuple of (bool, str) |
|
267 </dd> |
|
268 </dl> |
|
269 <a NAME="RP2040Device.deviceName" ID="RP2040Device.deviceName"></a> |
|
270 <h4>RP2040Device.deviceName</h4> |
|
271 <b>deviceName</b>(<i></i>) |
|
272 |
|
273 <p> |
|
274 Public method to get the name of the device. |
|
275 </p> |
|
276 <dl> |
|
277 <dt>Return:</dt> |
|
278 <dd> |
|
279 name of the device |
|
280 </dd> |
|
281 </dl> |
|
282 <dl> |
|
283 <dt>Return Type:</dt> |
|
284 <dd> |
|
285 str |
|
286 </dd> |
|
287 </dl> |
|
288 <a NAME="RP2040Device.forceInterrupt" ID="RP2040Device.forceInterrupt"></a> |
|
289 <h4>RP2040Device.forceInterrupt</h4> |
|
290 <b>forceInterrupt</b>(<i></i>) |
|
291 |
|
292 <p> |
|
293 Public method to determine the need for an interrupt when opening the |
|
294 serial connection. |
|
295 </p> |
|
296 <dl> |
|
297 <dt>Return:</dt> |
|
298 <dd> |
|
299 flag indicating an interrupt is needed |
|
300 </dd> |
|
301 </dl> |
|
302 <dl> |
|
303 <dt>Return Type:</dt> |
|
304 <dd> |
|
305 bool |
|
306 </dd> |
|
307 </dl> |
|
308 <a NAME="RP2040Device.getDocumentationUrl" ID="RP2040Device.getDocumentationUrl"></a> |
|
309 <h4>RP2040Device.getDocumentationUrl</h4> |
|
310 <b>getDocumentationUrl</b>(<i></i>) |
|
311 |
|
312 <p> |
|
313 Public method to get the device documentation URL. |
|
314 </p> |
|
315 <dl> |
|
316 <dt>Return:</dt> |
|
317 <dd> |
|
318 documentation URL of the device |
|
319 </dd> |
|
320 </dl> |
|
321 <dl> |
|
322 <dt>Return Type:</dt> |
|
323 <dd> |
|
324 str |
|
325 </dd> |
|
326 </dl> |
|
327 <a NAME="RP2040Device.getDownloadMenuEntries" ID="RP2040Device.getDownloadMenuEntries"></a> |
|
328 <h4>RP2040Device.getDownloadMenuEntries</h4> |
|
329 <b>getDownloadMenuEntries</b>(<i></i>) |
|
330 |
|
331 <p> |
|
332 Public method to retrieve the entries for the downloads menu. |
|
333 </p> |
|
334 <dl> |
|
335 <dt>Return:</dt> |
|
336 <dd> |
|
337 list of tuples with menu text and URL to be opened for each |
|
338 entry |
|
339 </dd> |
|
340 </dl> |
|
341 <dl> |
|
342 <dt>Return Type:</dt> |
|
343 <dd> |
|
344 list of tuple of (str, str) |
|
345 </dd> |
|
346 </dl> |
|
347 <a NAME="RP2040Device.hasFlashMenuEntry" ID="RP2040Device.hasFlashMenuEntry"></a> |
|
348 <h4>RP2040Device.hasFlashMenuEntry</h4> |
|
349 <b>hasFlashMenuEntry</b>(<i></i>) |
|
350 |
|
351 <p> |
|
352 Public method to check, if the device has its own flash menu entry. |
|
353 </p> |
|
354 <dl> |
|
355 <dt>Return:</dt> |
|
356 <dd> |
|
357 flag indicating a specific flash menu entry |
|
358 </dd> |
|
359 </dl> |
|
360 <dl> |
|
361 <dt>Return Type:</dt> |
|
362 <dd> |
|
363 bool |
|
364 </dd> |
|
365 </dl> |
|
366 <a NAME="RP2040Device.runScript" ID="RP2040Device.runScript"></a> |
|
367 <h4>RP2040Device.runScript</h4> |
|
368 <b>runScript</b>(<i>script</i>) |
|
369 |
|
370 <p> |
|
371 Public method to run the given Python script. |
|
372 </p> |
|
373 <dl> |
|
374 |
|
375 <dt><i>script</i> (str)</dt> |
|
376 <dd> |
|
377 script to be executed |
|
378 </dd> |
|
379 </dl> |
|
380 <a NAME="RP2040Device.setButtons" ID="RP2040Device.setButtons"></a> |
|
381 <h4>RP2040Device.setButtons</h4> |
|
382 <b>setButtons</b>(<i></i>) |
|
383 |
|
384 <p> |
|
385 Public method to enable the supported action buttons. |
|
386 </p> |
|
387 <div align="right"><a href="#top">Up</a></div> |
|
388 <hr /> |
|
389 </body></html> |