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:
20:75635d50262e
Parent:
18:78c5e644d37a
--- a/radio_sx126x.cpp	Thu Jun 25 12:39:08 2020 -0700
+++ b/radio_sx126x.cpp	Fri Jul 10 10:52:39 2020 -0700
@@ -8,7 +8,12 @@
 Timer Radio::lpt;
 #endif
 
+#if (MBED_MAJOR_VERSION < 6)
 volatile us_timestamp_t Radio::irqAt;
+#else
+LowPowerClock::time_point Radio::irqAt;
+#endif
+
 bool Radio::paOff;
 
 #ifdef TARGET_FF_ARDUINO
@@ -391,19 +396,35 @@
         radio.xfer(OPCODE_SET_LORA_SYMBOL_TIMEOUT, 1, 0, &symbs);
 
         radio.start_rx(RX_TIMEOUT_CONTINUOUS);
+    #if (MBED_MAJOR_VERSION < 6)
         startAt = lpt.read_us();
+    #else
+        startAt = LowPowerClock::now().time_since_epoch().count();
+    #endif
 Lstart:
         do {
+    #if (MBED_MAJOR_VERSION < 6)
             now = lpt.read_us();
+    #else
+            now = LowPowerClock::now().time_since_epoch().count();
+    #endif
             if ((now - startAt) > maxListenTime) {
                 return -1;
             }
             radio.xfer(OPCODE_GET_RSSIINST, 0, 2, buf);
             rssi = buf[1] / -2;
         } while (rssi > rssiThresh);
+    #if (MBED_MAJOR_VERSION < 6)
         chFreeAt = lpt.read_us();
+    #else
+        chFreeAt = LowPowerClock::now().time_since_epoch().count();
+    #endif
         do {
+    #if (MBED_MAJOR_VERSION < 6)
             now = lpt.read_us();
+    #else
+            now = LowPowerClock::now().time_since_epoch().count();
+    #endif
             radio.xfer(OPCODE_GET_RSSIINST, 0, 2, buf);
             rssi = buf[1] / -2;
             if (rssi > rssiThresh) {
@@ -439,7 +460,11 @@
 
 void Radio::dio1_top_half()
 {
+#if (MBED_MAJOR_VERSION < 6)
     irqAt = lpt.read_us();
+#else
+    irqAt = LowPowerClock::now();
+#endif
 
     if (RadioEvents->DioPin_top_half)
         RadioEvents->DioPin_top_half();