1.补充README。

This commit is contained in:
MacRsh
2023-12-06 14:23:45 +08:00
parent 5af084f13a
commit 9df88728ea
3 changed files with 37 additions and 22 deletions

View File

@@ -1,5 +1,7 @@
# MR 框架
[English](README_EN.md)
----------
<!-- TOC -->
@@ -34,7 +36,7 @@
----------
![项目结构图](https://gitee.com/MacRsh/mr-library/raw/develop/document/picture/README.png)
![项目结构图](document/picture/README.png)
----------
@@ -78,9 +80,9 @@
`Kconfig` 会根据配置文件自动生成配置选项界面。开发者可以通过简单的操作来选择需要启用的功能组件和设置相关参数。
![配置工具](https://gitee.com/MacRsh/mr-library/raw/develop/document/picture/README_Kconfig.png)
![配置工具](document/picture/README_Kconfig.png)
![配置工具1](https://gitee.com/MacRsh/mr-library/raw/develop/document/picture/README_Kconfig1.png)
![配置工具1](document/picture/README_Kconfig1.png)
通过修改参数,快速裁剪所需功能。配置完成后通过 `Python` 脚本自动生成配置文件。
@@ -126,16 +128,16 @@
1. 从 `Gitee` 或 `Github` 仓库下载最新版本源码到本地。
2. 将源码导入到您工程所在的目录。以STM32工程为例
![工程目录](https://gitee.com/MacRsh/mr-library/raw/develop/document/picture/README_Build.png)
![工程目录](document/picture/README_Build.png)
3. 如使用的芯片已经做了 `BSP` 适配请参考芯片对应 `BSP` 中的配置教程,完成 `BSP` 配置。
4. 移除不需要的文件 `bsp`、`document`、`module` 目录(如不需要`GIT`也可以移除`.git`文件删除)。完成后,目录结构如下所示:
![工程目录1](https://gitee.com/MacRsh/mr-library/raw/develop/document/picture/README_Build1.png)
![工程目录1](document/picture/README_Build1.png)
5. 将文件加入到IDE中大部分IDE都能自动识别工程路径下的文件无需进行此步骤。以 `keil` 为例:
![工程目录Keil](https://gitee.com/MacRsh/mr-library/raw/develop/document/picture/README_Keil.png)
![工程目录Keil](document/picture/README_Keil.png)
添加 `source`、`device`、`driver` 目录下的所有文件。
@@ -143,13 +145,13 @@
1. 在 `mr-library` 目录下打开命令行工具,运行 `menuconfig` 进行菜单配置。
![工程目录2](https://gitee.com/MacRsh/mr-library/raw/develop/document/picture/README_Build2.png)
![工程目录2](document/picture/README_Build2.png)
注:当添加对应芯片驱动的后,将显示 `Device configure` 和 `Driver configure`。对应 `Driver configure` 请参考 `BSP` 下教程。
2. 选中 `Device configure` 回车进入菜单,按照需要配置功能。
![工程目录3](https://gitee.com/MacRsh/mr-library/raw/develop/document/picture/README_Build3.png)
![工程目录3](document/picture/README_Build3.png)
3. 配置完成后,按 `Q` 退出菜单配置界面,按`Y` 保存配置。
@@ -161,7 +163,7 @@
1. 在编译器中添加 `mr-library` 的包含路径,以 `keil` 为例:
![工程目录4](https://gitee.com/MacRsh/mr-library/raw/develop/document/picture/README_Build4.png)
![工程目录4](document/picture/README_Build4.png)
2. 配置自动初始化GCC环境查找您工程下以 `.ld` 为后缀的连接脚本文件(通常为 `link.ld`),在脚本文件中添加代码:
注:如果您的是在 `keil` 等,能够自动生成链接脚本的环境下,请跳过此步骤。
@@ -176,11 +178,11 @@
示例:
![工程目录5](https://gitee.com/MacRsh/mr-library/raw/develop/document/picture/README_Build5.png)
![工程目录5](document/picture/README_Build5.png)
3. 配置GNU语法。如果您使用的是非 `GCC` 编译器请使能GNU语法。以 `keil` 为例:
![工程目录6](https://gitee.com/MacRsh/mr-library/raw/develop/document/picture/README_Build6.png)
![工程目录6](document/picture/README_Build6.png)
4. 在您的工程中引入 `#include "include/mr_lib.h"`。
5. 在 `main` 函数中添加 `mr_auto_init();` 自动初始化函数。

View File

@@ -1,5 +1,7 @@
# MR frame
[中文](README.md)
----------
<!-- TOC -->
@@ -40,7 +42,7 @@ drivers. This greatly improves the reusability of software and its extensibility
----------
![framework](https://gitee.com/MacRsh/mr-library/raw/develop/document/picture/README.png)
![framework](document/picture/README.png)
----------
@@ -87,9 +89,9 @@ code.
`Kconfig` will automatically generate the configuration options interface based on the configuration file. Developers
can select the functional components that need to be enabled and set relevant parameters through simple operations.
![Tool](https://gitee.com/MacRsh/mr-library/raw/develop/document/picture/README_Kconfig.png)
![Tool](document/picture/README_Kconfig.png)
![Tool1](https://gitee.com/MacRsh/mr-library/raw/develop/document/picture/README_Kconfig1.png)
![Tool1](document/picture/README_Kconfig1.png)
By modifying parameters, you can quickly tailor the required functions. After the configuration is complete,
the `Python` script automatically generates the configuration file.
@@ -137,20 +139,27 @@ tutorials are based on applying Kconfig).
1. Download the latest version source code from the Gitee or Github repository to the local.
2. Import the source code into the directory where your project is located. Taking an STM32 project as an example:
![project directory](https://gitee.com/MacRsh/mr-library/raw/develop/document/picture/README_Build.png)
![project directory](document/picture/README_Build.png)
3. If the used chip has BSP adaptation, please refer to the chip's corresponding BSP configuration tutorial to complete
the BSP configuration.
4. Remove unnecessary files such as `bsp`、`document`、`module` directories (you can also remove the `.git` file to delete
GIT if not needed). The directory structure is shown below after completion:
![project directory1](https://gitee.com/MacRsh/mr-library/raw/develop/document/picture/README_Build1.png)
![project directory1](document/picture/README_Build1.png)
5. Add the files to the IDE (most ides automatically recognize the files in the project path, eliminating the need for
this step). Take `keil` for example:
![project directory1 Keil](document/picture/README_Keil.png)
Add all files in the `source`, `device`, `driver` directories.
## Configure Menu Options
1. Open the command line tool in the `mr-library` directory and run `menuconfig` to configure the menu.
![project directory2](https://gitee.com/MacRsh/mr-library/raw/develop/document/picture/README_Build2.png)
![project directory2](document/picture/README_Build2.png)
Note: When the corresponding chip driver is added, `Device configure` and `Driver configure` will be displayed.
Please refer to the tutorial under `BSP` for `Driver configure`.
@@ -158,7 +167,7 @@ tutorials are based on applying Kconfig).
2. Enter the menu by pressing the Enter key on `Device configure`, and configure the desired functions according to
needs.
![project directory3](https://gitee.com/MacRsh/mr-library/raw/develop/document/picture/README_Build3.png)
![project directory3](document/picture/README_Build3.png)
3. After configuration is complete, press `Q` to exit the menu configuration interface, press `Y` to save the
configuration.
@@ -172,7 +181,7 @@ tutorials are based on applying Kconfig).
1. Add the include paths of `mr-library` in the compiler, taking `keil` as an example:
![project directory4](https://gitee.com/MacRsh/mr-library/raw/develop/document/picture/README_Build4.png)
![project directory4](document/picture/README_Build4.png)
2. Configure automatic initialization (GCC environment), find the link script file with suffix `.ld` in your project
directory (usually `link.ld`), and add the following code to the script file:
@@ -187,10 +196,14 @@ tutorials are based on applying Kconfig).
Example:
![project directory5](https://gitee.com/MacRsh/mr-library/raw/develop/document/picture/README_Build5.png)
![project directory5](document/picture/README_Build5.png)
3. Include `#include "include/mr_lib.h"` in your project.
4. Add the automatic initialization function `mr_auto_init();` in the main function.
3. Configure the GNU syntax. If you are using a non-gcc compiler, enable GNU syntax. Take `keil` for example:
![project directory6](document/picture/README_Build6.png)
4. Include `#include "include/mr_lib.h"` in your project.
5. Add the automatic initialization function `mr_auto_init();` in the main function.
----------

View File

Before

Width:  |  Height:  |  Size: 111 KiB

After

Width:  |  Height:  |  Size: 111 KiB