Ameba MicroPython: [RTL8722CSM] [RTL8722DM] SDFS File Manipulation

Materials

  • Ameba x 1
  • MicroSD Card x 1

Steps

SD File System is supported on MicroPython RTL8722 port through importing the sdfs module. This module is a simplified file system with the aim to highlight SD card manipulation, thus it does not support virtual file system as well as virtual file object.

Copy and paste the following code line by line into REPL to see its effect.

import sdfs

s=sdfs                  # create a short form
s.create("ameba.txt")   # create a file named "ameba.txt"
s.write("ameba.txt", "ameba supports sd card file system!") # write a string to the file just created
s.read("ameba.txt")     # read the content from the same file
s.rm("ameba.txt")       # delete the file

Note: No file open or close is needed, the API does that automatically for you.

Copyrights ©瑞晟微电子(苏州)有限公司 2021. All rights reserved.
Please confirm that QQ communication software is installed