variant.cpp 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /*
  2. Copyright (c) 2014-2015 Arduino LLC. All right reserved.
  3. Copyright (c) 2016 Sandeep Mistry All right reserved.
  4. Copyright (c) 2018, Adafruit Industries (adafruit.com)
  5. This library is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU Lesser General Public
  7. License as published by the Free Software Foundation; either
  8. version 2.1 of the License, or (at your option) any later version.
  9. This library is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  12. See the GNU Lesser General Public License for more details.
  13. You should have received a copy of the GNU Lesser General Public
  14. License along with this library; if not, write to the Free Software
  15. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  16. */
  17. #include "variant.h"
  18. #include "wiring_constants.h"
  19. #include "wiring_digital.h"
  20. #include "nrf.h"
  21. const uint32_t g_ADigitalPinMap[] =
  22. {
  23. // P0
  24. 0, // P0.00 (NC) (XTAL)
  25. 1, // P0.01 (NC) (XTAL)
  26. 2, // P0.02 (30) GPS_PPS
  27. 3, // P0.03 (29) BUZZER_DRIVE
  28. 4, // P0.04 (41) NC
  29. 5, // P0.05 (40) NC
  30. 6, // P0.06 (NC) NOT_PRESENT
  31. 7, // P0.07 (NC) (TRACECLK)
  32. 8, // P0.08 (NC) NOT_PRESENT
  33. 9, // P0.09 (13) NC
  34. 10, // P0.10 (12) NC
  35. 11, // P0.11 (NC) NOT_PRESENT
  36. 12, // P0.12 (NC) NOT_PRESENT
  37. 13, // P0.13 (04) DCDC_EN_MCU_HOLD
  38. 14, // P0.14 (05) NC
  39. 15, // P0.15 (06) NC
  40. 16, // P0.16 (07) NC
  41. 17, // P0.17 (08) NC
  42. 18, // P0.18 (17) !RESET
  43. 19, // P0.19 (09) RTC_SDA
  44. 20, // P0.20 (10) RTC_SCL
  45. 21, // P0.21 (11) NC
  46. 22, // P0.22 (NC) NOT_PRESENT
  47. 23, // P0.23 (NC) NOT_PRESENT
  48. 24, // P0.24 (23) UART_GPS_RX
  49. 25, // P0.25 (24) UART_GPS_TX
  50. 26, // P0.26 (26) BTN_OK/USR_BTN_PROCESSED
  51. 27, // P0.27 (NC) NOT_PRESENT
  52. 28, // P0.28 (31) BLU_LED_RAK
  53. 29, // P0.29 (32) SOFT_SHUTDOWN_SIGNAL
  54. 30, // P0.30 (33) MCU_SIGNAL
  55. 31, // P0.31 (39) ADC_VBAT
  56. // P1
  57. 32, // P1.00 (NC) NOT_PRESENT
  58. 33, // P1.01 (25) GPS_EN
  59. 34, // P1.02 (26) BAT_CHG_STATUS
  60. 35, // P1.03 (27) NC
  61. 36, // P1.04 (28) GRN_LED_RAK
  62. 37, // P1.05 (SX) SX126X_POWER_EN
  63. 38, // P1.06 (SX) P_LORA_RESET
  64. 39, // P1.07 (NC) NOT_PRESENT
  65. 40, // P1.08 (NC) NOT_PRESENT
  66. 41, // P1.09 (NC) NOT_PRESENT
  67. 42, // P1.10 (SX) P_LORA_NSS
  68. 43, // P1.11 (SX) P_LORA_SCLK
  69. 44, // P1.12 (SX) P_LORA_MOSI
  70. 45, // P1.13 (SX) P_LORA_MISO
  71. 46, // P1.14 (SX) P_LORA_BUSY
  72. 47 // P1.15 (SX) P_LORA_DIO_1
  73. };
  74. void initVariant()
  75. {
  76. // Red & Green LEDs - enable & turn off
  77. pinMode(LED_GREEN, OUTPUT);
  78. ledOff(LED_GREEN);
  79. pinMode(LED_BLUE, OUTPUT);
  80. ledOff(LED_BLUE);
  81. pinMode(PIN_GPS_EN, OUTPUT);
  82. }