variant.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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. #define PIN_TXCO (21)
  14. ////////////////////////////////////////////////////////////////////////////////
  15. // Power
  16. #define PIN_PWR_EN (12)
  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 PIN_GPS_TX
  31. #define PIN_SERIAL1_TX PIN_GPS_RX
  32. ////////////////////////////////////////////////////////////////////////////////
  33. // I2C pin definition
  34. #define PIN_WIRE_SDA (26) // P0.26
  35. #define PIN_WIRE_SCL (27) // P0.27
  36. ////////////////////////////////////////////////////////////////////////////////
  37. // SPI pin definition
  38. #define SPI_INTERFACES_COUNT (2)
  39. #define PIN_SPI_MISO (23)
  40. #define PIN_SPI_MOSI (22)
  41. #define PIN_SPI_SCK (19)
  42. #define PIN_SPI_NSS (24)
  43. ////////////////////////////////////////////////////////////////////////////////
  44. // Builtin LEDs
  45. #define LED_RED (-1)
  46. #define LED_GREEN (-1)
  47. #define LED_BLUE (-1)
  48. #define PIN_STATUS_LED LED_GREEN
  49. #define LED_BUILTIN LED_GREEN
  50. #define PIN_LED LED_BUILTIN
  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_USER_BTN BUTTON_PIN
  60. #define PIN_BUTTON2 (11)
  61. #define BUTTON_PIN2 PIN_BUTTON2
  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. ////////////////////////////////////////////////////////////////////////////////
  74. // SPI1
  75. #define PIN_SPI1_MISO (38)
  76. #define PIN_SPI1_MOSI (29)
  77. #define PIN_SPI1_SCK (31)
  78. // GxEPD2 needs that for a panel that is not even used !
  79. extern const int MISO;
  80. extern const int MOSI;
  81. extern const int SCK;
  82. ////////////////////////////////////////////////////////////////////////////////
  83. // Display
  84. #define DISP_MISO (38)
  85. #define DISP_MOSI (29)
  86. #define DISP_SCLK (31)
  87. #define DISP_CS (30)
  88. #define DISP_DC (28)
  89. #define DISP_RST (2)
  90. #define DISP_BUSY (3)
  91. #define DISP_BACKLIGHT (43)
  92. ////////////////////////////////////////////////////////////////////////////////
  93. // GPS
  94. #define PIN_GPS_RX (40)
  95. #define PIN_GPS_TX (41)
  96. #define GPS_EN (34)
  97. #define PIN_GPS_RESET (37)
  98. #define PIN_GPS_PPS (36)