arduino_pinout.c 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 "arduino_pinout.h"
  13. const pin_map_t pin_map_table[ARDUINO_PINOUT_PIN_MAX]=
  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}, /* D0, RX */
  22. {1}, /* D1, TX */
  23. {2, GET_PIN(D,10)}, /* D2, BSP:KEY0 */
  24. {3}, /* D3, PWM */
  25. {4, GET_PIN(D,9)}, /* D4, BSP:KEY1 */
  26. {5, GET_PIN(D,8)}, /* D5, BSP:KEY2 */
  27. {6}, /* D6, PWM */
  28. {7}, /* D7 */
  29. {8, GET_PIN(E,7)}, /* D8, BSP: RED-LED */
  30. {9}, /* D9, PWM */
  31. {10, GET_PIN(E,9), "pwm1", 1}, /* D10, PWM, BSP: BLUE-LED */
  32. {11, GET_PIN(B,8), "pwm4", 3}, /* D11, PWM */
  33. {12, GET_PIN(B,2)}, /* D12, BSP: BEEP */
  34. {13, GET_PIN(E,8)}, /* D13, LED_BUILTIN, BSP: GREEN-LED */
  35. {14, GET_PIN(C,2), "adc1", 3}, /* D14, A0 */
  36. {15}, /* D15, A1 */
  37. {16}, /* D16, A2 */
  38. {17}, /* D17, A3 */
  39. {18}, /* D18, A4 */
  40. {19} /* D19, A5 */
  41. };
  42. /* initialization for BSP; maybe a blank function */
  43. void initVariant(void)
  44. {
  45. /* Nothing needs to initialize for this BSP */
  46. }