forked from RT-Thread/rt-thread
-
Notifications
You must be signed in to change notification settings - Fork 2
/
pins_arduino.c
50 lines (48 loc) · 1.72 KB
/
pins_arduino.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
* Copyright (c) 2006-2023, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
* Change Logs:
* Date Author Notes
* 2023-02-22 ChuShicheng first version
* 2023-02-23 Wangyuqiang second version
*/
#include <Arduino.h>
#include <board.h>
#include <drv_pin.h>
#include "pins_arduino.h"
/*
* {Arduino Pin, RT-Thread Pin [, Device Name, Channel]}
* [] means optional
* Digital pins must NOT give the device name and channel.
* Analog pins MUST give the device name and channel(ADC, PWM or DAC).
* Arduino Pin must keep in sequence.
*/
const pin_map_t pin_map_table[]=
{
{D0, GET_PINS(1,24), "uart1"}, /* Serial2-RX */
{D1, GET_PINS(0,27), "uart1"}, /* Serial2-TX */
{D2, GET_PINS(0,15)},
{D3, GET_PINS(1,6)},
{D4, GET_PINS(1,7), "pwm2", 2}, /* PWM */
{D5, GET_PINS(1,4), "pwm2", 1}, /* PWM */
{D6, GET_PINS(1,10)},
{D7, GET_PINS(1,9), "pwm1", 0}, /* PWM */
{D8, GET_PINS(1,8)},
{D9, GET_PINS(1,5)},
{D10, GET_PINS(1,1)},
{D11, GET_PINS(0,26)},
{D12, GET_PINS(1,3), "pwm0", 3}, /* PWM */
{D13, GET_PINS(1,2)},
{D14, GET_PINS(1,21), "i2c4"}, /* I2C-SDA (Wire) */
{D15, GET_PINS(1,20), "i2c4"}, /* I2C-SCL (Wire) */
{A0, GET_PINS(0,16), "adc0", 8}, /* ADC */
{A1, GET_PINS(0,23), "adc0", 0}, /* ADC */
{A2, RT_NULL},
{A3, GET_PINS(1,31)},
{A4, GET_PINS(0,13), "i2c1"}, /* I2C-SDA (Wire) */
{A5, GET_PINS(1,14), "i2c1"}, /* I2C-SCL (Wire) */
{A6, RT_NULL, "adc0", 13}, /* ADC, On-Chip: internal reference voltage, ADC_CHANNEL_VREFINT */
{A7, RT_NULL, "adc0", 26}, /* ADC, On-Chip: internal temperature sensor, ADC_CHANNEL_TEMPSENSOR */
};