Ameba MicroPython: [RTL8722CSM] [RTL8722DM] SD File System
API Documents
Constructors
SDFS()
Create a SDFS object and configure it to the given mode. This then allows you to navigate through the SD card and read/write files as you see fit.
Note: No parameter is required
Methods
SDFS.listdir()
This method lists the files and folders under the current path.
SDFS.mkdir(“folder name“[required])
This method attempts to create a folder with the given folder name under current path.
• folder name: the name of the new folder/directory you wish to create, it must be a string less than 128 characters
SDFS.chdir(“folder name“[required])
This method change directory to the one given in the parameter.
• folder name: the name of the folder/directory you wish to navigate to, it must be a string less than 128 characters
Note: key in “/” as the parameter to this API would navigate back to the root directory.
SDFS.pwd()
This method is to print out present working directory (current path).
SDFS.rm(“folder name or file name“[required])
This method is to delete a file or a folder. Note that, the folder to be deleted has to be empty before it can be deleted successfully.
• folder name or file name: the name of the folder or file you wish to delete, it must be a string less than 128 characters
SDFS.create(“file name“[required])
This method is to create a file.
• file name: The name of the file you wish to create.
SDFS.write(“file name“[required], “string” [required])
This method is to write your input as a string to a file specified.
• file name: The name of the file you wish to write to.
• string: the data you wish to write.
SDFS.read(“file name“[required])
This method is to read the content from a file.
• file name: The name of the file you wish to read.
Copyrights ©瑞晟微电子(苏州)有限公司 2021. All rights reserved. 使用条款