variant.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. /*
  2. * variant.h
  3. * Copyright (C) 2023 Seeed K.K.
  4. * MIT License
  5. */
  6. #pragma once
  7. #include "WVariant.h"
  8. ////////////////////////////////////////////////////////////////////////////////
  9. // Low frequency clock source
  10. #define USE_LFXO // 32.768 kHz crystal oscillator
  11. #define VARIANT_MCK (64000000ul)
  12. // #define USE_LFRC // 32.768 kHz RC oscillator
  13. ////////////////////////////////////////////////////////////////////////////////
  14. // Power
  15. #define NRF_APM // detect usb power
  16. #define PIN_3V3_EN (38) // P1.6 Power to Sensors
  17. #define BATTERY_PIN (2) // P0.2/AIN0
  18. #define BATTERY_IMMUTABLE
  19. #define ADC_MULTIPLIER (2.0F)
  20. #define EXT_CHRG_DETECT (35) // P1.3
  21. #define EXT_PWR_DETECT (5) // P0.5
  22. #define ADC_RESOLUTION (14)
  23. #define BATTERY_SENSE_RES (12)
  24. #define AREF_VOLTAGE (3.0)
  25. ////////////////////////////////////////////////////////////////////////////////
  26. // Number of pins
  27. #define PINS_COUNT (48)
  28. #define NUM_DIGITAL_PINS (48)
  29. #define NUM_ANALOG_INPUTS (6)
  30. #define NUM_ANALOG_OUTPUTS (0)
  31. ////////////////////////////////////////////////////////////////////////////////
  32. // UART pin definition
  33. #define PIN_SERIAL1_RX (14) // P0.14
  34. #define PIN_SERIAL1_TX (13) // P0.13
  35. #define PIN_SERIAL2_RX (17) // P0.17
  36. #define PIN_SERIAL2_TX (16) // P0.16
  37. ////////////////////////////////////////////////////////////////////////////////
  38. // I2C pin definition
  39. #define HAS_WIRE (1)
  40. #define WIRE_INTERFACES_COUNT (1)
  41. #define PIN_WIRE_SDA (26) // P0.26
  42. #define PIN_WIRE_SCL (27) // P0.27
  43. #define I2C_NO_RESCAN
  44. #define HAS_QMA6100P
  45. #define QMA_6100P_INT_PIN (34) // P1.2
  46. ////////////////////////////////////////////////////////////////////////////////
  47. // SPI pin definition
  48. #define SPI_INTERFACES_COUNT (1)
  49. #define PIN_SPI_MISO (40) // P1.8
  50. #define PIN_SPI_MOSI (41) // P1.9
  51. #define PIN_SPI_SCK (11) // P0.11
  52. #define PIN_SPI_NSS (12) // P0.12
  53. ////////////////////////////////////////////////////////////////////////////////
  54. // Builtin LEDs
  55. #define LED_BUILTIN (-1)
  56. #define LED_BLUE (-1) // No blue led
  57. #define LED_GREEN (24) // P0.24
  58. #define LED_PIN LED_GREEN
  59. #define LED_STATE_ON HIGH
  60. ////////////////////////////////////////////////////////////////////////////////
  61. // Builtin buttons
  62. #define PIN_BUTTON1 (6) // P0.6
  63. #define BUTTON_PIN PIN_BUTTON1
  64. ////////////////////////////////////////////////////////////////////////////////
  65. // LR1110
  66. #define LORA_DIO_1 (33) // P1.1
  67. #define LORA_NSS (PIN_SPI_NSS) // P0.12
  68. #define LORA_RESET (42) // P1.10
  69. #define LORA_BUSY (7) // P0.7
  70. #define LORA_SCLK (PIN_SPI_SCK) // P0.11
  71. #define LORA_MISO (PIN_SPI_MISO) // P1.8
  72. #define LORA_MOSI (PIN_SPI_MOSI) // P0.9
  73. #define LR11X0_DIO_AS_RF_SWITCH true
  74. #define LR11X0_DIO3_TCXO_VOLTAGE 1.6
  75. ////////////////////////////////////////////////////////////////////////////////
  76. // GPS
  77. #define HAS_GPS 1
  78. #define GPS_RX_PIN PIN_SERIAL1_RX
  79. #define GPS_TX_PIN PIN_SERIAL1_TX
  80. #define GPS_EN (43) // P1.11
  81. #define GPS_RESET (47) // P1.15
  82. #define GPS_VRTC_EN (8) // P0.8
  83. #define GPS_SLEEP_INT (44) // P1.12
  84. #define GPS_RTC_INT (15) // P0.15
  85. #define GPS_RESETB (46) // P1.14
  86. ////////////////////////////////////////////////////////////////////////////////
  87. // Temp+Lux Sensor
  88. #define SENSOR_EN (4) // P0.4
  89. #define TEMP_SENSOR (31) // P0.31/AIN7
  90. #define LUX_SENSOR (29) // P0.29/AIN5
  91. ////////////////////////////////////////////////////////////////////////////////
  92. // Accelerometer (I2C addr : ??? )
  93. #define PIN_3V3_ACC_EN (39) // P1.7
  94. ////////////////////////////////////////////////////////////////////////////////
  95. // Buzzer
  96. #define BUZZER_EN (37) // P1.5
  97. #define BUZZER_PIN (25) // P0.25