Skip to content

Commit d19b42c

Browse files
committed
Update readme.
1 parent 464fb4a commit d19b42c

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

.github/workflows/docs.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- uses: actions/checkout@v3
3535

3636
- name: Install Requirements.
37-
run: pip3 install sphinx==5.3.0 sphinx_multiversion sphinx_rtd_theme sphinx-copybutton
37+
run: pip3 install sphinx==5.3.0 sphinx-copybutton sphinx_multiversion sphinx_rtd_theme
3838

3939
- name: Build
4040
run: |

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@ Use stable release core [package_k210_index.json](https://raw.githubusercontent.
99
# Documentation
1010

1111
You can read arduino-k210 online documentation on [github pages](https://kendryte.github.io/arduino-k210/main/)
12+
13+
# New board adaptation
14+
15+
If you want to adapt your board, refer to here [variants/board_config.md](variants/board_config.md)

variants/board_config.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# 开发板适配 | Board Configuration
2+
3+
本指南说明如何把自己的开发板适配进arduino项目。
4+
5+
适配一个新的板子,主要是改动两个文件:`variants/xxx/pins_arduino.h``boards.txt`
6+
7+
1. 引脚配置
8+
9+
由于开发板定义的lcd,camera等外设不一定相同,为了保证引脚对应的各种外设驱动模块可以匹配,就需要在`variants/xxx/pins_arduino.h`文件中定义。
10+
11+
给自己的开发板起一个名字,并新建目录位于`variants/`下。可以仿照`canaan_k1`的配置,拷贝他下面的`pins_arduino.h`到自己板子目录下,文件中定义了Serial调试口,LCD,SD卡,Camera等外设的引脚,按需修改成自己板子的配置。
12+
13+
2. `boards.txt`新增板型配置
14+
15+
引脚定义配置文件修改好后,需要把定义的板子加入到项目根目录的`boards.txt`文件中,打开`boards.txt`文件可以看到其中已经定义好的的两个板子,可以直接复制其中一个添加到下面,然后修改主要部分。
16+
17+
以canaan_k1板子为例,重点说明以下几个配置项:
18+
19+
- k1.name=Canaan K1
20+
这部分是板子的名字,按需要改成自己定义的。这部分就是arduino IDE中板子选择项展示的名字。
21+
22+
- k1.build.variant=canaan_k1
23+
指定variant名字,这部分填写的内容必须保证和`variant/`目录下你新建的那个板子目录名一致。这样arduino才可以找到对应的`pins_arduino.h`
24+
25+
- k1.build.board=CANAAN_K1
26+
ARDUINO_BOARD宏定义名称。
27+
28+
- k1.build.burn_board=dan
29+
烧录脚本工具的板型选择配置。
30+
31+

0 commit comments

Comments
 (0)