variant.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. /*
  2. * variant.h - Seeed Wio WM1110 Dev Board
  3. * nRF52840 + LR1110 (LoRa + GNSS + WiFi Scanner)
  4. */
  5. #pragma once
  6. #include "WVariant.h"
  7. ////////////////////////////////////////////////////////////////////////////////
  8. // Low frequency clock source
  9. #define USE_LFXO // 32.768 kHz crystal oscillator
  10. #define VARIANT_MCK (64000000ul)
  11. ////////////////////////////////////////////////////////////////////////////////
  12. // Power
  13. #define BATTERY_PIN (31) // AIN7
  14. #define BATTERY_IMMUTABLE
  15. #define ADC_MULTIPLIER (2.0F)
  16. #define ADC_RESOLUTION (14)
  17. #define BATTERY_SENSE_RES (12)
  18. #define AREF_VOLTAGE (3.0)
  19. ////////////////////////////////////////////////////////////////////////////////
  20. // Number of pins
  21. #define PINS_COUNT (48)
  22. #define NUM_DIGITAL_PINS (48)
  23. #define NUM_ANALOG_INPUTS (8)
  24. #define NUM_ANALOG_OUTPUTS (0)
  25. ////////////////////////////////////////////////////////////////////////////////
  26. // UART pin definition
  27. #define PIN_SERIAL1_RX (22)
  28. #define PIN_SERIAL1_TX (24)
  29. #define PIN_SERIAL2_RX (6)
  30. #define PIN_SERIAL2_TX (8)
  31. ////////////////////////////////////////////////////////////////////////////////
  32. // I2C pin definition
  33. #define HAS_WIRE (1)
  34. #define WIRE_INTERFACES_COUNT (1)
  35. #define PIN_WIRE_SDA (27)
  36. #define PIN_WIRE_SCL (26)
  37. #define I2C_NO_RESCAN
  38. #define SENSOR_POWER_PIN (7)
  39. #define HAS_LIS3DH (1)
  40. #define LIS3DH_INT_PIN_1 (11)
  41. #define LIS3DH_INT_PIN_2 (12)
  42. #define HAS_SHT41 (1)
  43. ////////////////////////////////////////////////////////////////////////////////
  44. // SPI pin definition
  45. #define SPI_INTERFACES_COUNT (1)
  46. #define PIN_SPI_MISO (47)
  47. #define PIN_SPI_MOSI (46)
  48. #define PIN_SPI_SCK (45)
  49. #define PIN_SPI_NSS (44)
  50. ////////////////////////////////////////////////////////////////////////////////
  51. // Builtin LEDs
  52. #define LED_BUILTIN (13)
  53. #define LED_GREEN (13)
  54. #define LED_RED (14)
  55. #define LED_BLUE LED_RED
  56. #define LED_PIN LED_GREEN
  57. #define LED_STATE_ON HIGH
  58. ////////////////////////////////////////////////////////////////////////////////
  59. // Builtin buttons
  60. #define PIN_BUTTON1 (-1)
  61. #define BUTTON_PIN PIN_BUTTON1
  62. ////////////////////////////////////////////////////////////////////////////////
  63. // LR1110 LoRa Radio + GNSS + WiFi
  64. #define LORA_DIO_1 (40) // P1.8 - LR1110_IRQ_PIN
  65. #define LORA_NSS (PIN_SPI_NSS) // P1.12
  66. #define LORA_RESET (42) // P1.10 - LR1110_NRESET_PIN
  67. #define LORA_BUSY (43) // P1.11 - LR1110_BUSY_PIN
  68. #define LORA_SCLK (PIN_SPI_SCK) // P1.13
  69. #define LORA_MISO (PIN_SPI_MISO) // P1.15
  70. #define LORA_MOSI (PIN_SPI_MOSI) // P1.14
  71. #define LORA_CS PIN_SPI_NSS // P1.12
  72. // LR1110 specific settings
  73. #define LR11X0_DIO_AS_RF_SWITCH true
  74. #define LR11X0_DIO3_TCXO_VOLTAGE 1.8
  75. #define LR1110_GNSS_ANT_PIN (37) // P1.5
  76. // Pin aliases for LR1110 driver compatibility
  77. #define LR1110_IRQ_PIN LORA_DIO_1
  78. #define LR1110_NRESET_PIN LORA_RESET
  79. #define LR1110_BUSY_PIN LORA_BUSY
  80. #define LR1110_SPI_NSS_PIN LORA_CS
  81. #define LR1110_SPI_SCK_PIN LORA_SCLK
  82. #define LR1110_SPI_MOSI_PIN LORA_MOSI
  83. #define LR1110_SPI_MISO_PIN LORA_MISO
  84. ////////////////////////////////////////////////////////////////////////////////
  85. // Analog Input Pins
  86. #define SENSOR_AIN_0 (2)
  87. #define SENSOR_AIN_1 (3)
  88. #define SENSOR_AIN_2 (4)
  89. #define SENSOR_AIN_3 (5)
  90. #define SENSOR_AIN_4 (28)
  91. #define SENSOR_AIN_5 (29)
  92. #define SENSOR_AIN_6 (30)
  93. #define SENSOR_AIN_7 (31)
  94. static const uint8_t A0 = SENSOR_AIN_0;
  95. static const uint8_t A1 = SENSOR_AIN_1;
  96. static const uint8_t A2 = SENSOR_AIN_2;
  97. static const uint8_t A3 = SENSOR_AIN_3;
  98. static const uint8_t A4 = SENSOR_AIN_4;
  99. static const uint8_t A5 = SENSOR_AIN_5;
  100. static const uint8_t A6 = SENSOR_AIN_6;
  101. static const uint8_t A7 = SENSOR_AIN_7;
  102. ////////////////////////////////////////////////////////////////////////////////
  103. // GPS/GNSS
  104. #define HAS_GPS 0
  105. #define PIN_GPS_TX (-1)
  106. #define PIN_GPS_RX (-1)
  107. #define GPS_EN (-1)
  108. #define GPS_RESET (-1)