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