variant.h 3.7 KB

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