ST / stm-spirit1-rf-driver

Prototype RF Driver for STM Sub-1 GHz RF Expansion Boards based on the SPSGRF-868 and SPSGRF-915 Modules for STM32 Nucleo

Currently supported boards:

Note, in order to use expansion board X-NUCLEO-IDS01A4 in mbed you need to perform the following HW modifications on the board:

  • Unmount resistor R4
  • Mount resistor R7

Furthermore, on some Nucleo development boards (e.g. the NUCLEO_F429ZI), in order to be able to use Ethernet together with these Sub-1 GHz RF expansion boards, you need to compile this driver with macro SPIRIT1_SPI_MOSI=PB_5 defined, while the development board typically requires some HW modification as e.g. described here!

This driver can be used together with the 6LoWPAN stack (a.k.a. Nanostack).

Revision:
9:3db68ab23070
Parent:
8:10967c884e38
Child:
11:b769d6caad82
--- a/SimpleSpirit1.cpp	Mon Oct 24 08:34:33 2016 +0200
+++ b/SimpleSpirit1.cpp	Tue Oct 25 10:54:41 2016 +0200
@@ -59,6 +59,10 @@
     _led(led),
 	_current_irq_callback()
 {
+}
+
+/** Init Function **/
+void SimpleSpirit1::init() {
     /* reset irq disable counter and irq callback & disable irq */
 	_nr_of_irq_disables = 0;
     disable_spirit_irq();
@@ -82,10 +86,7 @@
     receiving_packet = 0;
     last_rssi = 0 ; //MGR
     last_lqi = 0 ;  //MGR
-}
 
-/** Init Function **/
-void SimpleSpirit1::init() {
     /* set frequencies */
     radio_set_xtal_freq(XTAL_FREQUENCY);
     mgmt_set_freq_base((uint32_t)BASE_FREQUENCY);
@@ -565,7 +566,7 @@
     	CLEAR_TXBUF();
 		/* call user callback */
 		if(_current_irq_callback) {
-			_current_irq_callback(-1); // betzw - TODO: define enums for callback values
+			_current_irq_callback(TX_ERR);
 		}
     }
   }
@@ -580,7 +581,7 @@
     	CLEAR_TXBUF();
 		/* call user callback */
 		if(_current_irq_callback) {
-			_current_irq_callback(-1); // betzw - TODO: define enums for callback values
+			_current_irq_callback(TX_ERR);
 		}
     }
   }
@@ -595,7 +596,7 @@
     	CLEAR_TXBUF();
 		/* call user callback */
 		if(_current_irq_callback) {
-			_current_irq_callback(-1); // betzw - TODO: define enums for callback values
+			_current_irq_callback(TX_ERR);
 		}
     }
   }
@@ -633,7 +634,7 @@
 
 	/* call user callback */
 	if(_current_irq_callback) {
-		_current_irq_callback(0); // betzw - TODO: define enums for callback values
+		_current_irq_callback(TX_DONE); // betzw - TODO: define enums for callback values
 	}
   }
 
@@ -678,7 +679,7 @@
 
 		/* call user callback */
 		if(_current_irq_callback) {
-			_current_irq_callback(1); // betzw - TODO: define enums for callback values
+			_current_irq_callback(RX_DONE); // betzw - TODO: define enums for callback values
 		}
 	}
   }