pins_arduino.c 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. * Copyright (c) 2006-2022, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2022-12-21 ChuShicheng first version
  9. */
  10. #include <Arduino.h>
  11. #include "pins_arduino.h"
  12. /*
  13. * {Arduino Pin, RT-Thread Pin [, Device Name, Channel]}
  14. * [] means optional
  15. * Digital pins must NOT give the device name and channel.
  16. * Analog pins MUST give the device name and channel(ADC, PWM or DAC).
  17. * Arduino Pin must keep in sequence.
  18. */
  19. const pin_map_t pin_map_table[]=
  20. {
  21. {D0, GET_PIN(F,14)}, /* LED_BUILTIN */
  22. {D1, GET_PIN(D,9), "uart3"}, /* Serial-RX */
  23. {D2, GET_PIN(D,8), "uart3"}, /* Serial-TX */
  24. {D3, GET_PIN(G,9), "uart6"}, /* Serial-RX */
  25. {D4, GET_PIN(G,14), "uart6"}, /* Serial-TX */
  26. {D5, GET_PIN(E,0), "uart8"}, /* Serial-RX */
  27. {D6, GET_PIN(E,1), "uart8"}, /* Serial-TX */
  28. {D7, GET_PIN(E,7), "uart7"}, /* Serial-RX */
  29. {D8, GET_PIN(E,8), "uart7"}, /* Serial-TX */
  30. {D9, GET_PIN(H,6), "pwm12", 1}, /* BSP: Buzzer, PWM */
  31. {D10, GET_PIN(D,12), "pwm4", 1}, /* PWM */
  32. {D11, GET_PIN(D,13), "pwm4", 2}, /* PWM */
  33. {D12, GET_PIN(D,14), "pwm4", 3}, /* PWM */
  34. {D13, GET_PIN(D,15), "pwm4", 4}, /* PWM */
  35. {D14, GET_PIN(H,10), "pwm5", 1}, /* PWM */
  36. {D15, GET_PIN(H,11), "pwm5", 2}, /* PWM */
  37. {D16, GET_PIN(H,12), "pwm5", 3}, /* PWM */
  38. {D17, GET_PIN(I,0), "pwm5", 4}, /* PWM */
  39. {D18, GET_PIN(A,0), "pwm2", 1}, /* PWM */
  40. {D19, GET_PIN(A,1), "pwm2", 2}, /* PWM */
  41. {D20, GET_PIN(A,2), "pwm2", 3}, /* PWM */
  42. {D21, GET_PIN(A,3), "pwm2", 4}, /* PWM */
  43. {D22, GET_PIN(I,5), "pwm8", 1}, /* PWM */
  44. {D23, GET_PIN(I,6), "pwm8", 2}, /* PWM */
  45. {D24, GET_PIN(I,7), "pwm8", 3}, /* PWM */
  46. {D25, GET_PIN(I,2), "pwm8", 4}, /* PWM */
  47. {D26, GET_PIN(F,1)},
  48. {D27, GET_PIN(F,0)},
  49. {D28, GET_PIN(E,4), "i2c1"}, /* I2C-SCL (Wire) */
  50. {D29, GET_PIN(E,5), "i2c1"}, /* I2C-SDA (Wire) */
  51. {D30, GET_PIN(E,6)},
  52. {D31, GET_PIN(E,12)},
  53. {D32, GET_PIN(C,2)},
  54. {D33, GET_PIN(B,0)},
  55. {D34, GET_PIN(C,3)},
  56. {D35, GET_PIN(B,1)},
  57. {D36, GET_PIN(C,4)},
  58. {D37, GET_PIN(C,0)},
  59. {D38, GET_PIN(C,5)},
  60. {D39, GET_PIN(C,1)},
  61. {D40, GET_PIN(A,5)},
  62. {D41, GET_PIN(A,4)},
  63. {D42, GET_PIN(F,10)},
  64. {D43, GET_PIN(I,9)},
  65. {A0, RT_NULL, "adc1", RT_ADC_INTERN_CH_VREF}, /* ADC, On-Chip: internal temperature sensor */
  66. {A1, RT_NULL, "adc1", RT_ADC_INTERN_CH_TEMPER}, /* ADC, On-Chip: internal reference voltage */
  67. };