Skip to content

Commit

Permalink
Update readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
kendryte747 committed Mar 27, 2023
1 parent 464fb4a commit d19b42c
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- uses: actions/checkout@v3

- name: Install Requirements.
run: pip3 install sphinx==5.3.0 sphinx_multiversion sphinx_rtd_theme sphinx-copybutton
run: pip3 install sphinx==5.3.0 sphinx-copybutton sphinx_multiversion sphinx_rtd_theme

- name: Build
run: |
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,7 @@ Use stable release core [package_k210_index.json](https://raw.githubusercontent.
# Documentation

You can read arduino-k210 online documentation on [github pages](https://kendryte.github.io/arduino-k210/main/)

# New board adaptation

If you want to adapt your board, refer to here [variants/board_config.md](variants/board_config.md)
31 changes: 31 additions & 0 deletions variants/board_config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# 开发板适配 | Board Configuration

本指南说明如何把自己的开发板适配进arduino项目。

适配一个新的板子,主要是改动两个文件:`variants/xxx/pins_arduino.h``boards.txt`

1. 引脚配置

由于开发板定义的lcd,camera等外设不一定相同,为了保证引脚对应的各种外设驱动模块可以匹配,就需要在`variants/xxx/pins_arduino.h`文件中定义。

给自己的开发板起一个名字,并新建目录位于`variants/`下。可以仿照`canaan_k1`的配置,拷贝他下面的`pins_arduino.h`到自己板子目录下,文件中定义了Serial调试口,LCD,SD卡,Camera等外设的引脚,按需修改成自己板子的配置。

2. `boards.txt`新增板型配置

引脚定义配置文件修改好后,需要把定义的板子加入到项目根目录的`boards.txt`文件中,打开`boards.txt`文件可以看到其中已经定义好的的两个板子,可以直接复制其中一个添加到下面,然后修改主要部分。

以canaan_k1板子为例,重点说明以下几个配置项:

- k1.name=Canaan K1
这部分是板子的名字,按需要改成自己定义的。这部分就是arduino IDE中板子选择项展示的名字。

- k1.build.variant=canaan_k1
指定variant名字,这部分填写的内容必须保证和`variant/`目录下你新建的那个板子目录名一致。这样arduino才可以找到对应的`pins_arduino.h`

- k1.build.board=CANAAN_K1
ARDUINO_BOARD宏定义名称。

- k1.build.burn_board=dan
烧录脚本工具的板型选择配置。


0 comments on commit d19b42c

Please sign in to comment.