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: mbed_driver_api.cpp
- Revision:
- 24:03e351bfc9c9
- Parent:
- 23:4192649f35da
- Child:
- 25:2ec45788f28c
--- a/mbed_driver_api.cpp Wed Nov 09 14:02:18 2016 +0100
+++ b/mbed_driver_api.cpp Thu Nov 10 15:25:59 2016 +0100
@@ -33,7 +33,6 @@
};
static phy_device_driver_s device_driver;
static int8_t rf_radio_driver_id = -1;
-static uint8_t rf_rnd_rssi = 0;
const phy_rf_channel_configuration_s phy_subghz = {868000000, 1000000, 250000, 11, M_GFSK};
@@ -602,7 +601,11 @@
/* TODO - betzw: what to do? */
// rf_buffer_len -= 2;
- /* Send received data and link information to the network stack */
+#ifdef HEAVY_TRACING
+ tr_debug("%s (%d)", __func__, __LINE__);
+#endif
+
+ /* Send received data and link information to the network stack */
if( device_driver.phy_rx_cb ){
device_driver.phy_rx_cb(rf_rx_buf, rf_buffer_len, rf_lqi, rf_rssi, rf_radio_driver_id);
}
@@ -856,8 +859,14 @@
*/
extern "C" int8_t rf_read_random(void)
{
- tr_debug("%s (%d)", __func__, __LINE__);
- return rf_rnd_rssi;
+ float tmp;
+
+ rf_device->channel_clear();
+ tmp = rf_device->get_last_rssi_dbm();
+ tmp *= -10;
+
+ tr_debug("%s (%d): ret=%d", __func__, __LINE__, (uint8_t)tmp);
+ return (uint8_t)tmp;
}
/*
X-NUCLEO-IDS01A4 Sub-1GHz RF Expansion Board