1
0

pins_arduino.c 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2021-12-10 Meco Man first version
  9. */
  10. #include <Arduino.h>
  11. #include <board.h>
  12. #include "pins_arduino.h"
  13. const pin_map_t pin_map_table[]=
  14. {
  15. /*
  16. {Arduino Pin, RT-Thread Pin [, Device Name(PWM or ADC), Channel]}
  17. [] means optional
  18. Digital pins must NOT give the device name and channel.
  19. Analog pins MUST give the device name and channel(ADC or PWM).
  20. */
  21. {0, GET_PIN(A,3)}, /* D0, RX */
  22. {1, GET_PIN(A,2)}, /* D1, TX */
  23. {2, GET_PIN(A,10)}, /* D2 */
  24. {3, GET_PIN(B,3), "pwm2", 2}, /* D3, PWM */
  25. {4, GET_PIN(B,5)}, /* D4 */
  26. {5, GET_PIN(B,4), "pwm3", 1}, /* D5, PWM */
  27. {6, GET_PIN(B,10), "pwm2", 3}, /* D6, PWM */
  28. {7, GET_PIN(A,8)}, /* D7 */
  29. {8, GET_PIN(A,9)}, /* D8 */
  30. {9, GET_PIN(C,7), "pwm3", 2}, /* D9, PWM */
  31. {10, GET_PIN(B,6)}, /* D10 */
  32. {11, GET_PIN(A,7)}, /* D11 */
  33. {12, GET_PIN(A,6)}, /* D12 */
  34. {13, GET_PIN(A,5)}, /* D13 */
  35. {14, GET_PIN(B,9)}, /* D14 */
  36. {15, GET_PIN(B,8)}, /* D15 */
  37. {16, GET_PIN(A,0), "adc1", 0}, /* A0 */
  38. {17, GET_PIN(A,1), "adc1", 1}, /* A1 */
  39. {18, GET_PIN(A,4), "adc1", 4}, /* A2 */
  40. {19, GET_PIN(B,0), "adc1", 8}, /* A3 */
  41. {20, GET_PIN(C,1), "adc1", 11}, /* A4 */
  42. {21, GET_PIN(C,0), "adc1", 10} /* A5 */
  43. };
  44. /* initialization for BSP; maybe a blank function */
  45. void initVariant(void)
  46. {
  47. /* Nothing needs to initialize for this BSP */
  48. }