I-O DATA DEV2 / Private_lora_SX1276

Dependents:   Nucleo_Private_LoRa

Revision:
29:cc4c7c1defca
Parent:
28:9ee41259a3eb
diff -r 9ee41259a3eb -r cc4c7c1defca sx1276/sx1276-hal.cpp
--- a/sx1276/sx1276-hal.cpp	Wed Nov 25 08:17:26 2020 +0000
+++ b/sx1276/sx1276-hal.cpp	Fri Dec 18 00:26:38 2020 +0000
@@ -57,9 +57,12 @@
                             antSwitch( P0_23 ), 
                             fake( A3 )
                         #else
-                        :   SX1276( events, D11, D12, D13, D10, A0, D2, D3, D4, D5, D8, D9 ),
-                            antSwitch( A4 ), 
-                            fake( A3 )
+                        :   SX1276( events, D11, D12, D13, D10, D9, D8, D7, D6, D4, D3, D2 ), // For NUCLEO 
+                            antSwitch( A4 ),
+                            fake( D8 )
+//                        :   SX1276( events, D11, D12, D13, D10, A0, D2, D3, D4, D5, D8, D9 ),
+//                            antSwitch( A4 ), 
+//                            fake( A3 )
                         #endif
 {
     this->RadioEvents = events;
@@ -92,9 +95,12 @@
     if( boardConnected == UNKNOWN )
     {
         antSwitch.input( );
+//        printf("antSwitch %d\r\n",ant);
         wait_ms( 1 );
-        if(1 /* antSwitch == 1*/ )
-        {
+        int ant=1;
+        if(ant == 1)
+        {        
+            printf("SX1276MB1LAS \r\n");
             boardConnected = SX1276MB1LAS;
         }
         else
@@ -133,25 +139,25 @@
     #elif( defined ( TARGET_KL25Z ) ) //busclock frequency is halved -> double the spi frequency to compensate
         spi.frequency( frequencyToSet * 2 );
     #else
-        #warning "Check the board's SPI frequency"
+        spi.frequency( frequencyToSet );
     #endif
     wait(0.1); 
 }
 
 void SX1276MB1xAS::IoIrqInit( DioIrqHandler *irqHandlers )
 {
-#if( defined ( TARGET_NUCLEO_L152RE ) || defined ( TARGET_LPC11U6X ) || defined ( TARGET_NUCLEO_L073RZ )  || defined ( TARGET_NUCLEO_L053R8 ) )
+//#if( defined ( TARGET_NUCLEO_L152RE ) || defined ( TARGET_LPC11U6X ) || defined ( TARGET_NUCLEO_L073RZ )  || defined ( TARGET_NUCLEO_L053R8 ) )
     dio0.mode( PullDown );
-    dio1.mode( PullDown );
-    dio2.mode( PullDown );
-    dio3.mode( PullDown );
-    dio4.mode( PullDown );
-#endif
+//    dio1.mode( PullDown );
+//    dio2.mode( PullDown );
+//    dio3.mode( PullDown );
+//    dio4.mode( PullDown );
+//#endif
     dio0.rise( this, static_cast< TriggerMB1xAS > ( irqHandlers[0] ) );
-    dio1.rise( this, static_cast< TriggerMB1xAS > ( irqHandlers[1] ) );
-    dio2.rise( this, static_cast< TriggerMB1xAS > ( irqHandlers[2] ) );
-    dio3.rise( this, static_cast< TriggerMB1xAS > ( irqHandlers[3] ) );
-    dio4.rise( this, static_cast< TriggerMB1xAS > ( irqHandlers[4] ) );
+//    dio1.rise( this, static_cast< TriggerMB1xAS > ( irqHandlers[1] ) );
+//    dio2.rise( this, static_cast< TriggerMB1xAS > ( irqHandlers[2] ) );
+//    dio3.rise( this, static_cast< TriggerMB1xAS > ( irqHandlers[3] ) );
+//    dio4.rise( this, static_cast< TriggerMB1xAS > ( irqHandlers[4] ) );
 }
 
 void SX1276MB1xAS::IoDeInit( void )
@@ -161,7 +167,7 @@
 
 uint8_t SX1276MB1xAS::GetPaSelect( uint32_t channel )
 {
-    if( channel > RF_MID_BAND_THRESH )
+    if( 1 /*channel > RF_MID_BAND_THRESH*/ )
     {
         if( boardConnected == SX1276MB1LAS )
         {