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