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 Jul 13 09:21:06 2017 +0200
Parent:
69:22e9b407effa
Child:
71:4a7772415d9c
Commit message:
Handle overflow situations in busy wait

Changed in this revision

source/SimpleSpirit1.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/source/SimpleSpirit1.cpp	Mon Jul 10 13:54:43 2017 +0200
+++ b/source/SimpleSpirit1.cpp	Thu Jul 13 09:21:06 2017 +0200
@@ -9,10 +9,20 @@
 
 #define XO_ON                   (0x1)
 
-#define BUSYWAIT_UNTIL(cond, millisecs)                                        					\
-        do {                                                                 					 		\
-            uint32_t start = us_ticker_read();                         							\
-            while (!(cond) && ((us_ticker_read() - start) < ((uint32_t)millisecs)*1000U));	\
+#define BUSYWAIT_UNTIL(cond, millisecs) \
+        do { \
+            uint32_t start = us_ticker_read(); \
+            uint32_t limit = (uint32_t)millisecs*1000U; \
+            \
+            while (!(cond)) { \
+                uint32_t now = us_ticker_read(); \
+                \
+                if(now >= start) { \
+                    if((now - start) > limit) break; \
+                } else { \
+                    if((now + ~start) > limit) break; \
+                } \
+            } \
         } while(0)
 
 #define st_lib_spirit_irqs		SpiritIrqs