Driver for the SX1276 RF Transceiver

Dependents:   LoRa_PIR LoRaWAN-lmic-app SX1276PingPong LoRaWAN-lmic-app ... more

Files at this revision

API Documentation at this revision

Comitter:
GregCr
Date:
Tue Aug 19 09:15:01 2014 +0000
Parent:
2:5eb3066446dd
Child:
4:f0ce52e94d3f
Commit message:
added small delay for the board detection due to capa

Changed in this revision

enums/enums.h Show annotated file Show diff for this revision Revisions of this file
sx1276/sx1276-hal.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/enums/enums.h	Tue Aug 19 08:50:09 2014 +0000
+++ b/enums/enums.h	Tue Aug 19 09:15:01 2014 +0000
@@ -23,7 +23,7 @@
  */
 enum RadioState
 {
-	LOWPOWER,
+	LOWPOWER = 0,
 	IDLE,
 	
 	RX,
@@ -39,7 +39,7 @@
  */
 enum ModemType
 {
-	MODEM_FSK,
+	MODEM_FSK = 0,
 	MODEM_LORA
 };
 
@@ -48,7 +48,7 @@
  */
 enum BoardType
 {
-	SX1276MB1MAS,
+	SX1276MB1MAS = 0,
 	SX1276MB1LAS
 };
 /*!
--- a/sx1276/sx1276-hal.cpp	Tue Aug 19 08:50:09 2014 +0000
+++ b/sx1276/sx1276-hal.cpp	Tue Aug 19 09:15:01 2014 +0000
@@ -102,15 +102,19 @@
 uint8_t SX1276MB1xAS::DetectBoardType( void )
 {
     antSwitch.input( );
+    wait_us( 10 );
     if( antSwitch == 1 )
     {
         boardConnected = SX1276MB1LAS;
+        debug("\r\n     >>>>>>>>>>>>>SX1276MB1LAS \r\n" );
     }
     else
     {
         boardConnected = SX1276MB1MAS;
+        debug("\r\n     >>>>>>>>>>>>>SX1276MB1MAS \r\n" );
     }
     antSwitch.output( );
+    wait_us( 10 );
     
     return ( boardConnected );
 }
@@ -171,7 +175,7 @@
 {
     if( channel > RF_MID_BAND_THRESH )
     {
-        if( boardConnected == 0x01 )
+        if( boardConnected == SX1276MB1LAS )
         {
             return RF_PACONFIG_PASELECT_PABOOST;
         }