Hardware Abstraction Layer, permitting any LoRa application to use any LoRa radio chip

Dependents:   alarm_slave alarm_master lora_p2p lorawan1v1 ... more

radio chip selection

Radio chip driver is not included, allowing choice of radio device.
If you're using SX1272 or SX1276, then import sx127x driver into your program.
if you're using SX1261 or SX1262, then import sx126x driver into your program.
if you're using SX1280, then import sx1280 driver into your program.
if you're using LR1110, then import LR1110 driver into your program.
If you're using NAmote72 or Murata discovery, then you must import only sx127x driver.
If you're using Type1SJ select target DISCO_L072CZ_LRWAN1 and import sx126x driver into your program.

Pin assigned to arduino LoRa radio shield form-factor

Revision:
9:97a6de3dbc86
Parent:
8:0518c6e68b79
Child:
12:fcfafd17ae1b
Child:
14:94993ae5b164
--- a/radio_sx128x.cpp	Thu Dec 06 17:57:21 2018 -0800
+++ b/radio_sx128x.cpp	Fri Dec 07 17:13:39 2018 -0800
@@ -57,6 +57,10 @@
 const RadioEvents_t* RadioEvents;
 volatile us_timestamp_t Radio::irqAt;
 
+unsigned Radio::symbolPeriodUs;
+unsigned Radio::nSymbs;
+unsigned Radio::rxTimeoutMs;
+
 void Radio::readChip()
 {
     uint8_t reg8;
@@ -312,6 +316,7 @@
     fe_enable = true;
 
     radio.periodBase = 2;   // 1ms resolution
+    nSymbs = 8;
 }
 
 float Radio::GetRssiInst()
@@ -532,7 +537,8 @@
 
 void Radio::SetLoRaSymbolTimeout(uint8_t symbs)
 {
-    //symbolTimeout = symbs;
+    nSymbs = symbs;
+    rxTimeoutMs = nSymbs * (symbolPeriodUs / 1000.0);
 }
 
 void Radio::LoRaModemConfig(unsigned bwKHz, uint8_t sf, uint8_t cr)
@@ -555,6 +561,9 @@
     mpLORA.lora.spreadingFactor = sf << 4;
 
     radio.xfer(OPCODE_SET_MODULATION_PARAMS, 3, 0, mpLORA.buf);
+
+    symbolPeriodUs = (1 << sf) / (bwKHz / 1000.0);   // bw in MHz gives microseconds
+    rxTimeoutMs = nSymbs * (symbolPeriodUs / 1000.0);
 }
 
 void Radio::LoRaPacketConfig(unsigned preambleLen, bool fixLen, bool crcOn, bool invIQ)
@@ -603,7 +612,11 @@
 #ifdef RX_INDICATION
     RX_INDICATION = 1;
 #endif
-    radio.start_rx(timeout / 1000);
+    if (timeout == 0)
+        radio.start_rx(0);  // continuous rx
+    else {
+        radio.start_rx(rxTimeoutMs);
+    }
 }
 
 void Radio::Standby()