README.md
1# ra6m3-hmi-board Arduino Ecosystem Compatibility Guide
2
3**[English](README.md)** | **中文**
4
5## 1 RTduino - Arduino Ecosystem Compatibility Layer for RT-Thread
6
7The ra6m3-hmi-board development board has been fully adapted for the [RTduino software package](https://github.com/RTduino/RTduino), the Arduino Ecosystem compatibility layer for RT-Thread. Users can operate this BSP following Arduino programming conventions and leverage a vast array of libraries from the Arduino community, providing significant enhancement to the RT-Thread ecosystem. For more information, refer to the [RTduino Software Package Documentation](https://github.com/RTduino/RTduino).
8
9### 1.1 Activating Arduino Ecosystem Compatibility Layer for this BSP
10
11Enter the `menuconfig` command under the Env tool, or select RT-Thread Settings in the RT-Thread Studio IDE:
12
13```Kconfig
14Hardware Drivers Config --->
15 Onboard Peripheral Drivers --->
16 [*] Compatible with Arduino Ecosystem (RTduino)
17```
18
19## 2 Arduino Pin Configuration
20
21For more information about pin layout, refer to [pins_arduino.c](pins_arduino.c) and [pins_arduino.h](pins_arduino.h).
22
23
24
25| Arduino Pin Number | STM32 Pin Number | 5V Tolerance | Remarks |
26| ------------------- | ----------------- | ------------ | ------------------------------------------- |
27| 0 (D0) | P206 | Yes | Serial4-RX, default handled by RT-Thread's UART device framework uart4 |
28| 1 (D1) | P205 | Yes | Serial4-TX, default handled by RT-Thread's UART device framework uart4 |
29| 2 (D2) | P008 | Yes | |
30| 3 (D3) | P506 | Yes | |
31| 4 (D4) | P603 | Yes | |
32| 5 (D5) | P604 | Yes | PWM8-CH0, default handled by RT-Thread's PWM device framework pwm8 channel 0 |
33| 6 (D6) | P605 | Yes | PWM8-CH0, default handled by RT-Thread's PWM device framework pwm8 channel 0 |
34| 7 (D7) | P208 | Yes | |
35| 8 (D8) | P207 | Yes | |
36| 9 (D9) | P009 | Yes | |
37| 10 (D10) | P712 | Yes | PWM2-CH0, default handled by RT-Thread's PWM device framework pwm2 channel 0 |
38| 11 (D11) | P512 | Yes | PWM0-CH0, default handled by RT-Thread's PWM device framework pwm0 channel 0 |
39| 12 (D12) | P511 | Yes | |
40| 13 (D13) | P204 | Yes | |
41| 14 (D14) | P203 | Yes | |
42| 15 (D15) | P202 | Yes | |
43| 16 (A0) | P000 | Yes | ADC1-CH0-EXTVOL (External Voltage), default handled by RT-Thread's ADC device framework adc0 channel 0 |
44| 17 (A1) | P001 | Yes | ADC1-CH1-EXTVOL (External Voltage), default handled by RT-Thread's ADC device framework adc0 channel 1 |
45| 18 (A2) | P002 | Yes | ADC1-CH2-EXTVOL (External Voltage), default handled by RT-Thread's ADC device framework adc0 channel 2 |
46| 19 (A3) | P003 | Yes | ADC1-CH7-EXTVOL (External Voltage), default handled by RT-Thread's ADC device framework adc0 channel 7 |
47| 20 (A4) | P508 | Yes | ADC1-CH19-EXTVOL (External Voltage), default handled by RT-Thread's ADC device framework adc0 channel 20 |
48| 21 (A5) | P014 | Yes | ADC1-CH5-EXTVOL (External Voltage), default handled by RT-Thread's ADC device framework adc0 channel 5 |
49
50> Note:
51> 1. RTduino currently does not support MDK; it is recommended to use the GNU GCC toolchain for compilation.
52> 2. The default PWM channel for Renesas is channel 0; for detailed driver information, refer to the `bsp\renesas\libraries\HAL_Drivers\drv_pwm.c` file.
README_zh.md
1# ra6m3-hmi-board 开发板的Arduino生态兼容说明
2
3**[English](README.md)** | **中文**
4
5## 1 RTduino - RT-Thread的Arduino生态兼容层
6
7ra6m3-hmi-board 开发板已经完整适配了[RTduino软件包](https://github.com/RTduino/RTduino),即RT-Thread的Arduino生态兼容层。用户可以按照Arduino的编程习惯来操作该BSP,并且可以使用大量Arduino社区丰富的库,是对RT-Thread生态的极大增强。更多信息,请参见[RTduino软件包说明文档](https://github.com/RTduino/RTduino)。
8
9### 1.1 如何开启针对本BSP的Arduino生态兼容层
10
11Env 工具下敲入 menuconfig 命令,或者 RT-Thread Studio IDE 下选择 RT-Thread Settings:
12
13```Kconfig
14Hardware Drivers Config --->
15 Onboard Peripheral Drivers --->
16 [*] Compatible with Arduino Ecosystem (RTduino)
17```
18
19## 2 Arduino引脚排布
20
21更多引脚布局相关信息参见 [pins_arduino.c](pins_arduino.c) 和 [pins_arduino.h](pins_arduino.h)。
22
23
24
25| Arduino引脚编号 | STM32引脚编号 | 5V容忍 | 备注 |
26| ------------------- | --------- | ---- | ------------------------------------------------------------------------- |
27| 0 (D0) | P206 | 是 | Serial4-RX,默认被RT-Thread的UART设备框架uart4接管 |
28| 1 (D1) | P205 | 是 | Serial4-TX,默认被RT-Thread的UART设备框架uart4接管 |
29| 2 (D2) | P008 | 是 | |
30| 3 (D3) | P506 | 是 | |
31| 4 (D4) | P603 | 是 | |
32| 5 (D5) | P604 | 是 | PWM8-CH0,默认被RT-Thread的PWM设备框架pwm8的channel0接管 |
33| 6 (D6) | P605 | 是 | PWM8-CH0,默认被RT-Thread的PWM设备框架pwm8的channel0接管 |
34| 7 (D7) | P208 | 是 | |
35| 8 (D8) | P207 | 是 | |
36| 9 (D9) | P009 | 是 | |
37| 10 (D10) | P712 | 是 | PWM2-CH0,默认被RT-Thread的PWM设备框架pwm2的channel0接管 |
38| 11 (D11) | P512 | 是 | PWM0-CH0,默认被RT-Thread的PWM设备框架pwm0的channel0接管 |
39| 12 (D12) | P511 | 是 | |
40| 13 (D13) | P204 | 是 | |
41| 14 (D14) | P203 | 是 | |
42| 15 (D15) | P202 | 是 | |
43| 16 (A0) | P000 | 是 | ADC1-CH0-EXTVOL(外部电压),默认被RT-Thread的ADC设备框架adc0的channel0接管 |
44| 17 (A1) | P001 | 是 | ADC1-CH1-EXTVOL(外部电压),默认被RT-Thread的ADC设备框架adc0的channel1接管 |
45| 18 (A2) | P002 | 是 | ADC1-CH2-EXTVOL(外部电压),默认被RT-Thread的ADC设备框架adc0的channel2接管 |
46| 19 (A3) | P003 | 是 | ADC1-CH7-EXTVOL(外部电压),默认被RT-Thread的ADC设备框架adc0的channel7接管 |
47| 20 (A4) | P508 | 是 | ADC1-CH19-EXTVOL(外部电压),默认被RT-Thread的ADC设备框架adc0的channel20接管 |
48| 21 (A5) | P014 | 是 | ADC1-CH5-EXTVOL(外部电压),默认被RT-Thread的ADC设备框架adc0的channel5接管 |
49
50> 注意:
51> 1.RTduino暂时不对MDK支持,建议使用GNU GCC工具链编译
52> 2.renesas的pwm通道默认使用channel0,详细驱动细节请查阅`bsp\renesas\libraries\HAL_Drivers\drv_pwm.c`文件