FatfsSDIO - SD卡中的文件系统
准备材料
上传代码并在上传完成后按Ameba上的重置按钮。
在示例代码中,我们首先创建一个资料夹 “testdir”,然后创建内容为 “hello world!” 的文件 “test.txt”。读取文件并将内容打印到串行监视器。
接下来,将SD卡插入读卡器,并检查操作是否成功。
范例 02 file_read_write
打开范例, “Files” -> “Examples” -> “AmebaFatfsSDIO” -> “file_read_write”.
上传代码并在上传完成后按Ameba上的重置按钮。
在示例代码中,我们创建内容为 “hello world!”的文件 “test.txt”。读取文件并将内容打印到串行监视器。
接下来,将SD卡插入读卡器,并检查操作是否成功。
范例 03 get_file_attribute
打开范例,”Files” -> “Examples” -> “AmebaFatfsSDIO” -> “get_file_attribute”.
上传代码并在上传完成后按Ameba上的重置按钮。
在示例代码中,系统会将所有文件属性打印到串行监视器。
接下来,将SD卡插入读卡器,并检查操作是否成功。在这种情况下,通过参考上面的图片,我们已经知道属性应为文件夹 “testdir” 和文件 “test.txt”。
范例 04 last_modified_time
打开范例, “Files” -> “Examples” -> “AmebaFatfsSDIO” -> “last_modified_time”.
上传代码并在上传完成后按Ameba上的重置按钮。
在示例代码中,系统将把目标文件上次修改的时间打印到串行监视器上。
接下来,将SD卡插入读卡器,并检查操作是否成功。
范例 05 list_root_files
打开范例,”Files” -> “Examples” -> “AmebaFatfsSDIO” -> “list_root_files”.
上传代码并在上传完成后按Ameba上的重置按钮。
在示例代码中,系统将把所有的根目录文件打印到串行监视器中。
接下来,将SD卡插入读卡器,并检查操作是否成功。在这种情况下,通过参考上面的图片,我们可以知道根目录文件夹 “testdir” 和文件 “test.txt”。
- AmebaD [ AMB23 ] x 1
- MicroSD card









Realtek IoT/Wi-Fi MCU Solutions . All Rights Reserved. 使用条款