Driver for the SX1280 RF Transceiver

Dependents:   SX1280PingPong RangignMaster RangingSlave MSNV2-Terminal_V1-6 ... more

Revision:
11:d60df50e108f
Parent:
4:abf14b677777
Child:
12:c4f110f3fe3e
--- a/sx1280-hal.cpp	Mon Oct 09 11:59:51 2017 +0000
+++ b/sx1280-hal.cpp	Wed Jul 18 08:48:34 2018 +0000
@@ -135,14 +135,18 @@
     RadioNss = 1;
     RadioSpi->format( 8, 0 );
 #if defined( TARGET_KL25Z )
-    RadioSpi->frequency( 4000000 );
+    this->SetSpiSpeed( 4000000 );
 #elif defined( TARGET_NUCLEO_L476RG )
-    RadioSpi->frequency( 8000000 );
+    this->SetSpiSpeed( 8000000 );
 #else
-    RadioSpi->frequency( 8000000 );
+    this->SetSpiSpeed( 8000000 );
 #endif
+    wait( 0.1 );
+}
 
-    wait( 0.1 );
+void SX1280Hal::SetSpiSpeed( uint32_t spiSpeed )
+{
+    RadioSpi->frequency( spiSpeed );
 }
 
 void SX1280Hal::UartInit( void )