You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: en-us/api/pythonStdlib.md
+91-46Lines changed: 91 additions & 46 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -204,7 +204,7 @@ b'\xb3\xc9Y\x1b\xe9'
204
204
205
205
206
206
207
-
##### Initialize SD card driver(SPI mode)
207
+
##### Register storage device - SPI - SD card
208
208
209
209
At present, it is only supported by ec600n / ec800n platforms.
210
210
@@ -233,49 +233,7 @@ Initialize SD card and communicate with SD card. Use SPI communication mode.
233
233
234
234
235
235
236
-
##### Mount file system
237
-
238
-
> **uos.mount(vfs_obj, path)**
239
-
240
-
Mount the underlying file system to VFS.
241
-
242
-
* Parameters
243
-
244
-
|Parameter | parameter type | parameter description|
245
-
| ------- | ---------- | ---------------- |
246
-
| vfs_ Obj | VFS object | file system object|
247
-
|Path | str | root directory of file system|
248
-
249
-
* Return Value
250
-
251
-
* None
252
-
253
-
* Example
254
-
255
-
```python
256
-
>>> cdev = uos.VfsFat(1, 0, 4, 1)
257
-
>>> uos.mount(cdev, '/sd')
258
-
```
259
-
260
-
-SD card usage example(SPI mode)
261
-
262
-
At present, it is only supported by ec600n / ec800n platforms.
263
-
264
-
```python
265
-
>>> cdev = uos.VfsFat(1, 0, 4, 1)
266
-
>>> uos.mount(cdev, '/sd')
267
-
>>> f =open('/sd/test.txt','w+')
268
-
>>> f.write('0123456')
269
-
>>> f.close()
270
-
>>> uos.listdir('/sd')
271
-
>>> f =open('/sd/test.txt','r')
272
-
>>> f.read()
273
-
>>> f.close()
274
-
```
275
-
276
-
277
-
278
-
##### Initialize SD card driver(SDIO mode)
236
+
##### Register storage device - SDIO - SD card
279
237
280
238
At present,it is only supported by EC600U/EC200U platforms.
281
239
@@ -306,7 +264,7 @@ Return vfs object if the execution is successful, otherwise report error.
306
264
>>> udev = VfsSd("sd_fs")
307
265
```
308
266
309
-
##### Set detection pin
267
+
######Set detection pin
310
268
311
269
> **set_det(vfs_obj.GPIOn,mode)**
312
270
@@ -332,7 +290,7 @@ Return 0 if the execution is successful, otherwise return -1.
332
290
>>> udev.set_det(udev.GPIO10,0)#Use gpio10 as the card detection pin, insert the SD card, the detection port is low level, plug out the SD card, the detection port is high level(the actual use depends on the hardware).
333
291
```
334
292
335
-
##### Setting the card insertion and removal callback function
293
+
######Setting the card insertion and removal callback function
336
294
337
295
> **set_callback(fun)**
338
296
@@ -380,6 +338,93 @@ def call_back(para):
380
338
udev.set_callback(call_back)
381
339
```
382
340
341
+
342
+
343
+
##### **Register storage device - SPI NOR FLASH**
344
+
345
+
At present,it is only supported by EG915U platforms.
At present, it is only supported by ec600n / ec800n platforms.
413
+
414
+
```python
415
+
>>> cdev = uos.VfsFat(1, 0, 4, 1)
416
+
>>> uos.mount(cdev, '/sd')
417
+
>>> f =open('/sd/test.txt','w+')
418
+
>>> f.write('0123456')
419
+
>>> f.close()
420
+
>>> uos.listdir('/sd')
421
+
>>> f =open('/sd/test.txt','r')
422
+
>>> f.read()
423
+
>>> f.close()
424
+
```
425
+
426
+
427
+
383
428
#### gc - Control the Garbage Collector
384
429
385
430
This module provides an interface to the optional garbage collector. This module implements a subset of the corresponding [CPython](https://docs.micropython.org/en/latest/reference/glossary.html#term-CPython) module, as described below. For more information, refer to the original CPython documentation: [gc](https://docs.python.org/3.5/library/gc.html#module-gc)
0 commit comments