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).
Diff: SimpleSpirit1.h
- Revision:
- 2:45642c5198a2
- Parent:
- 0:4fb29d9ee571
- Child:
- 3:0df38cfb1e53
--- a/SimpleSpirit1.h Fri Oct 14 08:57:51 2016 +0200
+++ b/SimpleSpirit1.h Fri Oct 14 10:42:56 2016 +0200
@@ -26,7 +26,7 @@
static SimpleSpirit1 *_singleton;
/** Communication Interface Instance Variables **/
- SPI _spi; // betzw - NOTE: Arduino pins are valid for NUCLEO-F401RE
+ SPI _spi; // betzw - NOTE: Arduino pins are valid only for NUCLEO-F401RE
// mosi: PA_7 (D11)
// miso: PA_6 (D12)
// sclk: PB_3 (D3) or
@@ -36,10 +36,10 @@
// mode: 0
// ordr: MSB
// freq: max 10MHz
- InterruptIn _irq; // PC_7 (falling)
- DigitalOut _chip_select; // PB_6 ('1' == chip unselected)
- DigitalOut _shut_down; // PA_10 ('1' == shut_down)
- DigitalOut _led; // PB_4 (optional)
+ InterruptIn _irq; // PC_7 (D9) (falling)
+ DigitalOut _chip_select; // PB_6 (D10) ('1' == chip unselected)
+ DigitalOut _shut_down; // PA_10 (D2) ('1' == shut_down)
+ DigitalOut _led; // PB_4 (D5) (optional)
/** Static Variables from Cube Implementation **/
/*
@@ -193,6 +193,9 @@
enable_irq();
}
+ /** Init Instance Method **/
+ void init(void);
+
/** Constructor **/
SimpleSpirit1(PinName mosi, PinName miso, PinName sclk,
PinName irq, PinName cs, PinName sdn,
@@ -209,8 +212,9 @@
if(_singleton == NULL) {
_singleton = new SimpleSpirit1(mosi, miso, sclk,
irq, cs, sdn, led);
+ _singleton->init();
} else {
- error("SimpleSpirit1 singleton already created!");
+ error("SimpleSpirit1 singleton already created!\n");
}
return *_singleton;
@@ -218,7 +222,7 @@
static SimpleSpirit1& Instance() {
if(_singleton == NULL) {
- error("SimpleSpirit1 must be created before used!");
+ error("SimpleSpirit1 must be created before used!\n");
}
return *_singleton;
X-NUCLEO-IDS01A4 Sub-1GHz RF Expansion Board