SX1276GenericLib to support sx1276 bassed LoRa modules, including HopeRF RFM95, Murata CMWX1ZZABZ and Semtech SX1276MB1MAS/SX1276MB1LAS modules

Dependents:   DISCO-L072CZ-LRWAN1_LoRa_PingPong DISCO-L072CZ-LRWAN1_LoRa_PingPong DISCO-L072CZ-LRWAN1_LoRa_PingPong DISCO-L072CZ-LRWAN1_LoRa_USB_Rx ... more

Fork of SX1276Lib by Semtech

Revision:
54:0d8ea87fbab9
Parent:
53:6d3adad59633
Child:
55:00c1f5b83920
diff -r 6d3adad59633 -r 0d8ea87fbab9 sx1276/sx1276.cpp
--- a/sx1276/sx1276.cpp	Thu May 18 18:34:54 2017 +0200
+++ b/sx1276/sx1276.cpp	Fri May 19 11:50:12 2017 +0200
@@ -103,9 +103,13 @@
     delete this->dioIrq;
 }
 
-void SX1276::Init( RadioEvents_t *events )
+bool SX1276::Init( RadioEvents_t *events )
 {
+    if (Read(REG_VERSION) == 0x00)
+        return false;
+    
     this->RadioEvents = events;
+    return true;
 }
 
 
@@ -898,6 +902,23 @@
     }
 }
 
+bool SX1276::RxSignalPending()
+{
+    if (this->settings.State != RF_RX_RUNNING)
+        return false;
+    
+    switch( this->settings.Modem )
+    {
+        case MODEM_FSK:
+            break;
+        case MODEM_LORA:
+            if (Read(REG_LR_MODEMSTAT) & RFLR_MODEMSTAT_SIGNAL_DETECTED)
+                return true;
+            break;
+    }
+    return false;
+}
+
 void SX1276::Tx( uint32_t timeout )
 {