variant.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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 PIN_PWR_EN (6)
  16. #define BATTERY_PIN (4)
  17. #define ADC_MULTIPLIER (4.90F)
  18. #define ADC_RESOLUTION (14)
  19. #define BATTERY_SENSE_RES (12)
  20. #define AREF_VOLTAGE (3.0)
  21. ////////////////////////////////////////////////////////////////////////////////
  22. // Number of pins
  23. #define PINS_COUNT (48)
  24. #define NUM_DIGITAL_PINS (48)
  25. #define NUM_ANALOG_INPUTS (1)
  26. #define NUM_ANALOG_OUTPUTS (0)
  27. ////////////////////////////////////////////////////////////////////////////////
  28. // UART pin definition
  29. #define PIN_SERIAL1_RX (41) // GPS TX
  30. #define PIN_SERIAL1_TX (40) // GPS RX
  31. ////////////////////////////////////////////////////////////////////////////////
  32. // I2C pin definition
  33. #define PIN_WIRE_SDA (26) // P0.26
  34. #define PIN_WIRE_SCL (27) // P0.27
  35. ////////////////////////////////////////////////////////////////////////////////
  36. // SPI pin definition
  37. #define SPI_INTERFACES_COUNT (2)
  38. #define PIN_SPI_MISO (23)
  39. #define PIN_SPI_MOSI (22)
  40. #define PIN_SPI_SCK (19)
  41. #define PIN_SPI_NSS (24)
  42. ////////////////////////////////////////////////////////////////////////////////
  43. // Builtin LEDs
  44. #define LED_RED (13)
  45. #define LED_BLUE (14)
  46. #define LED_GREEN (15)
  47. #define LED_BUILTIN (15)
  48. #define PIN_LED LED_BUILTIN
  49. #define LED_PIN LED_BUILTIN
  50. #define LED_STATE_ON LOW
  51. #define PIN_NEOPIXEL (14)
  52. #define NEOPIXEL_NUM (2)
  53. ////////////////////////////////////////////////////////////////////////////////
  54. // Builtin buttons
  55. #define PIN_BUTTON1 (42)
  56. #define BUTTON_PIN PIN_BUTTON1
  57. #define PIN_BUTTON2 (18)
  58. #define BUTTON_PIN2 PIN_BUTTON2
  59. #define EXTERNAL_FLASH_DEVICES MX25R1635F
  60. #define EXTERNAL_FLASH_USE_QSPI
  61. ////////////////////////////////////////////////////////////////////////////////
  62. // Lora
  63. #define USE_SX1262
  64. #define LORA_CS (24)
  65. #define SX126X_DIO1 (20)
  66. #define SX126X_BUSY (17)
  67. #define SX126X_RESET (25)
  68. #define SX126X_DIO2_AS_RF_SWITCH
  69. #define SX126X_DIO3_TCXO_VOLTAGE 1.8
  70. #define PIN_SPI1_MISO (39)
  71. #define PIN_SPI1_MOSI (29)
  72. #define PIN_SPI1_SCK (31)