pins_arduino.c 2.6 KB

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