add sx1280

This commit is contained in:
Egor Shitikov
2024-09-19 13:28:22 -07:00
parent fa55cb2fd0
commit 02e59cbff2
4 changed files with 98 additions and 17 deletions
+19 -4
View File
@@ -2,6 +2,8 @@
#define UNUSED_PIN (0)
// LilyGo defined
// Check this LiLyGo file LoraSA2\include\utilities.h
#define I2C_SDA 18
#define I2C_SCL 17
#define OLED_RST UNUSED_PIN
@@ -27,6 +29,14 @@
#define RADIO_DIO1_PIN 33
#define RADIO_BUSY_PIN 34
#ifdef USING_SX1280PA
#define RADIO_DIO1_PIN 9 // SX1280 DIO1 = IO9
#define RADIO_BUSY_PIN 36 // SX1280 BUSY = IO36
#define RADIO_RX_PIN 21
#define RADIO_TX_PIN 10
#define BUTTON_PIN 0
#endif
// Define for our code
#define RST_OLED UNUSED_PIN
#define LED BOARD_LED
@@ -52,11 +62,16 @@
#include <SPI.h>
SPIClass *hspi = new SPIClass(2);
SX1262 radio = new Module(SS, DIO1, RST_LoRa, BUSY_LoRa, *hspi);
#else
#else // ARDUINO_heltec_wifi_32_lora_V3
#ifdef USING_SX1280PA
SX1280 radio = new Module(RADIO_CS_PIN, RADIO_DIO1_PIN, RADIO_RST_PIN, RADIO_BUSY_PIN);
#endif // end USING_SX1280PA
#ifdef USING_SX1262
// Default SPI on pins from pins_arduino.h
SX1262 radio = new Module(RADIO_CS_PIN, RADIO_DIO1_PIN, RADIO_RST_PIN, RADIO_BUSY_PIN);
#endif
#endif
#endif // end USING_SX1262
#endif // end ARDUINO_heltec_wifi_32_lora_V3
#endif // end HELTEC_NO_RADIO_INSTANCE
void heltec_loop() {}
@@ -107,7 +122,7 @@ PrintSplitter both(Serial, display);
Print &both = Serial;
#endif
// some fake pin
#define BUTTON 38
#define BUTTON BUTTON_PIN
#include "HotButton.h"
HotButton button(BUTTON);
+6
View File
@@ -1,15 +1,21 @@
#ifndef __GLOBAL_CONFIG_H__
#define __GLOBAL_CONFIG_H__
#ifndef FREQ_BEGIN
// frequency range in MHz to scan
#define FREQ_BEGIN 850
#endif
#ifndef FREQ_END
// TODO: if % RANGE_PER_PAGE != 0
#define FREQ_END 950
#endif
// Measurement bandwidth. Allowed bandwidth values (in kHz) are:
// 4.8, 5.8, 7.3, 9.7, 11.7, 14.6, 19.5, 23.4, 29.3, 39.0, 46.9, 58.6,
// 78.2, 93.8, 117.3, 156.2, 187.2, 234.3, 312.0, 373.6 and 467.0
#define BANDWIDTH 467.0
#define BANDWIDTH_SX1280 406.
// Detection level from the 33 levels. The higher number is more sensitive
#define DEFAULT_DRONE_DETECTION_LEVEL 18