Prototype RF driver for STM Sub-1 GHz RF expansion board based on the SPSGRF-868 module for STM32 Nucleo.

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).

Files at this revision

API Documentation at this revision

Comitter:
Wolfgang Betz
Date:
Thu Dec 22 08:25:22 2016 +0100
Parent:
46:d104e58c5caf
Child:
48:373e1b7e424f
Commit message:
Optimize IRQ handler

Changed in this revision

source/SimpleSpirit1.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/source/SimpleSpirit1.cpp	Mon Dec 19 13:21:59 2016 +0100
+++ b/source/SimpleSpirit1.cpp	Thu Dec 22 08:25:22 2016 +0100
@@ -109,11 +109,13 @@
 	irq_set_status(TX_DATA_SENT, S_ENABLE);
 	irq_set_status(RX_DATA_READY,S_ENABLE);
 	irq_set_status(RX_DATA_DISC, S_ENABLE);
+	irq_set_status(VALID_SYNC, S_ENABLE);
 	irq_set_status(TX_FIFO_ERROR, S_ENABLE);
-	irq_set_status(TX_FIFO_ALMOST_EMPTY, S_ENABLE);
 	irq_set_status(RX_FIFO_ERROR, S_ENABLE);
+#ifndef RX_FIFO_THR_WA
+	irq_set_status(TX_FIFO_ALMOST_EMPTY, S_ENABLE);
 	irq_set_status(RX_FIFO_ALMOST_FULL, S_ENABLE);
-	irq_set_status(VALID_SYNC, S_ENABLE);
+#endif // !RX_FIFO_THR_WA
 
 	/* Configure Spirit1 */
 	radio_persistent_rx(S_ENABLE);
@@ -150,10 +152,6 @@
 	};
 	csma_ca_init(&x_csma_init);
 
-#ifdef RX_FIFO_THR_WA
-	linear_fifo_set_almost_full_thr_rx(0);
-#endif
-
 #ifdef USE_STANDBY_STATE
 	/* Puts the SPIRIT1 in STANDBY mode (125us -> rx/tx) */
 	cmd_strobe(SPIRIT1_STROBE_STANDBY);
@@ -467,6 +465,7 @@
 		x_irq_status.IRQ_TX_FIFO_ALMOST_EMPTY = S_RESET;
 	}
 
+#ifndef RX_FIFO_THR_WA
 	/* The IRQ_TX_FIFO_ALMOST_EMPTY notifies an nearly empty TX fifo */
 	if(x_irq_status.IRQ_TX_FIFO_ALMOST_EMPTY) {
 #ifdef DEBUG_IRQ
@@ -487,6 +486,7 @@
 		}
 		tx_buffer_pos += to_send;
 	}
+#endif // !RX_FIFO_THR_WA
 
 	/* Transmission error */
 	if(x_irq_status.IRQ_TX_FIFO_ERROR) {
@@ -551,6 +551,7 @@
 		}
 	}
 
+#ifndef RX_FIFO_THR_WA
 	/* RX FIFO almost full */
 	if(x_irq_status.IRQ_RX_FIFO_ALMOST_FULL) {
 #ifdef DEBUG_IRQ
@@ -567,6 +568,7 @@
 			_spirit_rx_pos += fifo_available;
 		}
 	}
+#endif // !RX_FIFO_THR_WA
 
 	/* Reception errors */
 	if((x_irq_status.IRQ_RX_FIFO_ERROR) || (x_irq_status.IRQ_RX_DATA_DISC)) {