|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.MicroPython.UF2FlashDialog</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.UF2FlashDialog</h1> |
|
24 |
|
25 <p> |
|
26 Module implementing a dialog to flash any UF2 capable device. |
|
27 </p> |
|
28 <h3>Global Attributes</h3> |
|
29 |
|
30 <table> |
|
31 <tr><td>SupportedUF2Boards</td></tr> |
|
32 </table> |
|
33 <h3>Classes</h3> |
|
34 |
|
35 <table> |
|
36 |
|
37 <tr> |
|
38 <td><a href="#UF2FlashDialog">UF2FlashDialog</a></td> |
|
39 <td>Class implementing a dialog to flash any UF2 capable device.</td> |
|
40 </tr> |
|
41 </table> |
|
42 <h3>Functions</h3> |
|
43 |
|
44 <table> |
|
45 |
|
46 <tr> |
|
47 <td><a href="#getFoundDevices">getFoundDevices</a></td> |
|
48 <td>Function to get the list of known serial devices supporting UF2.</td> |
|
49 </tr> |
|
50 </table> |
|
51 <hr /> |
|
52 <hr /> |
|
53 <a NAME="UF2FlashDialog" ID="UF2FlashDialog"></a> |
|
54 <h2>UF2FlashDialog</h2> |
|
55 |
|
56 <p> |
|
57 Class implementing a dialog to flash any UF2 capable device. |
|
58 </p> |
|
59 <h3>Derived from</h3> |
|
60 QDialog, Ui_UF2FlashDialog |
|
61 <h3>Class Attributes</h3> |
|
62 |
|
63 <table> |
|
64 <tr><td>DeviceTypeRole</td></tr><tr><td>DeviceVidPidRole</td></tr> |
|
65 </table> |
|
66 <h3>Class Methods</h3> |
|
67 |
|
68 <table> |
|
69 <tr><td>None</td></tr> |
|
70 </table> |
|
71 <h3>Methods</h3> |
|
72 |
|
73 <table> |
|
74 |
|
75 <tr> |
|
76 <td><a href="#UF2FlashDialog.__init__">UF2FlashDialog</a></td> |
|
77 <td>Constructor</td> |
|
78 </tr> |
|
79 <tr> |
|
80 <td><a href="#UF2FlashDialog.__populate">__populate</a></td> |
|
81 <td>Private method to (re-)populate the dialog.</td> |
|
82 </tr> |
|
83 <tr> |
|
84 <td><a href="#UF2FlashDialog.__showAllInstructions">__showAllInstructions</a></td> |
|
85 <td>Private method to show instructions for resetting devices to bootloader mode.</td> |
|
86 </tr> |
|
87 <tr> |
|
88 <td><a href="#UF2FlashDialog.__showManualInstructions">__showManualInstructions</a></td> |
|
89 <td>Private method to show instructions for flashing devices manually.</td> |
|
90 </tr> |
|
91 <tr> |
|
92 <td><a href="#UF2FlashDialog.__showMultipleVolumesInformation">__showMultipleVolumesInformation</a></td> |
|
93 <td>Private method to show information because multiple devices of the same type are ready for flashing.</td> |
|
94 </tr> |
|
95 <tr> |
|
96 <td><a href="#UF2FlashDialog.__showNoVolumeInformation">__showNoVolumeInformation</a></td> |
|
97 <td>Private method to show information about the expected boot volume(s).</td> |
|
98 </tr> |
|
99 <tr> |
|
100 <td><a href="#UF2FlashDialog.__showSpecificInstructions">__showSpecificInstructions</a></td> |
|
101 <td>Private method to show instructions for resetting devices to bootloader mode for a list of detected devices.</td> |
|
102 </tr> |
|
103 <tr> |
|
104 <td><a href="#UF2FlashDialog.__showTypedInstructions">__showTypedInstructions</a></td> |
|
105 <td>Private method to show instructions for resetting devices to bootloader mode for a specific board type.</td> |
|
106 </tr> |
|
107 <tr> |
|
108 <td><a href="#UF2FlashDialog.__updateFlashButton">__updateFlashButton</a></td> |
|
109 <td>Private method to update the state of the Flash button and the retest button.</td> |
|
110 </tr> |
|
111 <tr> |
|
112 <td><a href="#UF2FlashDialog.on_bootPicker_textChanged">on_bootPicker_textChanged</a></td> |
|
113 <td>Private slot handling a change of the boot volume.</td> |
|
114 </tr> |
|
115 <tr> |
|
116 <td><a href="#UF2FlashDialog.on_devicesComboBox_currentIndexChanged">on_devicesComboBox_currentIndexChanged</a></td> |
|
117 <td>Private slot to handle the selection of a board.</td> |
|
118 </tr> |
|
119 <tr> |
|
120 <td><a href="#UF2FlashDialog.on_firmwarePicker_textChanged">on_firmwarePicker_textChanged</a></td> |
|
121 <td>Private slot handling a change of the firmware file.</td> |
|
122 </tr> |
|
123 <tr> |
|
124 <td><a href="#UF2FlashDialog.on_flashButton_clicked">on_flashButton_clicked</a></td> |
|
125 <td>Private slot to flash the selected MicroPython or CircuitPython firmware onto the device.</td> |
|
126 </tr> |
|
127 <tr> |
|
128 <td><a href="#UF2FlashDialog.on_refreshButton_clicked">on_refreshButton_clicked</a></td> |
|
129 <td>Private slot to refresh the dialog.</td> |
|
130 </tr> |
|
131 </table> |
|
132 <h3>Static Methods</h3> |
|
133 |
|
134 <table> |
|
135 <tr><td>None</td></tr> |
|
136 </table> |
|
137 |
|
138 <a NAME="UF2FlashDialog.__init__" ID="UF2FlashDialog.__init__"></a> |
|
139 <h4>UF2FlashDialog (Constructor)</h4> |
|
140 <b>UF2FlashDialog</b>(<i>boardType="", parent=None</i>) |
|
141 |
|
142 <p> |
|
143 Constructor |
|
144 </p> |
|
145 <dl> |
|
146 |
|
147 <dt><i>boardType</i> (str)</dt> |
|
148 <dd> |
|
149 specific board type to show the dialog for |
|
150 </dd> |
|
151 <dt><i>parent</i> (QWidget (optional))</dt> |
|
152 <dd> |
|
153 reference to the parent widget (defaults to None) |
|
154 </dd> |
|
155 </dl> |
|
156 <a NAME="UF2FlashDialog.__populate" ID="UF2FlashDialog.__populate"></a> |
|
157 <h4>UF2FlashDialog.__populate</h4> |
|
158 <b>__populate</b>(<i></i>) |
|
159 |
|
160 <p> |
|
161 Private method to (re-)populate the dialog. |
|
162 </p> |
|
163 <a NAME="UF2FlashDialog.__showAllInstructions" ID="UF2FlashDialog.__showAllInstructions"></a> |
|
164 <h4>UF2FlashDialog.__showAllInstructions</h4> |
|
165 <b>__showAllInstructions</b>(<i></i>) |
|
166 |
|
167 <p> |
|
168 Private method to show instructions for resetting devices to bootloader |
|
169 mode. |
|
170 </p> |
|
171 <a NAME="UF2FlashDialog.__showManualInstructions" ID="UF2FlashDialog.__showManualInstructions"></a> |
|
172 <h4>UF2FlashDialog.__showManualInstructions</h4> |
|
173 <b>__showManualInstructions</b>(<i></i>) |
|
174 |
|
175 <p> |
|
176 Private method to show instructions for flashing devices manually. |
|
177 </p> |
|
178 <a NAME="UF2FlashDialog.__showMultipleVolumesInformation" ID="UF2FlashDialog.__showMultipleVolumesInformation"></a> |
|
179 <h4>UF2FlashDialog.__showMultipleVolumesInformation</h4> |
|
180 <b>__showMultipleVolumesInformation</b>(<i>volumePaths</i>) |
|
181 |
|
182 <p> |
|
183 Private method to show information because multiple devices of the |
|
184 same type are ready for flashing. |
|
185 </p> |
|
186 <p> |
|
187 Note: This is a dangerous situation! |
|
188 </p> |
|
189 <dl> |
|
190 |
|
191 <dt><i>volumePaths</i> (list of str)</dt> |
|
192 <dd> |
|
193 list of volume paths |
|
194 </dd> |
|
195 </dl> |
|
196 <a NAME="UF2FlashDialog.__showNoVolumeInformation" ID="UF2FlashDialog.__showNoVolumeInformation"></a> |
|
197 <h4>UF2FlashDialog.__showNoVolumeInformation</h4> |
|
198 <b>__showNoVolumeInformation</b>(<i>volumes, boardType</i>) |
|
199 |
|
200 <p> |
|
201 Private method to show information about the expected boot volume(s). |
|
202 </p> |
|
203 <dl> |
|
204 |
|
205 <dt><i>volumes</i> (list of str)</dt> |
|
206 <dd> |
|
207 list of expected volume names |
|
208 </dd> |
|
209 <dt><i>boardType</i> (str)</dt> |
|
210 <dd> |
|
211 type of the board to show instructions for |
|
212 </dd> |
|
213 </dl> |
|
214 <a NAME="UF2FlashDialog.__showSpecificInstructions" ID="UF2FlashDialog.__showSpecificInstructions"></a> |
|
215 <h4>UF2FlashDialog.__showSpecificInstructions</h4> |
|
216 <b>__showSpecificInstructions</b>(<i>devices</i>) |
|
217 |
|
218 <p> |
|
219 Private method to show instructions for resetting devices to bootloader |
|
220 mode for a list of detected devices. |
|
221 </p> |
|
222 <dl> |
|
223 |
|
224 <dt><i>devices</i> (list of str)</dt> |
|
225 <dd> |
|
226 list of detected devices |
|
227 </dd> |
|
228 </dl> |
|
229 <a NAME="UF2FlashDialog.__showTypedInstructions" ID="UF2FlashDialog.__showTypedInstructions"></a> |
|
230 <h4>UF2FlashDialog.__showTypedInstructions</h4> |
|
231 <b>__showTypedInstructions</b>(<i>boardType</i>) |
|
232 |
|
233 <p> |
|
234 Private method to show instructions for resetting devices to bootloader |
|
235 mode for a specific board type. |
|
236 </p> |
|
237 <dl> |
|
238 |
|
239 <dt><i>boardType</i> (str)</dt> |
|
240 <dd> |
|
241 type of the board to show instructions for |
|
242 </dd> |
|
243 </dl> |
|
244 <a NAME="UF2FlashDialog.__updateFlashButton" ID="UF2FlashDialog.__updateFlashButton"></a> |
|
245 <h4>UF2FlashDialog.__updateFlashButton</h4> |
|
246 <b>__updateFlashButton</b>(<i></i>) |
|
247 |
|
248 <p> |
|
249 Private method to update the state of the Flash button and the retest |
|
250 button. |
|
251 </p> |
|
252 <a NAME="UF2FlashDialog.on_bootPicker_textChanged" ID="UF2FlashDialog.on_bootPicker_textChanged"></a> |
|
253 <h4>UF2FlashDialog.on_bootPicker_textChanged</h4> |
|
254 <b>on_bootPicker_textChanged</b>(<i>text</i>) |
|
255 |
|
256 <p> |
|
257 Private slot handling a change of the boot volume. |
|
258 </p> |
|
259 <dl> |
|
260 |
|
261 <dt><i>text</i> (str)</dt> |
|
262 <dd> |
|
263 current text of the boot volume edit |
|
264 </dd> |
|
265 </dl> |
|
266 <a NAME="UF2FlashDialog.on_devicesComboBox_currentIndexChanged" ID="UF2FlashDialog.on_devicesComboBox_currentIndexChanged"></a> |
|
267 <h4>UF2FlashDialog.on_devicesComboBox_currentIndexChanged</h4> |
|
268 <b>on_devicesComboBox_currentIndexChanged</b>(<i>index</i>) |
|
269 |
|
270 <p> |
|
271 Private slot to handle the selection of a board. |
|
272 </p> |
|
273 <dl> |
|
274 |
|
275 <dt><i>index</i> (int)</dt> |
|
276 <dd> |
|
277 selected index |
|
278 </dd> |
|
279 </dl> |
|
280 <a NAME="UF2FlashDialog.on_firmwarePicker_textChanged" ID="UF2FlashDialog.on_firmwarePicker_textChanged"></a> |
|
281 <h4>UF2FlashDialog.on_firmwarePicker_textChanged</h4> |
|
282 <b>on_firmwarePicker_textChanged</b>(<i>text</i>) |
|
283 |
|
284 <p> |
|
285 Private slot handling a change of the firmware file. |
|
286 </p> |
|
287 <dl> |
|
288 |
|
289 <dt><i>text</i> (str)</dt> |
|
290 <dd> |
|
291 current text of the firmware edit |
|
292 </dd> |
|
293 </dl> |
|
294 <a NAME="UF2FlashDialog.on_flashButton_clicked" ID="UF2FlashDialog.on_flashButton_clicked"></a> |
|
295 <h4>UF2FlashDialog.on_flashButton_clicked</h4> |
|
296 <b>on_flashButton_clicked</b>(<i></i>) |
|
297 |
|
298 <p> |
|
299 Private slot to flash the selected MicroPython or CircuitPython |
|
300 firmware onto the device. |
|
301 </p> |
|
302 <a NAME="UF2FlashDialog.on_refreshButton_clicked" ID="UF2FlashDialog.on_refreshButton_clicked"></a> |
|
303 <h4>UF2FlashDialog.on_refreshButton_clicked</h4> |
|
304 <b>on_refreshButton_clicked</b>(<i></i>) |
|
305 |
|
306 <p> |
|
307 Private slot to refresh the dialog. |
|
308 </p> |
|
309 <div align="right"><a href="#top">Up</a></div> |
|
310 <hr /> |
|
311 <hr /> |
|
312 <a NAME="getFoundDevices" ID="getFoundDevices"></a> |
|
313 <h2>getFoundDevices</h2> |
|
314 <b>getFoundDevices</b>(<i>boardType=""</i>) |
|
315 |
|
316 <p> |
|
317 Function to get the list of known serial devices supporting UF2. |
|
318 </p> |
|
319 <dl> |
|
320 |
|
321 <dt><i>boardType</i> (str)</dt> |
|
322 <dd> |
|
323 specific board type to search for |
|
324 </dd> |
|
325 </dl> |
|
326 <dl> |
|
327 <dt>Return:</dt> |
|
328 <dd> |
|
329 list of tuples with the board type, the port description, the |
|
330 VID and PID |
|
331 </dd> |
|
332 </dl> |
|
333 <dl> |
|
334 <dt>Return Type:</dt> |
|
335 <dd> |
|
336 list of tuple of (str, str, int, int) |
|
337 </dd> |
|
338 </dl> |
|
339 <div align="right"><a href="#top">Up</a></div> |
|
340 <hr /> |
|
341 </body></html> |