Semtech SX1272 radio chipset driver - ported based on Semtech SX1276 driver.

Dependents:   Elmo-Terminal LoRaWAN-test-app Elmo-Terminal-App LoRaWAN_Semtech_stack ... more

Revision:
5:6740f7ed1d00
Parent:
2:b0a793d995ad
Child:
9:f53b11725565
Child:
10:070cb8f0f54a
--- a/sx1272/sx1272-hal.cpp	Thu Oct 01 11:05:08 2015 +0200
+++ b/sx1272/sx1272-hal.cpp	Thu Oct 22 08:01:27 2015 +0000
@@ -15,6 +15,8 @@
 */
 #include "sx1272-hal.h"
 
+#define TX_STATE 1
+
 const RadioRegisters_t SX1272BRD::RadioRegsInit[] =
 {                                                 
     { MODEM_FSK , REG_LNA                , 0x23 },
@@ -150,33 +152,35 @@
     }
 }
 
+
 void SX1272BRD::AntSwInit( void )
 {
-    antSwitch = 0;
+    antSwitch.output();
+    antSwitch = !TX_STATE;
 }
 
 void SX1272BRD::AntSwDeInit( void )
 {
-    antSwitch = 0;
+    antSwitch = !TX_STATE;
 }
 
 void SX1272BRD::SetAntSw( uint8_t rxTx )
 {
-    if( this->rxTx == rxTx )
-    {
-        //no need to go further
-        return;
-    }
+//    if( this->rxTx == rxTx )
+//    {
+//        //no need to go further
+//        return;
+//    }
 
-    this->rxTx = rxTx;
+//    this->rxTx = rxTx;
 
     if( rxTx != 0 )
     {
-        antSwitch = 1;
+        antSwitch = TX_STATE;
     }
     else
     {
-        antSwitch = 0;
+        antSwitch = !TX_STATE;
     }
 }