variant.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. #ifndef _SEEED_WIO_TRACKER_L1_H_
  2. #define _SEEED_WIO_TRACKER_L1_H_
  3. /** Master clock frequency */
  4. #define VARIANT_MCK (64000000ul)
  5. #define USE_LFXO // Board uses 32khz crystal for LF
  6. /*----------------------------------------------------------------------------
  7. * Headers
  8. *----------------------------------------------------------------------------*/
  9. #include "WVariant.h"
  10. #define PINS_COUNT (38)
  11. #define NUM_DIGITAL_PINS (38)
  12. #define NUM_ANALOG_INPUTS (8)
  13. #define NUM_ANALOG_OUTPUTS (0)
  14. // LEDs
  15. #define PIN_LED (11)
  16. #define LED_BLUE (-1) // Disable annoying flashing caused by Bluefruit
  17. #define LED_BUILTIN PIN_LED
  18. #define P_LORA_TX_LED PIN_LED
  19. #define LED_STATE_ON 1
  20. // Buttons
  21. #define PIN_BUTTON1 (13) // Menu / User Button
  22. #define PIN_BUTTON2 (25) // Joystick Up
  23. #define PIN_BUTTON3 (26) // Joystick Down
  24. #define PIN_BUTTON4 (27) // Joystick Left
  25. #define PIN_BUTTON5 (28) // Joystick Right
  26. #define PIN_BUTTON6 (29) // Joystick Press
  27. #define PIN_BACK_BTN PIN_BUTTON1
  28. #define JOYSTICK_UP PIN_BUTTON2
  29. #define JOYSTICK_DOWN PIN_BUTTON3
  30. #define JOYSTICK_LEFT PIN_BUTTON4
  31. #define JOYSTICK_RIGHT PIN_BUTTON5
  32. #define JOYSTICK_PRESS PIN_BUTTON6
  33. #define PIN_USER_BTN PIN_BUTTON6
  34. // Buzzer
  35. // #define PIN_BUZZER (12) // Buzzer pin (defined per firmware type)
  36. #define VBAT_ENABLE (30)
  37. // Analog pins
  38. #define PIN_VBAT_READ (16)
  39. #define AREF_VOLTAGE (3.6F)
  40. #define ADC_MULTIPLIER (2.0F)
  41. #define ADC_RESOLUTION (12)
  42. // Serial interfaces
  43. #define PIN_SERIAL1_RX (7)
  44. #define PIN_SERIAL1_TX (6)
  45. // SPI Interfaces
  46. #define SPI_INTERFACES_COUNT (2)
  47. #define PIN_SPI_MISO (9)
  48. #define PIN_SPI_MOSI (10)
  49. #define PIN_SPI_SCK (8)
  50. // Lora Pins
  51. #define P_LORA_SCLK PIN_SPI_SCK
  52. #define P_LORA_MISO PIN_SPI_MISO
  53. #define P_LORA_MOSI PIN_SPI_MOSI
  54. #define P_LORA_DIO_1 (1)
  55. #define P_LORA_RESET (2)
  56. #define P_LORA_BUSY (3)
  57. #define P_LORA_NSS (4)
  58. #define SX126X_RXEN (5)
  59. #define SX126X_TXEN RADIOLIB_NC
  60. #define SX126X_DIO2_AS_RF_SWITCH true
  61. #define SX126X_DIO3_TCXO_VOLTAGE (1.8f)
  62. // Wire Interfaces
  63. #define WIRE_INTERFACES_COUNT (2)
  64. #define PIN_WIRE_SDA (14)
  65. #define PIN_WIRE_SCL (15)
  66. #define PIN_WIRE1_SDA (18)
  67. #define PIN_WIRE1_SCL (17)
  68. #define I2C_NO_RESCAN
  69. #define DISPLAY_ADDRESS 0x3D // SH1106 OLED I2C address
  70. // GPS L76KB
  71. #define GPS_BAUDRATE 9600
  72. #define PIN_GPS_TX PIN_SERIAL1_RX
  73. #define PIN_GPS_RX PIN_SERIAL1_TX
  74. #define PIN_GPS_STANDBY (0)
  75. #define PIN_GPS_EN (PIN_GPS_STANDBY)
  76. // QSPI Pins
  77. #define PIN_QSPI_SCK (19)
  78. #define PIN_QSPI_CS (20)
  79. #define PIN_QSPI_IO0 (21)
  80. #define PIN_QSPI_IO1 (22)
  81. #define PIN_QSPI_IO2 (23)
  82. #define PIN_QSPI_IO3 (24)
  83. #define EXTERNAL_FLASH_DEVICES P25Q16H
  84. #define EXTERNAL_FLASH_USE_QSPI
  85. // EInk on SPI1
  86. #define PIN_DISPLAY_CS (36)
  87. #define PIN_DISPLAY_BUSY (35)
  88. #define PIN_DISPLAY_DC (34)
  89. #define PIN_DISPLAY_RST (32)
  90. #define PIN_SPI1_MISO (37)
  91. #define PIN_SPI1_MOSI (33)
  92. #define PIN_SPI1_SCK (31)
  93. // GxEPD2 needs that for a panel that is not even used !
  94. extern const int MISO;
  95. extern const int MOSI;
  96. extern const int SCK;
  97. #endif