FATFS移植
相关链接
使用/不使用中文
#define FF_CODE_PAGE 936
- 双击项目查看输出文件
- 使用中文,编译后

- 不使用中文,编译后

- 使用中文,会占用较多存储空间。
使用测试
- The f_mount fucntion gives work area to the FatFs module.
挂载文件系统 - The f_mkfs function creates an FAT/exFAT volume on the logical drive.
创建文件系统 - The f_open function opens a file.
打开文件
Mode flags | Meaning |
---|
FA_READ | 可读 |
FA_WRITE | 可写 |
FA_OPEN_EXISTING | 打开一个文件。如果文件不存在,该函数将失败。(默认) |
FA_CREATE_NEW | Creates a new file. The function fails with FR_EXIST if the file is existing. |
FA_CREATE_ALWAYS | 创建一个新文件。如果文件存在,它将被截断和覆盖。 |
FA_OPEN_ALWAYS | 打开文件(如果存在)。否则,将创建一个新文件。 |
FA_OPEN_APPEND | Same as FA_OPEN_ALWAYS except the read/write pointer is set end of the file. |
视频中讲的

文件采取样式

,Rt1,Rt2,Rt3,Rt4,Rt5,Rt6,Rt7,Rt8\r\n2021/09/12-21:20:11,0.145789,0.254789\r\n2021/09/12-21:20:13,