mirror of
https://github.com/micropython/micropython.git
synced 2026-01-06 20:20:14 +01:00
docs: Use vfs module instead of os.
Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
@@ -20,11 +20,11 @@ more info regarding the pins which can be remapped to be used with a SD card.
|
||||
Example usage::
|
||||
|
||||
from machine import SD
|
||||
import os
|
||||
import vfs
|
||||
# clk cmd and dat0 pins must be passed along with
|
||||
# their respective alternate functions
|
||||
sd = machine.SD(pins=('GP10', 'GP11', 'GP15'))
|
||||
os.mount(sd, '/sd')
|
||||
vfs.mount(sd, '/sd')
|
||||
# do normal file operations
|
||||
|
||||
Constructors
|
||||
|
||||
@@ -30,7 +30,7 @@ vary from platform to platform.
|
||||
The class implements the block protocol defined by :class:`vfs.AbstractBlockDev`.
|
||||
This allows the mounting of an SD card to be as simple as::
|
||||
|
||||
os.mount(machine.SDCard(), "/sd")
|
||||
vfs.mount(machine.SDCard(), "/sd")
|
||||
|
||||
The constructor takes the following parameters:
|
||||
|
||||
|
||||
@@ -213,7 +213,7 @@ Miscellaneous functions
|
||||
.. function:: mount(device, mountpoint, *, readonly=False, mkfs=False)
|
||||
|
||||
.. note:: This function is deprecated. Mounting and unmounting devices should
|
||||
be performed by :meth:`os.mount` and :meth:`os.umount` instead.
|
||||
be performed by :meth:`vfs.mount` and :meth:`vfs.umount` instead.
|
||||
|
||||
Mount a block device and make it available as part of the filesystem.
|
||||
``device`` must be an object that provides the block protocol. (The
|
||||
|
||||
Reference in New Issue
Block a user