1+ /*
2+ * Copyright (c) 2006-2023, RT-Thread Development Team
3+ *
4+ * SPDX-License-Identifier: Apache-2.0
5+ *
6+ * Change Logs:
7+ * Date Author Notes
8+ * 2025-12-08 westcity-yolo first version
9+ *
10+ */
11+
12+ #include <Arduino.h>
13+ #include <board.h>
14+ #include <drv_pin.h>
15+ #include "pins_arduino.h"
16+
17+ /*
18+ * {Arduino Pin, RT-Thread Pin [, Device Name, Channel]}
19+ * [] means optional
20+ * Digital pins must NOT give the device name and channel.
21+ * Analog pins MUST give the device name and channel(ADC, PWM or DAC).
22+ * Arduino Pin must keep in sequence.
23+ */
24+ const pin_map_t pin_map_table []=
25+ {
26+ {D0 , GET_PINS (2 ,3 ), "uart2" }, /* Serial2-RX */
27+ {D1 , GET_PINS (2 ,2 ), "uart2" }, /* Serial2-TX */
28+ {D2 , GET_PINS (3 ,31 )},
29+ {D3 , GET_PINS (3 ,14 ), "pwm1" , 1 }, /* PWM */
30+ {D4 , GET_PINS (4 ,7 )},
31+ {D5 , GET_PINS (3 ,1 ), "pwm0" , 0 }, /* PWM */
32+ {D6 , GET_PINS (3 ,17 ), "pwm1" , 0 }, /* PWM */
33+ {D7 , GET_PINS (3 ,22 )},
34+ {D8 , GET_PINS (4 ,3 )},
35+ {D9 , GET_PINS (3 ,13 ), "pwm1" , 2 }, /* PWM */
36+ {D10 , GET_PINS (3 ,11 ),"spi1" }, /* SPI-SS */
37+ {D11 , GET_PINS (3 ,8 ), "spi1" }, /* SPI-SDO */
38+ {D12 , GET_PINS (3 ,9 ), "spi1" }, /* SPI-SDI */
39+ {D13 , GET_PINS (3 ,10 ),"spi1" }, /* SPI-SCK */
40+ {D18 , GET_PINS (1 ,8 ),"i2c2" }, /* I2C-SDA (Wire) */
41+ {D19 , GET_PINS (1 ,9 ),"i2c2" }, /* I2C-SCL (Wire) */
42+ {A0 , GET_PINS (1 ,14 ),"adc1" , 12 }, /* ADC */
43+ {A1 , GET_PINS (2 ,5 ), "adc1" , 1 }, /* ADC */
44+ {A2 , GET_PINS (2 ,7 ),"adc0" , 7 }, /* ADC */
45+ {A3 , GET_PINS (3 ,30 ),"adc1" , 21 },
46+ {A4 , GET_PINS (1 ,0 ),"i2c1" }, /* I2C-SDA (Wire) */
47+ {A5 , GET_PINS (1 ,1 ),"i2c1" }, /* I2C-SCL (Wire) */
48+
49+ };
0 commit comments