-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
luatos_bot
committed
Jul 8, 2024
1 parent
6d2b8bb
commit 37df354
Showing
7 changed files
with
161 additions
and
91 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,88 +1,94 @@ | ||
包含的内容有 | ||
Included content is | ||
本库有专属demo,[点此链接查看fatfs的demo例子 | ||
This library has its own demo,[click this link to view the demo example of fatfs | ||
本页文档由[这个文件](https://gitee.com/openLuat/LuatOS/tree/master/luat/../components/fatfs/luat_lib_fatfs.c)自动生成。如有错误,请提交issue或帮忙修改后pr,谢谢 | ||
This page document is automatically generated by [this file](https://gitee.com/openLuat/LuatOS/tree/master/luat/../components/fatfs/luat_lib_fatfs.c). If there is any error, please submit issue or help modify pr, thank you | ||
不使用默认CS脚 | ||
Don't use default CS pins | ||
参数 | ||
Parameters | ||
成功返回true, 否则返回nil或者 | ||
Returns true on success, otherwise it returns nil or | ||
初始化时使用较低的频率 | ||
Use lower frequency when initializing | ||
传入值类型|解释 | ||
Incoming Value Type | Explanation | ||
传入spi device指针,或者spi的id,或者sdio的 | ||
The spi device pointer, or spi id, or sdio | ||
串口 | ||
Serial port | ||
导致失败的底层返回值 | ||
The underlying return value that caused the failure | ||
读写fatfs格式 | ||
read/write fatfs format | ||
返回值 | ||
Return Value | ||
返回值类型|解释 | ||
return value type | explanation | ||
方法1, 使用SPI模式 | ||
Method 1, using SPI mode | ||
挂载 | ||
mount | ||
挂载点, 需要跟fatfs.mount传入的值一致 | ||
The mount point must be the same as the value passed in by fatfs.mount. | ||
挂载失败是否尝试格式化,默认是true,即自动格式化. 本参数在2023.8.16添加 | ||
Whether to try formatting when mounting failure, the default is true, that is, automatic formatting. This parameter is added on 2023.8.16 | ||
获取可用空间信息 | ||
Get free space information | ||
卡电源复位过程时间,单位ms,默认值是 | ||
Card power reset process time, unit ms, default value is | ||
卡电源控制脚,TF卡初始前先拉低复位再拉高,如果没有,或者是内置电源控制方式,这个参数就不需要传 | ||
Card power control pin, TF card before the initial pull down reset and then pull up, if not, or built-in power control mode, this parameter does not need to be transmitted | ||
空闲扇区数量 | ||
Number of Free Sectors | ||
空闲字节数, 单位 | ||
Free bytes, unit | ||
例子 | ||
Examples | ||
模式,可选 | ||
mode, optional | ||
片选脚的GPIO 号, spi模式有效,若前一个参数传的是spi device,这个参数就不需要传 | ||
The GPIO number of the selected pin of the chip, spi mode is valid, if the previous parameter is passed spi device, this parameter does not need to be passed | ||
若成功会返回table,否则返回 | ||
Returns table if successful, otherwise | ||
若挂载失败,可以尝试打开调试信息,查找原因 | ||
If the mount fails, you can try to open the debugging information to find the reason. | ||
设置调试模式 | ||
Set Debug Mode | ||
失败的原因 | ||
Reasons for failure | ||
示例 | ||
Example | ||
是否进入调试模式,true代表进入调试模式,增加调试日志 | ||
Whether to enter the debug mode. True means to enter the debug mode and add debug logs. | ||
数据宽度 | ||
Data Width | ||
提醒, 若TF/SD模块带电平转换, 通常不支持10M以上的波特率 | ||
Reminder, if TF/SD module with level conversion, usually does not support baud rate above 10M | ||
通常只使用fatfs.mount挂载tf/sd卡,其他操作走io库就可以了 | ||
Usually, only fatfs.mount is used to mount the tf/sd card, and the io library is enough for other operations. | ||
往下的操作, 使用 io.open("/sd/xxx", "w+") 等io库的API就可以了 | ||
For the next operation, use io.open("/sd/xxx", "w") and other io library API | ||
无 | ||
None | ||
无返回值 | ||
No return value | ||
虚拟文件系统的挂载点, 默认是 | ||
The mount point of the virtual file system. The default value is | ||
已适配 | ||
Adapted | ||
注意,当前扇区大小固定在512字节 | ||
Note that the current sector size is fixed at 512 bytes | ||
总扇区数量 | ||
Total number of sectors | ||
总字节数,单位 | ||
Total bytes, unit | ||
最高速度,默认10M, 若前2个参数传的是spi device,这个参数就不需要传 | ||
The highest speed is 10M by default. If the first two parameters are spi device, this parameter does not need to be transmitted. | ||
不使用默认CS脚 | ||
Don't use default CS pins | ||
串口 | ||
Serial port | ||
传入spi device指针,或者spi的id,或者sdio的 | ||
The spi device pointer, or spi id, or sdio | ||
传入值类型|解释 | ||
Incoming Value Type | Explanation | ||
例子 | ||
Examples | ||
最高速度,默认10M, 若前2个参数传的是spi device,这个参数就不需要传 | ||
The highest speed is 10M by default. If the first two parameters are spi device, this parameter does not need to be transmitted. | ||
初始化时使用较低的频率 | ||
Use lower frequency when initializing | ||
包含的内容有 | ||
Included content is | ||
卡电源复位过程时间,单位ms,默认值是 | ||
Card power reset process time, unit ms, default value is | ||
卡电源控制脚,TF卡初始前先拉低复位再拉高,如果没有,或者是内置电源控制方式,这个参数就不需要传 | ||
Card power control pin, TF card before the initial pull down reset and then pull up, if not, or built-in power control mode, this parameter does not need to be transmitted | ||
参数 | ||
Parameters | ||
取消挂载 | ||
Unmount | ||
失败的原因 | ||
Reasons for failure | ||
导致失败的底层返回值 | ||
The underlying return value that caused the failure | ||
已适配 | ||
Adapted | ||
往下的操作, 使用 io.open("/sd/xxx", "w+") 等io库的API就可以了 | ||
For the next operation, use io.open("/sd/xxx", "w") and other io library API | ||
总字节数,单位 | ||
Total bytes, unit | ||
总扇区数量 | ||
Total number of sectors | ||
成功返回0, 否则返回失败码 | ||
Return 0 on success, otherwise return failure code | ||
成功返回true, 否则返回nil或者 | ||
Returns true on success, otherwise it returns nil or | ||
挂载 | ||
mount | ||
挂载失败是否尝试格式化,默认是true,即自动格式化. 本参数在2023.8.16添加 | ||
Whether to try formatting when mounting failure, the default is true, that is, automatic formatting. This parameter is added on 2023.8.16 | ||
挂载点, 需要跟fatfs.mount传入的值一致 | ||
The mount point must be the same as the value passed in by fatfs.mount. | ||
提醒, 若TF/SD模块带电平转换, 通常不支持10M以上的波特率 | ||
Reminder, if TF/SD module with level conversion, usually does not support baud rate above 10M | ||
数据宽度 | ||
Data Width | ||
方法1, 使用SPI模式 | ||
Method 1, using SPI mode | ||
无 | ||
None | ||
无返回值 | ||
No return value | ||
是否进入调试模式,true代表进入调试模式,增加调试日志 | ||
Whether to enter the debug mode. True means to enter the debug mode and add debug logs. | ||
本库有专属demo,[点此链接查看fatfs的demo例子 | ||
This library has its own demo,[click this link to view the demo example of fatfs | ||
本页文档由[这个文件](https://gitee.com/openLuat/LuatOS/tree/master/luat/../components/fatfs/luat_lib_fatfs.c)自动生成。如有错误,请提交issue或帮忙修改后pr,谢谢 | ||
This page document is automatically generated by [this file](https://gitee.com/openLuat/LuatOS/tree/master/luat/../components/fatfs/luat_lib_fatfs.c). If there is any error, please submit issue or help modify pr, thank you | ||
模式,可选 | ||
mode, optional | ||
注意,当前扇区大小固定在512字节 | ||
Note that the current sector size is fixed at 512 bytes | ||
片选脚的GPIO 号, spi模式有效,若前一个参数传的是spi device,这个参数就不需要传 | ||
The GPIO number of the selected pin of the chip, spi mode is valid, if the previous parameter is passed spi device, this parameter does not need to be passed | ||
示例 | ||
Example | ||
空闲字节数, 单位 | ||
Free bytes, unit | ||
空闲扇区数量 | ||
Number of Free Sectors | ||
若成功会返回table,否则返回 | ||
Returns table if successful, otherwise | ||
若挂载失败,可以尝试打开调试信息,查找原因 | ||
If the mount fails, you can try to open the debugging information to find the reason. | ||
获取可用空间信息 | ||
Get free space information | ||
虚拟文件系统的挂载点, 默认是 | ||
The mount point of the virtual file system. The default value is | ||
虚拟文件系统的挂载点, 默认是 fatfs,必须与fatfs.mount一致 | ||
The mount point of the virtual file system. The default value is fatfs and must be consistent with fatfs.mount. | ||
设置调试模式 | ||
Set Debug Mode | ||
读写fatfs格式 | ||
read/write fatfs format | ||
返回值 | ||
Return Value | ||
返回值类型|解释 | ||
return value type | explanation | ||
通常只使用fatfs.mount挂载tf/sd卡,其他操作走io库就可以了 | ||
Usually, only fatfs.mount is used to mount the tf/sd card, and the io library is enough for other operations. |