Driver for the SX1272 RF Transceiver

Dependents:   LoRaWAN_mbed_lmic_agriculture_app

Fork of SX1272Lib by Semtech

Files at this revision

API Documentation at this revision

Comitter:
GTsapparellas
Date:
Mon Apr 02 12:06:02 2018 +0000
Parent:
7:b988b60083a1
Commit message:
SX1272MB2xAS LoRa shield attached on FRDM-K64F ARM mbed board.

Changed in this revision

debug/debug.h Show annotated file Show diff for this revision Revisions of this file
enums/enums.h Show annotated file Show diff for this revision Revisions of this file
radio/radio.cpp Show annotated file Show diff for this revision Revisions of this file
radio/radio.h Show annotated file Show diff for this revision Revisions of this file
registers/sx1272Regs-Fsk.h Show annotated file Show diff for this revision Revisions of this file
registers/sx1272Regs-LoRa.h Show annotated file Show diff for this revision Revisions of this file
sx1272/sx1272-hal.cpp Show annotated file Show diff for this revision Revisions of this file
sx1272/sx1272-hal.h Show annotated file Show diff for this revision Revisions of this file
sx1272/sx1272.cpp Show annotated file Show diff for this revision Revisions of this file
sx1272/sx1272.h Show annotated file Show diff for this revision Revisions of this file
typedefs/typedefs.h Show annotated file Show diff for this revision Revisions of this file
diff -r b988b60083a1 -r 60c42278731e debug/debug.h
--- a/debug/debug.h	Mon Apr 24 09:26:08 2017 +0000
+++ b/debug/debug.h	Mon Apr 02 12:06:02 2018 +0000
@@ -14,6 +14,16 @@
  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * /////////////////////////////////////////////////////////////////////////////
+ *
+ * Used by Giorgos Tsapparellas for Internet of Things (IoT) smart monitoring
+ * device for agriculture using LoRaWAN technology.
+ * 
+ * Date of issued copy: 20 January 2018
+ *
+ * Modifications: 
+ * - No external modifications of the existing "AS IT IS" software.
  */
  
 #ifndef DEBUG_H
diff -r b988b60083a1 -r 60c42278731e enums/enums.h
--- a/enums/enums.h	Mon Apr 24 09:26:08 2017 +0000
+++ b/enums/enums.h	Mon Apr 02 12:06:02 2018 +0000
@@ -11,6 +11,15 @@
 License: Revised BSD License, see LICENSE.TXT file include in the project
 
 Maintainers: Miguel Luis, Gregory Cristian and Nicolas Huguenin
+/////////////////////////////////////////////////////////////////////////////
+
+ Used by Giorgos Tsapparellas for Internet of Things (IoT) smart monitoring
+ device for agriculture using LoRaWAN technology.
+ 
+ Date of issued copy: 20 January 2018
+ 
+ Modifications: 
+ - No external modifications of the existing "AS IT IS" software.
 */
 #ifndef __ENUMS_H__
 #define __ENUMS_H__
diff -r b988b60083a1 -r 60c42278731e radio/radio.cpp
--- a/radio/radio.cpp	Mon Apr 24 09:26:08 2017 +0000
+++ b/radio/radio.cpp	Mon Apr 02 12:06:02 2018 +0000
@@ -11,6 +11,15 @@
 License: Revised BSD License, see LICENSE.TXT file include in the project
 
 Maintainers: Miguel Luis, Gregory Cristian and Nicolas Huguenin
+/////////////////////////////////////////////////////////////////////////////
+
+ Used by Giorgos Tsapparellas for Internet of Things (IoT) smart monitoring
+ device for agriculture using LoRaWAN technology.
+ 
+ Date of issued copy: 20 January 2018
+ 
+ Modifications: 
+ - No external modifications of the existing "AS IT IS" software.
 */
 #include "radio.h"
 
diff -r b988b60083a1 -r 60c42278731e radio/radio.h
--- a/radio/radio.h	Mon Apr 24 09:26:08 2017 +0000
+++ b/radio/radio.h	Mon Apr 02 12:06:02 2018 +0000
@@ -11,6 +11,15 @@
 License: Revised BSD License, see LICENSE.TXT file include in the project
 
 Maintainers: Miguel Luis, Gregory Cristian and Nicolas Huguenin
+/////////////////////////////////////////////////////////////////////////////
+
+ Used by Giorgos Tsapparellas for Internet of Things (IoT) smart monitoring
+ device for agriculture using LoRaWAN technology.
+ 
+ Date of issued copy: 20 January 2018
+ 
+ Modifications: 
+ - No external modifications of the existing "AS IT IS" software.
 */
 #ifndef __RADIO_H__
 #define __RADIO_H__
diff -r b988b60083a1 -r 60c42278731e registers/sx1272Regs-Fsk.h
--- a/registers/sx1272Regs-Fsk.h	Mon Apr 24 09:26:08 2017 +0000
+++ b/registers/sx1272Regs-Fsk.h	Mon Apr 02 12:06:02 2018 +0000
@@ -11,6 +11,15 @@
 License: Revised BSD License, see LICENSE.TXT file include in the project
 
 Maintainer: Miguel Luis and Gregory Cristian
+/////////////////////////////////////////////////////////////////////////////
+
+ Used by Giorgos Tsapparellas for Internet of Things (IoT) smart monitoring
+ device for agriculture using LoRaWAN technology.
+ 
+ Date of issued copy: 20 January 2018
+ 
+ Modifications: 
+ - No external modifications of the existing "AS IT IS" software.
 */
 #ifndef __SX1272_REGS_FSK_H__
 #define __SX1272_REGS_FSK_H__
diff -r b988b60083a1 -r 60c42278731e registers/sx1272Regs-LoRa.h
--- a/registers/sx1272Regs-LoRa.h	Mon Apr 24 09:26:08 2017 +0000
+++ b/registers/sx1272Regs-LoRa.h	Mon Apr 02 12:06:02 2018 +0000
@@ -11,6 +11,15 @@
 License: Revised BSD License, see LICENSE.TXT file include in the project
 
 Maintainer: Miguel Luis and Gregory Cristian
+/////////////////////////////////////////////////////////////////////////////
+
+ Used by Giorgos Tsapparellas for Internet of Things (IoT) smart monitoring
+ device for agriculture using LoRaWAN technology.
+ 
+ Date of issued copy: 20 January 2018
+ 
+ Modifications: 
+ - No external modifications of the existing "AS IT IS" software.
 */
 #ifndef __SX1272_REGS_LORA_H__
 #define __SX1272_REGS_LORA_H__
diff -r b988b60083a1 -r 60c42278731e sx1272/sx1272-hal.cpp
--- a/sx1272/sx1272-hal.cpp	Mon Apr 24 09:26:08 2017 +0000
+++ b/sx1272/sx1272-hal.cpp	Mon Apr 02 12:06:02 2018 +0000
@@ -11,6 +11,29 @@
 License: Revised BSD License, see LICENSE.TXT file include in the project
 
 Maintainers: Miguel Luis, Gregory Cristian and Nicolas Huguenin
+/////////////////////////////////////////////////////////////////////////////
+
+ Used by Giorgos Tsapparellas for Internet of Things (IoT) smart monitoring
+ device for agriculture using LoRaWAN technology.
+ 
+ Date of issued copy: 20 January 2018
+ 
+ Modifications: 
+ - No external modifications of the existing "AS IT IS" software.
+ 
+ Notice that, connectivity for SX1272MB2xAS LoRa shield is allocated as:
+ SX1272MB2xAS   MBED Pin
+ SCK             D13
+ MOSI            D11
+ MISO            D12
+ NSS             D10
+ DIO0            D2
+ DIO1            D3
+ DIO2            D4
+ DIO3            D5
+ DIO4            D8
+ DIO5            D9
+ NRESET          A0
 */
 #include "sx1272-hal.h"
 
@@ -198,11 +221,11 @@
     dio3.mode( PullDown );
     dio4.mode( PullDown );
 #endif
-    dio0.rise( mbed::callback( this, static_cast< TriggerMB2xAS > ( irqHandlers[0] ) ) );
-    dio1.rise( mbed::callback( this, static_cast< TriggerMB2xAS > ( irqHandlers[1] ) ) );
-    dio2.rise( mbed::callback( this, static_cast< TriggerMB2xAS > ( irqHandlers[2] ) ) );
-    dio3.rise( mbed::callback( this, static_cast< TriggerMB2xAS > ( irqHandlers[3] ) ) );
-    dio4.rise( mbed::callback( this, static_cast< TriggerMB2xAS > ( irqHandlers[4] ) ) );
+    dio0.rise( this, static_cast< TriggerMB2xAS > ( irqHandlers[0] ) );
+    dio1.rise( this, static_cast< TriggerMB2xAS > ( irqHandlers[1] ) );
+    dio2.rise( this, static_cast< TriggerMB2xAS > ( irqHandlers[2] ) );
+    dio3.rise( this, static_cast< TriggerMB2xAS > ( irqHandlers[3] ) );
+    dio4.rise( this, static_cast< TriggerMB2xAS > ( irqHandlers[4] ) );
 }
 
 void SX1272MB2xAS::IoDeInit( void )
diff -r b988b60083a1 -r 60c42278731e sx1272/sx1272-hal.h
--- a/sx1272/sx1272-hal.h	Mon Apr 24 09:26:08 2017 +0000
+++ b/sx1272/sx1272-hal.h	Mon Apr 02 12:06:02 2018 +0000
@@ -11,6 +11,15 @@
 License: Revised BSD License, see LICENSE.TXT file include in the project
 
 Maintainers: Miguel Luis, Gregory Cristian and Nicolas Huguenin
+/////////////////////////////////////////////////////////////////////////////
+
+ Used by Giorgos Tsapparellas for Internet of Things (IoT) smart monitoring
+ device for agriculture using LoRaWAN technology.
+ 
+ Date of issued copy: 20 January 2018
+ 
+ Modifications: 
+ - No external modifications of the existing "AS IT IS" software.
 */
 #ifndef __SX1272_HAL_H__
 #define __SX1272_HAL_H__
diff -r b988b60083a1 -r 60c42278731e sx1272/sx1272.cpp
--- a/sx1272/sx1272.cpp	Mon Apr 24 09:26:08 2017 +0000
+++ b/sx1272/sx1272.cpp	Mon Apr 02 12:06:02 2018 +0000
@@ -11,6 +11,15 @@
 License: Revised BSD License, see LICENSE.TXT file include in the project
 
 Maintainers: Miguel Luis, Gregory Cristian and Nicolas Huguenin
+/////////////////////////////////////////////////////////////////////////////
+
+ Used by Giorgos Tsapparellas for Internet of Things (IoT) smart monitoring
+ device for agriculture using LoRaWAN technology.
+ 
+ Date of issued copy: 20 January 2018
+ 
+ Modifications: 
+ - No external modifications of the existing "AS IT IS" software.
 */
 #include "sx1272.h"
 
@@ -682,7 +691,7 @@
     this->settings.State = RF_RX_RUNNING;
     if( timeout != 0 )
     {
-        rxTimeoutTimer.attach_us( mbed::callback( this, &SX1272::OnTimeoutIrq ), timeout * 1e3 );
+        rxTimeoutTimer.attach_us( this, &SX1272::OnTimeoutIrq, timeout * 1e3 );
     }
 
     if( this->settings.Modem == MODEM_FSK )
@@ -691,8 +700,7 @@
 
         if( rxContinuous == false )
         {
-            rxTimeoutSyncWord.attach_us( mbed::callback( this, &SX1272::OnTimeoutIrq ),
-                                         this->settings.Fsk.RxSingleTimeout * 1e3 );
+            rxTimeoutSyncWord.attach_us( this, &SX1272::OnTimeoutIrq,this->settings.Fsk.RxSingleTimeout * 1e3 );
         }
     }
     else
@@ -766,7 +774,7 @@
     }
 
     this->settings.State = RF_TX_RUNNING;
-    txTimeoutTimer.attach_us( mbed::callback( this, &SX1272::OnTimeoutIrq ), timeout * 1e3 );
+    txTimeoutTimer.attach_us(this, &SX1272::OnTimeoutIrq , timeout * 1e3 );
     SetOpMode( RF_OPMODE_TRANSMITTER );
 }
 
@@ -817,7 +825,7 @@
     Write( REG_DIOMAPPING2, RF_DIOMAPPING2_DIO4_10 | RF_DIOMAPPING2_DIO5_10 );
 
     this->settings.State = RF_TX_RUNNING;
-    txTimeoutTimer.attach_us( mbed::callback( this, &SX1272::OnTimeoutIrq ), timeout );
+    txTimeoutTimer.attach_us(this, &SX1272::OnTimeoutIrq, timeout );
     SetOpMode( RF_OPMODE_TRANSMITTER );
 }
 
@@ -947,7 +955,7 @@
             {
                 // Continuous mode restart Rx chain
                 Write( REG_RXCONFIG, Read( REG_RXCONFIG ) | RF_RXCONFIG_RESTARTRXWITHOUTPLLLOCK );
-                rxTimeoutSyncWord.attach_us( mbed::callback( this, &SX1272::OnTimeoutIrq ),
+                rxTimeoutSyncWord.attach_us(this, &SX1272::OnTimeoutIrq,
                                              this->settings.Fsk.RxSingleTimeout * 1e3 );
             }
             else
@@ -1029,7 +1037,7 @@
                         {
                             // Continuous mode restart Rx chain
                             Write( REG_RXCONFIG, Read( REG_RXCONFIG ) | RF_RXCONFIG_RESTARTRXWITHOUTPLLLOCK );
-                            rxTimeoutSyncWord.attach_us( mbed::callback( this, &SX1272::OnTimeoutIrq ),
+                            rxTimeoutSyncWord.attach_us(this, &SX1272::OnTimeoutIrq,
                                                          this->settings.Fsk.RxSingleTimeout * 1e3 );
                         }
 
@@ -1076,7 +1084,7 @@
                 {
                     // Continuous mode restart Rx chain
                     Write( REG_RXCONFIG, Read( REG_RXCONFIG ) | RF_RXCONFIG_RESTARTRXWITHOUTPLLLOCK );
-                    rxTimeoutSyncWord.attach_us( mbed::callback( this, &SX1272::OnTimeoutIrq ),
+                    rxTimeoutSyncWord.attach_us(this, &SX1272::OnTimeoutIrq,
                                                  this->settings.Fsk.RxSingleTimeout * 1e3 );
                 }
 
diff -r b988b60083a1 -r 60c42278731e sx1272/sx1272.h
--- a/sx1272/sx1272.h	Mon Apr 24 09:26:08 2017 +0000
+++ b/sx1272/sx1272.h	Mon Apr 02 12:06:02 2018 +0000
@@ -11,6 +11,15 @@
 License: Revised BSD License, see LICENSE.TXT file include in the project
 
 Maintainers: Miguel Luis, Gregory Cristian and Nicolas Huguenin
+/////////////////////////////////////////////////////////////////////////////
+
+ Used by Giorgos Tsapparellas for Internet of Things (IoT) smart monitoring
+ device for agriculture using LoRaWAN technology.
+ 
+ Date of issued copy: 20 January 2018
+ 
+ Modifications: 
+ - No external modifications of the existing "AS IT IS" software.
 */
 #ifndef __SX1272_H__
 #define __SX1272_H__
diff -r b988b60083a1 -r 60c42278731e typedefs/typedefs.h
--- a/typedefs/typedefs.h	Mon Apr 24 09:26:08 2017 +0000
+++ b/typedefs/typedefs.h	Mon Apr 02 12:06:02 2018 +0000
@@ -11,6 +11,15 @@
 License: Revised BSD License, see LICENSE.TXT file include in the project
 
 Maintainers: Miguel Luis, Gregory Cristian and Nicolas Huguenin
+/////////////////////////////////////////////////////////////////////////////
+
+ Used by Giorgos Tsapparellas for Internet of Things (IoT) smart monitoring
+ device for agriculture using LoRaWAN technology.
+ 
+ Date of issued copy: 20 January 2018
+ 
+ Modifications: 
+ - No external modifications of the existing "AS IT IS" software.
 */
 #ifndef __TYPEDEFS_H__
 #define __TYPEDEFS_H__