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. 使用條款