variant.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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 WIRE_INTERFACES_COUNT (1)
  13. ////////////////////////////////////////////////////////////////////////////////
  14. // Power
  15. #define NRF_APM
  16. #define PIN_3V3_EN (38)
  17. #define BATTERY_PIN (4)
  18. #define ADC_MULTIPLIER (4.90F)
  19. #define ADC_RESOLUTION (14)
  20. #define BATTERY_SENSE_RES (12)
  21. #define AREF_VOLTAGE (3.0)
  22. ////////////////////////////////////////////////////////////////////////////////
  23. // Number of pins
  24. #define PINS_COUNT (48)
  25. #define NUM_DIGITAL_PINS (48)
  26. #define NUM_ANALOG_INPUTS (1)
  27. #define NUM_ANALOG_OUTPUTS (0)
  28. ////////////////////////////////////////////////////////////////////////////////
  29. // UART pin definition
  30. #define PIN_SERIAL1_RX (37)
  31. #define PIN_SERIAL1_TX (39)
  32. #define PIN_SERIAL2_RX (9)
  33. #define PIN_SERIAL2_TX (10)
  34. ////////////////////////////////////////////////////////////////////////////////
  35. // I2C pin definition
  36. #define PIN_WIRE_SDA (26) // P0.26
  37. #define PIN_WIRE_SCL (27) // P0.27
  38. ////////////////////////////////////////////////////////////////////////////////
  39. // SPI pin definition
  40. #define SPI_INTERFACES_COUNT (2)
  41. #define PIN_SPI_MISO (23)
  42. #define PIN_SPI_MOSI (22)
  43. #define PIN_SPI_SCK (19)
  44. #define PIN_SPI_NSS (24)
  45. ////////////////////////////////////////////////////////////////////////////////
  46. // Builtin LEDs
  47. #define LED_BUILTIN (35)
  48. #define PIN_LED LED_BUILTIN
  49. #define LED_RED LED_BUILTIN
  50. #define LED_BLUE (-1) // No blue led, prevents Bluefruit flashing the green LED during advertising
  51. #define LED_PIN LED_BUILTIN
  52. #define LED_STATE_ON LOW
  53. #define PIN_NEOPIXEL (14)
  54. #define NEOPIXEL_NUM (2)
  55. ////////////////////////////////////////////////////////////////////////////////
  56. // Builtin buttons
  57. #define PIN_BUTTON1 (42)
  58. #define BUTTON_PIN PIN_BUTTON1
  59. // #define PIN_BUTTON2 (11)
  60. // #define BUTTON_PIN2 PIN_BUTTON2
  61. #define PIN_USER_BTN BUTTON_PIN
  62. #define EXTERNAL_FLASH_DEVICES MX25R1635F
  63. #define EXTERNAL_FLASH_USE_QSPI
  64. ////////////////////////////////////////////////////////////////////////////////
  65. // Lora
  66. #define USE_SX1262
  67. #define LORA_CS (24)
  68. #define SX126X_DIO1 (20)
  69. #define SX126X_BUSY (17)
  70. #define SX126X_RESET (25)
  71. #define SX126X_DIO2_AS_RF_SWITCH
  72. #define SX126X_DIO3_TCXO_VOLTAGE 1.8
  73. #define PIN_SPI1_MISO (43)
  74. #define PIN_SPI1_MOSI (41)
  75. #define PIN_SPI1_SCK (40)
  76. ////////////////////////////////////////////////////////////////////////////////
  77. // Buzzer
  78. // #define PIN_BUZZER (46)
  79. ////////////////////////////////////////////////////////////////////////////////
  80. // GPS
  81. #define GPS_EN (21)
  82. #define GPS_RESET (38)
  83. ////////////////////////////////////////////////////////////////////////////////
  84. // TFT
  85. #define PIN_TFT_SCL (40)
  86. #define PIN_TFT_SDA (41)
  87. #define PIN_TFT_RST (2)
  88. #define PIN_TFT_VDD_CTL (3)
  89. #define PIN_TFT_LEDA_CTL (15)
  90. #define PIN_TFT_CS (11)
  91. #define PIN_TFT_DC (12)