variant.h 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #pragma once
  2. #include "WVariant.h"
  3. // Low frequency clock source
  4. #define USE_LFXO // 32.768 kHz crystal oscillator
  5. #define VARIANT_MCK (64000000ul)
  6. // #define USE_LFRC // 32.768 kHz RC oscillator
  7. // Power
  8. #define BATTERY_PIN (31)
  9. #define BATTERY_IMMUTABLE
  10. #define ADC_MULTIPLIER (2.0F)
  11. #define ADC_RESOLUTION (14)
  12. #define BATTERY_SENSE_RES (12)
  13. // Number of pins
  14. #define PINS_COUNT (48)
  15. #define NUM_DIGITAL_PINS (48)
  16. #define NUM_ANALOG_INPUTS (6)
  17. #define NUM_ANALOG_OUTPUTS (0)
  18. // UART pin definition
  19. #define PIN_SERIAL1_RX (14) // P0.14
  20. #define PIN_SERIAL1_TX (13) // P0.13
  21. #define PIN_SERIAL2_RX (15) // P0.15
  22. #define PIN_SERIAL2_TX (17) // P0.17
  23. // I2C pin definition
  24. #define HAS_WIRE (1)
  25. #define WIRE_INTERFACES_COUNT (1)
  26. #define PIN_WIRE_SDA (21) // P0.21
  27. #define PIN_WIRE_SCL (16) // P0.16
  28. #define I2C_NO_RESCAN
  29. // SPI pin definition
  30. #define SPI_INTERFACES_COUNT (1)
  31. #define PIN_SPI_MISO (0 + 29) // P0.29
  32. #define PIN_SPI_MOSI (0 + 2) // P0.2
  33. #define PIN_SPI_SCK (32 + 15) // P1.15
  34. #define PIN_SPI_NSS (32 + 13) // P1.13
  35. // Builtin LEDs
  36. #define LED_BUILTIN (-1)
  37. #define LED_RED (32 + 5) // P1.5
  38. #define LED_BLUE (32 + 7) // P1.7
  39. #define LED_PIN LED_BLUE
  40. #define P_LORA_TX_LED LED_RED
  41. #define LED_STATE_ON HIGH
  42. // Builtin buttons
  43. #define PIN_BUTTON1 (0 + 27) // P0.6
  44. #define BUTTON_PIN PIN_BUTTON1
  45. // LR1110
  46. #define LORA_DIO_1 (32 + 12) // P1.12
  47. #define LORA_DIO_2 (32 + 10) // P1.10
  48. #define LORA_NSS (PIN_SPI_NSS) // P1.13
  49. #define LORA_RESET (32 + 11) // P1.11
  50. #define LORA_BUSY (32 + 10) // P1.10
  51. #define LORA_SCLK (PIN_SPI_SCK) // P1.15
  52. #define LORA_MISO (PIN_SPI_MISO) // P0.29
  53. #define LORA_MOSI (PIN_SPI_MOSI) // P0.2
  54. #define LORA_CS PIN_SPI_NSS // P1.13
  55. #define LR11X0_DIO_AS_RF_SWITCH true
  56. #define LR11X0_DIO3_TCXO_VOLTAGE 1.6
  57. #define LR1110_IRQ_PIN LORA_DIO_1
  58. #define LR1110_NRESET_PIN LORA_RESET
  59. #define LR1110_BUSY_PIN LORA_DIO_2
  60. #define LR1110_SPI_NSS_PIN LORA_CS
  61. #define LR1110_SPI_SCK_PIN LORA_SCLK
  62. #define LR1110_SPI_MOSI_PIN LORA_MOSI
  63. #define LR1110_SPI_MISO_PIN LORA_MISO
  64. // GPS
  65. #define HAS_GPS 0
  66. #define GPS_RX_PIN PIN_SERIAL1_RX
  67. #define GPS_TX_PIN PIN_SERIAL1_TX
  68. #define GPS_EN (-1) // P1.11
  69. #define GPS_RESET (-1) // P1.15
  70. #define GPS_VRTC_EN (-1) // P0.8
  71. #define GPS_SLEEP_INT (-1) // P1.12
  72. #define GPS_RTC_INT (-1) // P0.15
  73. #define GPS_RESETB (-1) // P1.14