1.新增设备命令说明。

This commit is contained in:
MacRsh
2024-01-18 08:29:17 +08:00
parent 502d67d963
commit 28a54ee52f
2 changed files with 15 additions and 12 deletions

View File

@@ -73,13 +73,8 @@
示例: 示例:
```c ```c
struct mr_spi_dev spi_dev;
int main(void) int main(void)
{ {
/* 注册SPI10设备CS低电平有效到SPI1总线上 */
mr_spi_dev_register(&spi_dev, "spi1/spi10", 0, MR_SPI_CS_ACTIVE_LOW);
/* 打开SPI1总线下的SPI10设备 */ /* 打开SPI1总线下的SPI10设备 */
int ds = mr_dev_open("spi1/spi10", MR_OFLAG_RDWR); int ds = mr_dev_open("spi1/spi10", MR_OFLAG_RDWR);
@@ -96,6 +91,12 @@ int main(void)
} }
``` ```
得益于标准化设备接口,所有设备自动支持 `msh` 设备命令,通过命令行可完成所有设备操作。
![设备命令1](document/picture/readme/msh_device1.png)
![设备命令2](document/picture/readme/msh_device2.png)
---------- ----------
# 配置工具 # 配置工具
@@ -124,8 +125,8 @@ int main(void)
| include | 库头文件 | | include | 库头文件 |
| source | 库源文件 | | source | 库源文件 |
| Kconfig | 配置文件 | | Kconfig | 配置文件 |
| kconfig.py | 自动配置脚本 |
| LICENSE | 许可证 | | LICENSE | 许可证 |
| kconfig.py | 自动配置脚本 |
| tool.py | 自动构建脚本 | | tool.py | 自动构建脚本 |
---------- ----------

View File

@@ -80,13 +80,8 @@ All operations of the device can be implemented through the following interfaces
Example: Example:
```c ```c
struct mr_spi_dev spi_dev;
int main(void) int main(void)
{ {
/* Register SPI10 device (CS low active) to SPI1 bus */
mr_spi_dev_register(&spi_dev, "spi1/spi10", 0, MR_SPI_CS_ACTIVE_LOW);
/* Open SPI10 device under SPI1 bus line */ /* Open SPI10 device under SPI1 bus line */
int ds = mr_dev_open("spi1/spi10", MR_OFLAG_RDWR); int ds = mr_dev_open("spi1/spi10", MR_OFLAG_RDWR);
@@ -103,6 +98,13 @@ int main(void)
} }
``` ```
Thanks to the standardized device interface, all devices automatically support the `msh` device command,
and all device operations can be completed through the command line.
![Device command1](document/picture/readme/msh_device1.png)
![Device command2](document/picture/readme/msh_device2.png)
---------- ----------
# Configuration tool # Configuration tool
@@ -134,8 +136,8 @@ the `Python` script automatically generates the configuration file.
| include | Library header file | | include | Library header file |
| source | Library source file | | source | Library source file |
| Kconfig | Configuration files | | Kconfig | Configuration files |
| kconfig.py | Automatic configuration script |
| LICENSE | Open-source license | | LICENSE | Open-source license |
| kconfig.py | Automatic configuration script |
| tool.py | Automatic build script | | tool.py | Automatic build script |
---------- ----------