|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric6.MicroPython.CircuitPythonDevices</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><a NAME="top" ID="top"></a> |
|
22 <h1>eric6.MicroPython.CircuitPythonDevices</h1> |
|
23 <p> |
|
24 Module implementing the device interface class for CircuitPython boards. |
|
25 </p> |
|
26 <h3>Global Attributes</h3> |
|
27 <table> |
|
28 <tr><td>None</td></tr> |
|
29 </table> |
|
30 <h3>Classes</h3> |
|
31 <table> |
|
32 <tr> |
|
33 <td><a href="#CircuitPythonDevice">CircuitPythonDevice</a></td> |
|
34 <td>Class implementing the device for CircuitPython boards.</td> |
|
35 </tr> |
|
36 </table> |
|
37 <h3>Functions</h3> |
|
38 <table> |
|
39 <tr><td>None</td></tr> |
|
40 </table> |
|
41 <hr /><hr /> |
|
42 <a NAME="CircuitPythonDevice" ID="CircuitPythonDevice"></a> |
|
43 <h2>CircuitPythonDevice</h2> |
|
44 <p> |
|
45 Class implementing the device for CircuitPython boards. |
|
46 </p> |
|
47 <h3>Derived from</h3> |
|
48 MicroPythonDevice |
|
49 <h3>Class Attributes</h3> |
|
50 <table> |
|
51 <tr><td>DeviceVolumeName</td></tr> |
|
52 </table> |
|
53 <h3>Class Methods</h3> |
|
54 <table> |
|
55 <tr><td>None</td></tr> |
|
56 </table> |
|
57 <h3>Methods</h3> |
|
58 <table> |
|
59 <tr> |
|
60 <td><a href="#CircuitPythonDevice.__init__">CircuitPythonDevice</a></td> |
|
61 <td>Constructor</td> |
|
62 </tr><tr> |
|
63 <td><a href="#CircuitPythonDevice.__deviceVolumeMounted">__deviceVolumeMounted</a></td> |
|
64 <td>Private method to check, if the device volume is mounted.</td> |
|
65 </tr><tr> |
|
66 <td><a href="#CircuitPythonDevice.__flashCircuitPython">__flashCircuitPython</a></td> |
|
67 <td>Private slot to flash a CircuitPython firmware to the device.</td> |
|
68 </tr><tr> |
|
69 <td><a href="#CircuitPythonDevice.__installLibraryFiles">__installLibraryFiles</a></td> |
|
70 <td>Private slot to install Python files into the onboard library.</td> |
|
71 </tr><tr> |
|
72 <td><a href="#CircuitPythonDevice.addDeviceMenuEntries">addDeviceMenuEntries</a></td> |
|
73 <td>Public method to add device specific entries to the given menu.</td> |
|
74 </tr><tr> |
|
75 <td><a href="#CircuitPythonDevice.canRunScript">canRunScript</a></td> |
|
76 <td>Public method to determine, if a script can be executed.</td> |
|
77 </tr><tr> |
|
78 <td><a href="#CircuitPythonDevice.canStartFileManager">canStartFileManager</a></td> |
|
79 <td>Public method to determine, if a File Manager can be started.</td> |
|
80 </tr><tr> |
|
81 <td><a href="#CircuitPythonDevice.canStartPlotter">canStartPlotter</a></td> |
|
82 <td>Public method to determine, if a Plotter can be started.</td> |
|
83 </tr><tr> |
|
84 <td><a href="#CircuitPythonDevice.canStartRepl">canStartRepl</a></td> |
|
85 <td>Public method to determine, if a REPL can be started.</td> |
|
86 </tr><tr> |
|
87 <td><a href="#CircuitPythonDevice.deviceName">deviceName</a></td> |
|
88 <td>Public method to get the name of the device.</td> |
|
89 </tr><tr> |
|
90 <td><a href="#CircuitPythonDevice.forceInterrupt">forceInterrupt</a></td> |
|
91 <td>Public method to determine the need for an interrupt when opening the serial connection.</td> |
|
92 </tr><tr> |
|
93 <td><a href="#CircuitPythonDevice.getWorkspace">getWorkspace</a></td> |
|
94 <td>Public method to get the workspace directory.</td> |
|
95 </tr><tr> |
|
96 <td><a href="#CircuitPythonDevice.runScript">runScript</a></td> |
|
97 <td>Public method to run the given Python script.</td> |
|
98 </tr><tr> |
|
99 <td><a href="#CircuitPythonDevice.setButtons">setButtons</a></td> |
|
100 <td>Public method to enable the supported action buttons.</td> |
|
101 </tr><tr> |
|
102 <td><a href="#CircuitPythonDevice.supportsLocalFileAccess">supportsLocalFileAccess</a></td> |
|
103 <td>Public method to indicate file access via a local directory.</td> |
|
104 </tr> |
|
105 </table> |
|
106 <h3>Static Methods</h3> |
|
107 <table> |
|
108 <tr><td>None</td></tr> |
|
109 </table> |
|
110 <a NAME="CircuitPythonDevice.__init__" ID="CircuitPythonDevice.__init__"></a> |
|
111 <h4>CircuitPythonDevice (Constructor)</h4> |
|
112 <b>CircuitPythonDevice</b>(<i>microPythonWidget, parent=None</i>) |
|
113 <p> |
|
114 Constructor |
|
115 </p><dl> |
|
116 <dt><i>microPythonWidget</i> (MicroPythonWidget)</dt> |
|
117 <dd> |
|
118 reference to the main MicroPython widget |
|
119 </dd><dt><i>parent</i> (QObject)</dt> |
|
120 <dd> |
|
121 reference to the parent object |
|
122 </dd> |
|
123 </dl><a NAME="CircuitPythonDevice.__deviceVolumeMounted" ID="CircuitPythonDevice.__deviceVolumeMounted"></a> |
|
124 <h4>CircuitPythonDevice.__deviceVolumeMounted</h4> |
|
125 <b>__deviceVolumeMounted</b>(<i></i>) |
|
126 <p> |
|
127 Private method to check, if the device volume is mounted. |
|
128 </p><dl> |
|
129 <dt>Returns:</dt> |
|
130 <dd> |
|
131 flag indicated a mounted device |
|
132 </dd> |
|
133 </dl><dl> |
|
134 <dt>Return Type:</dt> |
|
135 <dd> |
|
136 bool |
|
137 </dd> |
|
138 </dl><a NAME="CircuitPythonDevice.__flashCircuitPython" ID="CircuitPythonDevice.__flashCircuitPython"></a> |
|
139 <h4>CircuitPythonDevice.__flashCircuitPython</h4> |
|
140 <b>__flashCircuitPython</b>(<i></i>) |
|
141 <p> |
|
142 Private slot to flash a CircuitPython firmware to the device. |
|
143 </p><a NAME="CircuitPythonDevice.__installLibraryFiles" ID="CircuitPythonDevice.__installLibraryFiles"></a> |
|
144 <h4>CircuitPythonDevice.__installLibraryFiles</h4> |
|
145 <b>__installLibraryFiles</b>(<i></i>) |
|
146 <p> |
|
147 Private slot to install Python files into the onboard library. |
|
148 </p><a NAME="CircuitPythonDevice.addDeviceMenuEntries" ID="CircuitPythonDevice.addDeviceMenuEntries"></a> |
|
149 <h4>CircuitPythonDevice.addDeviceMenuEntries</h4> |
|
150 <b>addDeviceMenuEntries</b>(<i>menu</i>) |
|
151 <p> |
|
152 Public method to add device specific entries to the given menu. |
|
153 </p><dl> |
|
154 <dt><i>menu</i> (QMenu)</dt> |
|
155 <dd> |
|
156 reference to the context menu |
|
157 </dd> |
|
158 </dl><a NAME="CircuitPythonDevice.canRunScript" ID="CircuitPythonDevice.canRunScript"></a> |
|
159 <h4>CircuitPythonDevice.canRunScript</h4> |
|
160 <b>canRunScript</b>(<i></i>) |
|
161 <p> |
|
162 Public method to determine, if a script can be executed. |
|
163 </p><dl> |
|
164 <dt>Returns:</dt> |
|
165 <dd> |
|
166 tuple containing a flag indicating it is safe to start a |
|
167 Plotter and a reason why it cannot. |
|
168 </dd> |
|
169 </dl><dl> |
|
170 <dt>Return Type:</dt> |
|
171 <dd> |
|
172 tuple of (bool, str) |
|
173 </dd> |
|
174 </dl><a NAME="CircuitPythonDevice.canStartFileManager" ID="CircuitPythonDevice.canStartFileManager"></a> |
|
175 <h4>CircuitPythonDevice.canStartFileManager</h4> |
|
176 <b>canStartFileManager</b>(<i></i>) |
|
177 <p> |
|
178 Public method to determine, if a File Manager can be started. |
|
179 </p><dl> |
|
180 <dt>Returns:</dt> |
|
181 <dd> |
|
182 tuple containing a flag indicating it is safe to start a |
|
183 File Manager and a reason why it cannot. |
|
184 </dd> |
|
185 </dl><dl> |
|
186 <dt>Return Type:</dt> |
|
187 <dd> |
|
188 tuple of (bool, str) |
|
189 </dd> |
|
190 </dl><a NAME="CircuitPythonDevice.canStartPlotter" ID="CircuitPythonDevice.canStartPlotter"></a> |
|
191 <h4>CircuitPythonDevice.canStartPlotter</h4> |
|
192 <b>canStartPlotter</b>(<i></i>) |
|
193 <p> |
|
194 Public method to determine, if a Plotter can be started. |
|
195 </p><dl> |
|
196 <dt>Returns:</dt> |
|
197 <dd> |
|
198 tuple containing a flag indicating it is safe to start a |
|
199 Plotter and a reason why it cannot. |
|
200 </dd> |
|
201 </dl><dl> |
|
202 <dt>Return Type:</dt> |
|
203 <dd> |
|
204 tuple of (bool, str) |
|
205 </dd> |
|
206 </dl><a NAME="CircuitPythonDevice.canStartRepl" ID="CircuitPythonDevice.canStartRepl"></a> |
|
207 <h4>CircuitPythonDevice.canStartRepl</h4> |
|
208 <b>canStartRepl</b>(<i></i>) |
|
209 <p> |
|
210 Public method to determine, if a REPL can be started. |
|
211 </p><dl> |
|
212 <dt>Returns:</dt> |
|
213 <dd> |
|
214 tuple containing a flag indicating it is safe to start a REPL |
|
215 and a reason why it cannot. |
|
216 </dd> |
|
217 </dl><dl> |
|
218 <dt>Return Type:</dt> |
|
219 <dd> |
|
220 tuple of (bool, str) |
|
221 </dd> |
|
222 </dl><a NAME="CircuitPythonDevice.deviceName" ID="CircuitPythonDevice.deviceName"></a> |
|
223 <h4>CircuitPythonDevice.deviceName</h4> |
|
224 <b>deviceName</b>(<i></i>) |
|
225 <p> |
|
226 Public method to get the name of the device. |
|
227 </p><dl> |
|
228 <dt>Returns:</dt> |
|
229 <dd> |
|
230 name of the device |
|
231 </dd> |
|
232 </dl><dl> |
|
233 <dt>Return Type:</dt> |
|
234 <dd> |
|
235 str |
|
236 </dd> |
|
237 </dl><a NAME="CircuitPythonDevice.forceInterrupt" ID="CircuitPythonDevice.forceInterrupt"></a> |
|
238 <h4>CircuitPythonDevice.forceInterrupt</h4> |
|
239 <b>forceInterrupt</b>(<i></i>) |
|
240 <p> |
|
241 Public method to determine the need for an interrupt when opening the |
|
242 serial connection. |
|
243 </p><dl> |
|
244 <dt>Returns:</dt> |
|
245 <dd> |
|
246 flag indicating an interrupt is needed |
|
247 </dd> |
|
248 </dl><dl> |
|
249 <dt>Return Type:</dt> |
|
250 <dd> |
|
251 bool |
|
252 </dd> |
|
253 </dl><a NAME="CircuitPythonDevice.getWorkspace" ID="CircuitPythonDevice.getWorkspace"></a> |
|
254 <h4>CircuitPythonDevice.getWorkspace</h4> |
|
255 <b>getWorkspace</b>(<i></i>) |
|
256 <p> |
|
257 Public method to get the workspace directory. |
|
258 </p><dl> |
|
259 <dt>Returns:</dt> |
|
260 <dd> |
|
261 workspace directory used for saving files |
|
262 </dd> |
|
263 </dl><dl> |
|
264 <dt>Return Type:</dt> |
|
265 <dd> |
|
266 str |
|
267 </dd> |
|
268 </dl><a NAME="CircuitPythonDevice.runScript" ID="CircuitPythonDevice.runScript"></a> |
|
269 <h4>CircuitPythonDevice.runScript</h4> |
|
270 <b>runScript</b>(<i>script</i>) |
|
271 <p> |
|
272 Public method to run the given Python script. |
|
273 </p><dl> |
|
274 <dt><i>script</i> (str)</dt> |
|
275 <dd> |
|
276 script to be executed |
|
277 </dd> |
|
278 </dl><a NAME="CircuitPythonDevice.setButtons" ID="CircuitPythonDevice.setButtons"></a> |
|
279 <h4>CircuitPythonDevice.setButtons</h4> |
|
280 <b>setButtons</b>(<i></i>) |
|
281 <p> |
|
282 Public method to enable the supported action buttons. |
|
283 </p><a NAME="CircuitPythonDevice.supportsLocalFileAccess" ID="CircuitPythonDevice.supportsLocalFileAccess"></a> |
|
284 <h4>CircuitPythonDevice.supportsLocalFileAccess</h4> |
|
285 <b>supportsLocalFileAccess</b>(<i></i>) |
|
286 <p> |
|
287 Public method to indicate file access via a local directory. |
|
288 </p><dl> |
|
289 <dt>Returns:</dt> |
|
290 <dd> |
|
291 flag indicating file access via local directory |
|
292 </dd> |
|
293 </dl><dl> |
|
294 <dt>Return Type:</dt> |
|
295 <dd> |
|
296 bool |
|
297 </dd> |
|
298 </dl> |
|
299 <div align="right"><a href="#top">Up</a></div> |
|
300 <hr /> |
|
301 </body></html> |