pins_arduino.c 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. * 2023-02-22 ChuShicheng first version
  9. * 2023-02-23 Wangyuqiang second version
  10. */
  11. #include <Arduino.h>
  12. #include <board.h>
  13. #include "pins_arduino.h"
  14. /*
  15. * {Arduino Pin, RT-Thread Pin [, Device Name, Channel]}
  16. * [] means optional
  17. * Digital pins must NOT give the device name and channel.
  18. * Analog pins MUST give the device name and channel(ADC, PWM or DAC).
  19. * Arduino Pin must keep in sequence.
  20. */
  21. const pin_map_t pin_map_table[]=
  22. {
  23. {D0, GET_PINS(1,24), "uart1"}, /* Serial2-RX */
  24. {D1, GET_PINS(0,27), "uart1"}, /* Serial2-TX */
  25. {D2, GET_PINS(0,15)},
  26. {D3, GET_PINS(1,6)},
  27. {D4, GET_PINS(1,7), "pwm2", 2}, /* PWM */
  28. {D5, GET_PINS(1,4), "pwm2", 1}, /* PWM */
  29. {D6, GET_PINS(1,10)},
  30. {D7, GET_PINS(1,9), "pwm1", 0}, /* PWM */
  31. {D8, GET_PINS(1,8)},
  32. {D9, GET_PINS(1,5)},
  33. {D10, GET_PINS(1,1)},
  34. {D11, GET_PINS(0,26)},
  35. {D12, GET_PINS(1,3), "pwm0", 3}, /* PWM */
  36. {D13, GET_PINS(1,2)},
  37. {D14, GET_PINS(1,21), "i2c4"}, /* I2C-SDA (Wire) */
  38. {D15, GET_PINS(1,20), "i2c4"}, /* I2C-SCL (Wire) */
  39. {A0, GET_PINS(0,16), "adc0", 8}, /* ADC */
  40. {A1, GET_PINS(0,23), "adc0", 0}, /* ADC */
  41. {A2, RT_NULL},
  42. {A3, GET_PINS(1,31)},
  43. {A4, GET_PINS(0,13), "i2c1"}, /* I2C-SDA (Wire) */
  44. {A5, GET_PINS(1,14), "i2c1"}, /* I2C-SCL (Wire) */
  45. {A6, RT_NULL, "adc0", 13}, /* ADC, On-Chip: internal reference voltage, ADC_CHANNEL_VREFINT */
  46. {A7, RT_NULL, "adc0", 26}, /* ADC, On-Chip: internal temperature sensor, ADC_CHANNEL_TEMPSENSOR */
  47. };