variant.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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 (27)
  16. #define BATTERY_PIN (28)
  17. #define ADC_MULTIPLIER (1.75F)
  18. #define PIN_ADC_CTRL (11)
  19. #define ADC_RESOLUTION (12)
  20. #define BATTERY_SENSE_RES (12)
  21. #define AREF_VOLTAGE (3.0)
  22. ////////////////////////////////////////////////////////////////////////////////
  23. // Number of pins
  24. #define PINS_COUNT (48)
  25. #define NUM_DIGITAL_PINS (48)
  26. #define NUM_ANALOG_INPUTS (1)
  27. #define NUM_ANALOG_OUTPUTS (0)
  28. ////////////////////////////////////////////////////////////////////////////////
  29. // UART pin definition
  30. #define PIN_SERIAL1_RX PIN_GPS_TX
  31. #define PIN_SERIAL1_TX PIN_GPS_RX
  32. #define PIN_SERIAL2_RX (22)
  33. #define PIN_SERIAL2_TX (24)
  34. ////////////////////////////////////////////////////////////////////////////////
  35. // I2C pin definition
  36. #define PIN_WIRE_SDA (41) // P1.9
  37. #define PIN_WIRE_SCL (8) // P0.8
  38. ////////////////////////////////////////////////////////////////////////////////
  39. // SPI pin definition
  40. #define SPI_INTERFACES_COUNT (1)
  41. #define PIN_SPI_MISO (47)
  42. #define PIN_SPI_MOSI (46)
  43. #define PIN_SPI_SCK (45)
  44. //#define PIN_SPI_NSS (24)
  45. ////////////////////////////////////////////////////////////////////////////////
  46. // Builtin LEDs
  47. #define PIN_LED_RED (12)
  48. #define PIN_LED_BLUE (7)
  49. #define LED_BLUE (-1)
  50. #define LED_BUILTIN PIN_LED_BLUE
  51. #define PIN_LED LED_BUILTIN
  52. #define LED_PIN LED_BUILTIN
  53. #define LED_STATE_ON HIGH
  54. ////////////////////////////////////////////////////////////////////////////////
  55. // Builtin buttons
  56. #define PIN_BUTTON1 (17)
  57. #define BUTTON_PIN PIN_BUTTON1
  58. #define PIN_USER_BTN BUTTON_PIN
  59. ////////////////////////////////////////////////////////////////////////////////
  60. // QSPI
  61. #define EXTERNAL_FLASH_DEVICES MX25R1635F
  62. #define EXTERNAL_FLASH_USE_QSPI
  63. #define PIN_QSPI_SCK (35)
  64. #define PIN_QSPI_CS (23)
  65. #define PIN_QSPI_IO0 (33) // MOSI if using two bit interface
  66. #define PIN_QSPI_IO1 (34) // MISO if using two bit interface
  67. #define PIN_QSPI_IO2 (36) // WP if using two bit interface (i.e. not used)
  68. #define PIN_QSPI_IO3 (37) // HOLD if using two bit interface (i.e. not used)
  69. #define QSPI_FLASH_EN (21)
  70. ////////////////////////////////////////////////////////////////////////////////
  71. // GPS
  72. #define GPS_L76K
  73. #define PIN_GPS_RX (2)
  74. #define PIN_GPS_TX (3)
  75. #define PIN_GPS_EN (6) // EN
  76. #define PIN_GPS_RESET (29)
  77. #define PIN_GPS_STANDBY (30) // STANDBY
  78. #define PIN_GPS_PPS (31)
  79. #define GPS_BAUD_RATE 9600