Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2025
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 5.52 KB | None | 0 0
  1. /*
  2.  ▄▄▄▄▄▄▄▄▄▄▄  ▄▄▄▄▄▄▄▄▄▄▄  ▄▄▄▄▄▄▄▄▄▄▄  ▄▄▄▄▄▄▄▄▄▄▄  ▄▄▄▄▄▄▄▄▄▄
  3. ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░▌
  4. ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌
  5. ▐░▌          ▐░▌          ▐░▌          ▐░▌          ▐░▌       ▐░▌
  6. ▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄▄▄ ▐░▌       ▐░▌
  7. ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░▌       ▐░▌
  8.  ▀▀▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀▀▀ ▐░█▀▀▀▀▀▀▀▀▀ ▐░▌       ▐░▌
  9. ▐░▌▐░▌          ▐░▌          ▐░▌          ▐░▌       ▐░▌
  10.  ▄▄▄▄▄▄▄▄▄█░▌▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄▄▄ ▐░█▄▄▄▄▄▄▄█░▌
  11. ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░▌
  12.  ▀▀▀▀▀▀▀▀▀▀▀  ▀▀▀▀▀▀▀▀▀▀▀  ▀▀▀▀▀▀▀▀▀▀▀  ▀▀▀▀▀▀▀▀▀▀▀  ▀▀▀▀▀▀▀▀▀▀
  13.  
  14.   ▄       ▄  ▄▄▄▄▄▄▄▄▄▄▄  ▄▄▄▄▄▄▄▄▄▄▄  ▄▄▄▄▄▄▄▄▄▄▄       ▄▄▄▄▄▄▄▄▄▄▄  ▄▄▄▄▄▄▄▄▄▄▄
  15.  ▐░▌     ▐░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌     ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌
  16.   ▐░▌   ▐░▌  ▀▀▀▀█░█▀▀▀▀ ▐░█▀▀▀▀▀▀▀█░▌▐░█▀▀▀▀▀▀▀█░▌     ▐░█▀▀▀▀▀▀▀▀▀  ▀▀▀▀▀▀▀▀▀█░▌
  17.    ▐░▌ ▐░▌       ▐░▌     ▐░▌       ▐░▌▐░▌       ▐░▌     ▐░▌                    ▐░▌
  18. ▐░▐░▌        ▐░▌     ▐░█▄▄▄▄▄▄▄█░▌▐░▌       ▐░▌     ▐░█▄▄▄▄▄▄▄▄▄  ▄▄▄▄▄▄▄▄▄█░▌
  19. ▐░▌         ▐░▌     ▐░░░░░░░░░░░▌▐░▌       ▐░▌     ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌
  20. ▐░▌░▌        ▐░▌     ▐░█▀▀▀▀▀▀▀█░▌▐░▌       ▐░▌      ▀▀▀▀▀▀▀▀▀█░▌ ▀▀▀▀▀▀▀▀▀█░▌
  21.    ▐░▌ ▐░▌       ▐░▌     ▐░▌       ▐░▌▐░▌       ▐░▌               ▐░▌          ▐░▌
  22.   ▐░▌   ▐░▌  ▄▄▄▄█░█▄▄▄▄ ▐░▌       ▐░▌▐░█▄▄▄▄▄▄▄█░▌      ▄▄▄▄▄▄▄▄▄█░▌ ▄▄▄▄▄▄▄▄▄█░▌
  23.  ▐░▌     ▐░▌▐░░░░░░░░░░░▌▐░▌       ▐░▌▐░░░░░░░░░░░▌     ▐░░░░░░░░░░░▌▐░░░░░░░░░░░▌
  24.   ▀       ▀  ▀▀▀▀▀▀▀▀▀▀▀  ▀         ▀  ▀▀▀▀▀▀▀▀▀▀▀       ▀▀▀▀▀▀▀▀▀▀▀  ▀▀▀▀▀▀▀▀▀▀▀
  25. */
  26.  
  27. /*
  28. Board Information: https://www.seeedstudio.com/XIAO-ESP32S3-Sense-p-5639.html
  29. Expansion Board Infomation : https://www.seeedstudio.com/Seeeduino-XIAO-Expansion-board-p-4746.html
  30. L76K GPS Module Information : https://www.seeedstudio.com/L76K-GNSS-Module-for-Seeed-Studio-XIAO-p-5864.html
  31. */
  32.  
  33. #define LED_PIN 44
  34. #define LED_STATE_ON 1 // State when LED is lit
  35.  
  36. #define BUTTON_PIN 21 // This is the Program Button
  37. #define BUTTON_NEED_PULLUP
  38.  
  39. #define BATTERY_PIN -1
  40. #define ADC_CHANNEL ADC1_GPIO1_CHANNEL
  41. #define BATTERY_SENSE_RESOLUTION_BITS 12
  42.  
  43. /*Warning:
  44. https://www.seeedstudio.com/L76K-GNSS-Module-for-Seeed-Studio-XIAO-p-5864.html
  45. L76K Expansion Board can not directly used, L76K Reset Pin needs to override or physically remove it,
  46. otherwise it will conflict with the SPI pins
  47. */
  48. #define GPS_L76K
  49. #ifdef GPS_L76K
  50. #define GPS_RX_PIN 39
  51. #define GPS_TX_PIN 40
  52. #define HAS_GPS 1
  53. #define GPS_BAUDRATE 9600
  54. #define GPS_THREAD_INTERVAL 50
  55. #define PIN_SERIAL1_RX PIN_GPS_TX
  56. #define PIN_SERIAL1_TX PIN_GPS_RX
  57. #define PIN_GPS_STANDBY 1
  58. #endif
  59.  
  60. // XIAO S3 Expansion board  has 1.3 inch OLED Screen
  61. #define USCREEN_SSD1306
  62.  
  63. #define I2C_SDA 5
  64. #define I2C_SCL 6
  65.  
  66. // XIAO S3 LORA module
  67. #define USE_SX1262
  68.  
  69. #define LORA_MISO 8
  70. #define LORA_SCK 7
  71. #define LORA_MOSI 9
  72. #define LORA_CS 4
  73.  
  74. #define LORA_RESET 43
  75. #define LORA_DIO1 2
  76.  
  77. #define LORA_DIO2 1
  78.  
  79. #ifdef USE_SX1262
  80. #define SX126X_CS LORA_CS
  81. #define SX126X_DIO1 LORA_DIO1
  82. #define SX126X_BUSY 3
  83. #define SX126X_RESET LORA_RESET
  84.  
  85. //  DIO2 controlls an antenna switch and the TCXO voltage is controlled by DIO3
  86. #define SX126X_DIO2_AS_RF_SWITCH
  87. #define SX126X_RXEN 1
  88. #define SX126X_TXEN RADIOLIB_NC
  89. #define SX126X_DIO3_TCXO_VOLTAGE 1.8
  90. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement