pins_arduino.c 1.9 KB
Newer Older
1
/*
2
 * Copyright (c) 2006-2022, RT-Thread Development Team
3 4 5 6 7 8 9 10 11
 *
 * SPDX-License-Identifier: Apache-2.0
 *
 * Change Logs:
 * Date           Author       Notes
 * 2021-12-10     Meco Man     first version
 */
#include <Arduino.h>
#include <board.h>
12
#include "pins_arduino.h"
13

14 15 16 17
/*
    {Arduino Pin, RT-Thread Pin [, Device Name(PWM or ADC), Channel]}
    [] means optional
    Digital pins must NOT give the device name and channel.
mysterywolf's avatar
mysterywolf 已提交
18
    Analog pins MUST give the device name and channel(ADC, PWM or DAC).
19 20
    Arduino Pin must keep in sequence.
*/
21
const pin_map_t pin_map_table[]=
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
    {D0}, /* RX */
    {D1}, /* TX */
    {D2, GET_PIN(B,9)},
    {D3, GET_PIN(D,15), "pwm4", 4}, /* PWM */
    {D4, GET_PIN(A,8)},
    {D5, GET_PIN(D,14)},
    {D6, GET_PIN(B,11), "pwm2", 4}, /* PWM */
    {D7, GET_PIN(B,14)},
    {D8, GET_PIN(B,12)},
    {D9, GET_PIN(D,12), "pwm4", 1}, /* PWM */
    {D10, GET_PIN(B,10), "pwm2", 3}, /* PWM */
    {D11, GET_PIN(B,8), "pwm4", 3}, /* PWM */
    {D12, GET_PIN(B,15)},
    {D13, GET_PIN(B,13)},
    {D14, GET_PIN(A,1)}, /* BSP: MOTOR-A */
    {D15, GET_PIN(A,0)}, /* BSP: MOTOR-B */
    {D16, GET_PIN(B,2)}, /* BSP: BEEP */
    {D17, GET_PIN(D,10)}, /* BSP: KEY0 */
    {D18, GET_PIN(D,9)}, /* BSP: KEY1 */
    {D19, GET_PIN(D,8)}, /* BSP: KEY2 */
    {D20, GET_PIN(C,13)}, /* BSP: KEY-WKUP */
    {D21, GET_PIN(E,7)}, /* BSP: RED-LED */
    {D22, GET_PIN(E,8)}, /* LED_BUILTIN, BSP: GREEN-LED */
    {D23, GET_PIN(E,9), "pwm1", 1}, /* PWM, BSP: BLUE-LED */
mysterywolf's avatar
mysterywolf 已提交
47 48
    {D24, GET_PIN(B,0)}, /* INFRARED EMISSION */
    {D25, GET_PIN(B,1)}, /* INFRARED RECEPTION */
49 50
    {A0, GET_PIN(C,2), "adc1", 3}, /* ADC */
    {A1, GET_PIN(C,4), "adc1", 13}, /* ADC */
51 52
    {A2, RT_NULL, "adc1", 0}, /* ADC, On-Chip: internal reference voltage, ADC_CHANNEL_VREFINT */
    {A3, RT_NULL, "adc1", 17}, /* ADC, On-Chip: internal temperature sensor, ADC_CHANNEL_TEMPSENSOR */
mysterywolf's avatar
mysterywolf 已提交
53
    {DAC0, GET_PIN(A,4), "dac1", 1} /* DAC */
54
};