variant.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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 VARIANT_MCK (64000000ul)
  11. //#define USE_LFXO // 32.768 kHz crystal oscillator
  12. #define USE_LFRC // 32.768 kHz RC oscillator
  13. ////////////////////////////////////////////////////////////////////////////////
  14. // Power
  15. #define PIN_EXT_VCC (21)
  16. #define EXT_VCC (PIN_EXT_VCC)
  17. #define BATTERY_PIN (17)
  18. #define ADC_RESOLUTION 12
  19. ////////////////////////////////////////////////////////////////////////////////
  20. // Number of pins
  21. #define PINS_COUNT (23)
  22. #define NUM_DIGITAL_PINS (23)
  23. #define NUM_ANALOG_INPUTS (3)
  24. #define NUM_ANALOG_OUTPUTS (0)
  25. ////////////////////////////////////////////////////////////////////////////////
  26. // UART pin definition
  27. #define PIN_SERIAL1_TX (1)
  28. #define PIN_SERIAL1_RX (0)
  29. ////////////////////////////////////////////////////////////////////////////////
  30. // I2C pin definition
  31. #define WIRE_INTERFACES_COUNT 2
  32. #define PIN_WIRE_SDA (6)
  33. #define PIN_WIRE_SCL (7)
  34. #define PIN_WIRE1_SDA (13)
  35. #define PIN_WIRE1_SCL (14)
  36. ////////////////////////////////////////////////////////////////////////////////
  37. // SPI pin definition
  38. #define SPI_INTERFACES_COUNT 2
  39. #define PIN_SPI_SCK (2)
  40. #define PIN_SPI_MISO (3)
  41. #define PIN_SPI_MOSI (4)
  42. #define PIN_SPI_NSS (5)
  43. #define PIN_SPI1_SCK (18)
  44. #define PIN_SPI1_MISO (19)
  45. #define PIN_SPI1_MOSI (20)
  46. ////////////////////////////////////////////////////////////////////////////////
  47. // Builtin LEDs
  48. #define PIN_LED (22)
  49. #define LED_PIN PIN_LED
  50. #define LED_BLUE PIN_LED
  51. #define LED_BUILTIN PIN_LED
  52. #define LED_STATE_ON 1
  53. ////////////////////////////////////////////////////////////////////////////////
  54. // Builtin buttons
  55. #define PIN_BUTTON1 (6)
  56. #define BUTTON_PIN PIN_BUTTON1