pins_arduino.c 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Copyright (c) 2006-2024, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2024-01-25 ShichengChu 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, 0, "uart0"}, /* Serial-TX */
  23. {D1, 1, "uart0"}, /* Serial-RX */
  24. {D2, 2},
  25. {D3, 3},
  26. {D4, 4, "i2c0"}, /* I2C-SDA (Wire) */
  27. {D5, 5, "i2c0"}, /* I2C-SCL (Wire) */
  28. {D6, 6},
  29. {D7, 7},
  30. {D8, 8, "uart1"}, /* Serial2-TX */
  31. {D9, 9, "uart1"}, /* Serial2-RX */
  32. {D10, 10, "pwm5", 0}, /* PWM */
  33. {D11, 11, "pwm5", 1}, /* PWM */
  34. {D12, 12, "pwm6", 0}, /* PWM */
  35. {D13, 13, "pwm6", 1}, /* PWM */
  36. {D14, 14, "pwm7", 0}, /* PWM */
  37. {D15, 15, "pwm7", 1}, /* PWM */
  38. {D16, 16, "pwm0", 0}, /* PWM */
  39. {D17, 17, "pwm0", 1}, /* PWM */
  40. {D18, 18, "pwm1", 0}, /* PWM */
  41. {D19, 19, "pwm1", 1}, /* PWM */
  42. {D20, 20, "pwm2", 0}, /* PWM */
  43. {D21, 21, "pwm2", 1}, /* PWM */
  44. {D22, 22, "pwm3", 0}, /* PWM */
  45. {D23, 23, "pwm3", 1}, /* PWM */
  46. {D24, 24, "pwm4", 0}, /* PWM */
  47. {D25, 25, "pwm4", 1}, /* LED_BUILTIN */
  48. {A0, 26, "adc0", 0}, /* ADC */
  49. {A1, 27, "adc1", 1}, /* ADC */
  50. {A2, 28, "adc2", 2}, /* ADC */
  51. };