From 3d4a25b43c0bc29ee4dcbd327c8752a38843966e Mon Sep 17 00:00:00 2001 From: MiGri Date: Sat, 2 Oct 2021 19:30:34 +0200 Subject: [PATCH] Added more modes Added more modes, compatible to the old '300bps' mode but with different correction rates. --- lib/BG_RF95/BG_RF95.cpp | 7 +++++-- lib/BG_RF95/BG_RF95.h | 17 ++++++++++------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/lib/BG_RF95/BG_RF95.cpp b/lib/BG_RF95/BG_RF95.cpp index 67158e5..9a6ec9b 100644 --- a/lib/BG_RF95/BG_RF95.cpp +++ b/lib/BG_RF95/BG_RF95.cpp @@ -21,10 +21,13 @@ PROGMEM static const BG_RF95::ModemConfig MODEM_CONFIG_TABLE[] = { 0x72, 0x74, 0x00}, // Bw125Cr45Sf128 (the chip default) { 0x92, 0x74, 0x00}, // Bw500Cr45Sf128 { 0x48, 0x94, 0x00}, // Bw31_25Cr48Sf512 - { 0x78, 0xc4, 0x00}, // Bw125Cr48Sf4096 - { 0x72, 0xc7, 0x8}, // BG 125 cr45 sf12 + { 0x78, 0xc7, 0x08}, // Bw125Cr48Sf4096 + { 0x76, 0xc7, 0x08}, // Bw125Cr47Sf4096 + { 0x74, 0xc7, 0x08}, // Bw125Cr46Sf4096 + { 0x72, 0xc7, 0x08}, // Bw125Cr45Sf4096 { 0x72, 0xb4, 0x00}, // Bw125Cr45Sf2048 <= M0IGA messup speed { 0x76, 0x94, 0x04}, // Bw125Cr47Sf512 <= corrected 1200baud + { 0x78, 0xa4, 0x00}, // Bw125Cr48Sf1024 }; BG_RF95::BG_RF95(uint8_t slaveSelectPin, uint8_t interruptPin, RHGenericSPI& spi) diff --git a/lib/BG_RF95/BG_RF95.h b/lib/BG_RF95/BG_RF95.h index ce36c7b..8534dc6 100644 --- a/lib/BG_RF95/BG_RF95.h +++ b/lib/BG_RF95/BG_RF95.h @@ -542,13 +542,16 @@ public: /// you may need to change the RHReliableDatagram timeout for reliable operations. typedef enum { - Bw125Cr45Sf128 = 0, ///< Bw = 125 kHz, Cr = 4/5, Sf = 128chips/symbol, CRC on. Default medium range - Bw500Cr45Sf128, ///< Bw = 500 kHz, Cr = 4/5, Sf = 128chips/symbol, CRC on. Fast+short range - Bw31_25Cr48Sf512, ///< Bw = 31.25 kHz, Cr = 4/8, Sf = 512chips/symbol, CRC on. Slow+long range - Bw125Cr48Sf4096, ///< Bw = 125 kHz, Cr = 4/8, Sf = 4096chips/symbol, CRC on. Slow+long range - Bw125Cr45Sf4096, ///< APRS - Bw125Cr45Sf2048, ///< M0IGA Messup speed / 698baud (not 1200) - Bw125Cr47Sf512, ///< corrected 1200 baud + Bw125Cr45Sf128 = 0, ///< Bw = 125 kHz, Cr = 4:5, Sf = 128chips/symbol, CRC on. Default medium range + Bw500Cr45Sf128, ///< Bw = 500 kHz, Cr = 4:5, Sf = 128chips/symbol, CRC on. Fast+short range + Bw31_25Cr48Sf512, ///< Bw = 31.25 kHz, Cr = 4:8, Sf = 512chips/symbol, CRC on. Slow+long range + Bw125Cr48Sf4096, ///< Bw = 125 kHz, Cr = 4:8, Sf = 4096chips/symbol, CRC on. Slow+long range + Bw125Cr47Sf4096, ///< Bw = 125 kHz, Cr = 4:7, Sf = 4096chips/symbol, CRC on. Slow+long range + Bw125Cr46Sf4096, ///< Bw = 125 kHz, Cr = 4:6, Sf = 4096chips/symbol, CRC on. Slow+long range + Bw125Cr45Sf4096, ///< APRS (BW 125 khz, Cr = 4:5, Sf = 4096chips/symbol, CRC on. Slow+long range + Bw125Cr45Sf2048, ///< M0IGA Messup speed / 698baud (not 1200) + Bw125Cr47Sf512, ///< corrected 1200 baud + Bw125Cr48Sf1024, /// Bw 125, Cr = 4/8, Sf = 1024chips/symbol, CRC on } ModemConfigChoice; /// Constructor. You can have multiple instances, but each instance must have its own