1
0

arduino_layout.c 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. const pin_map_t pin_map_table[ARDUINO_LAYOUT_PIN_MAX]=
  13. {
  14. /*
  15. {Arduino Pin, RT-Thread Pin [, Device Name(PWM or ADC), Channel]}
  16. [] means optional
  17. Digital pins must NOT give the device name and channel.
  18. Analog pins MUST give the device name and channel(ADC or PWM).
  19. */
  20. {0}, /* D0, RX */
  21. {1}, /* D1, TX */
  22. {2, GET_PIN(D,10)}, /* D2, BSP:KEY0 */
  23. {3}, /* D3, PWM */
  24. {4, GET_PIN(D,9)}, /* D4, BSP:KEY1 */
  25. {5, GET_PIN(D,8)}, /* D5, BSP:KEY2 */
  26. {6}, /* D6, PWM */
  27. {7}, /* D7 */
  28. {8, GET_PIN(E,7)}, /* D8, BSP: RED-LED */
  29. {9}, /* D9, PWM */
  30. {10, GET_PIN(E,9), "pwm1", 1}, /* D10, PWM, BSP: BLUE-LED */
  31. {11, GET_PIN(B,8), "pwm4", 3}, /* D11, PWM */
  32. {12, GET_PIN(B,2)}, /* D12, BSP: BEEP */
  33. {13, GET_PIN(E,8)}, /* D13, LED_BUILTIN, BSP: GREEN-LED */
  34. {14, GET_PIN(C,2), "adc1", 3}, /* D14, A0 */
  35. {15}, /* D15, A1 */
  36. {16}, /* D16, A2 */
  37. {17}, /* D17, A3 */
  38. {18}, /* D18, A4 */
  39. {19} /* D19, A5 */
  40. };
  41. /* initialization for BSP; maybe a blank function */
  42. void initVariant(void)
  43. {
  44. /* Nothing needs to initialize for this BSP */
  45. }