variant.h 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. #ifndef _SEEED_SENSECAP_SOLAR_H_
  2. #define _SEEED_SENSECAP_SOLAR_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 (33)
  11. #define NUM_DIGITAL_PINS (33)
  12. #define NUM_ANALOG_INPUTS (8)
  13. #define NUM_ANALOG_OUTPUTS (0)
  14. // LEDs
  15. #define PIN_LED (12)
  16. #define LED_PWR (PINS_COUNT)
  17. #define LED_BUILTIN (PIN_LED)
  18. #define LED_RED (PINS_COUNT)
  19. #define LED_WHITE (11)
  20. #define LED_BLUE (12) // LoRa TX indicator
  21. #define LED_STATE_ON (1) // State when LED is litted
  22. // Buttons
  23. #define PIN_BUTTON1 (13)
  24. #define PIN_BUTTON2 (20)
  25. #define PIN_USER_BTN PIN_BUTTON1
  26. #define VBAT_ENABLE (19) // Output LOW to enable reading of the BAT voltage.
  27. // Analog pins
  28. #define BATTERY_PIN (16) // Read the BAT voltage.
  29. #define AREF_VOLTAGE (3.0F)
  30. #define ADC_MULTIPLIER (3.0F) // 1M, 512k divider bridge
  31. #define ADC_RESOLUTION (12)
  32. // nRF52 power management settings
  33. #define PWRMGT_VOLTAGE_BOOTLOCK (3300) // Won't boot below this voltage (mV)
  34. #define PWRMGT_LPCOMP_AIN (7) // AIN7 = P0.31 = BATTERY_PIN
  35. #define PWRMGT_LPCOMP_REFSEL (2) // 3/8 VDD (~3.38-3.71V)
  36. // Serial interfaces
  37. #define PIN_SERIAL1_RX (7)
  38. #define PIN_SERIAL1_TX (6)
  39. // SPI Interfaces
  40. #define SPI_INTERFACES_COUNT (1)
  41. #define PIN_SPI_MISO (9)
  42. #define PIN_SPI_MOSI (10)
  43. #define PIN_SPI_SCK (8)
  44. // Lora SPI is on SPI0
  45. #define P_LORA_SCLK PIN_SPI_SCK
  46. #define P_LORA_MISO PIN_SPI_MISO
  47. #define P_LORA_MOSI PIN_SPI_MOSI
  48. // Wire Interfaces
  49. #define WIRE_INTERFACES_COUNT (1)
  50. #define PIN_WIRE_SDA (14)
  51. #define PIN_WIRE_SCL (15)
  52. // GPS L76KB
  53. #define GPS_BAUDRATE 9600
  54. #define GPS_THREAD_INTERVAL 50
  55. #define PIN_GPS_TX PIN_SERIAL1_RX
  56. #define PIN_GPS_RX PIN_SERIAL1_TX
  57. #define PIN_GPS_STANDBY (0)
  58. #define GPS_EN (18)
  59. // QSPI Pins
  60. #define PIN_QSPI_SCK (21)
  61. #define PIN_QSPI_CS (22)
  62. #define PIN_QSPI_IO0 (23)
  63. #define PIN_QSPI_IO1 (24)
  64. #define PIN_QSPI_IO2 (25)
  65. #define PIN_QSPI_IO3 (26)
  66. #define EXTERNAL_FLASH_DEVICES P25Q16H
  67. #define EXTERNAL_FLASH_USE_QSPI
  68. #endif