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

Committer:
Wolfgang Betz
Date:
Thu Oct 13 15:41:39 2016 +0200
Revision:
0:4fb29d9ee571
First compiling version (without warnings)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Wolfgang Betz 0:4fb29d9ee571 1 /*
Wolfgang Betz 0:4fb29d9ee571 2 * Copyright (c) 2012, STMicroelectronics.
Wolfgang Betz 0:4fb29d9ee571 3 * All rights reserved.
Wolfgang Betz 0:4fb29d9ee571 4 *
Wolfgang Betz 0:4fb29d9ee571 5 * Redistribution and use in source and binary forms, with or without
Wolfgang Betz 0:4fb29d9ee571 6 * modification, are permitted provided that the following conditions
Wolfgang Betz 0:4fb29d9ee571 7 * are met:
Wolfgang Betz 0:4fb29d9ee571 8 * 1. Redistributions of source code must retain the above copyright
Wolfgang Betz 0:4fb29d9ee571 9 * notice, this list of conditions and the following disclaimer.
Wolfgang Betz 0:4fb29d9ee571 10 * 2. Redistributions in binary form must reproduce the above copyright
Wolfgang Betz 0:4fb29d9ee571 11 * notice, this list of conditions and the following disclaimer in the
Wolfgang Betz 0:4fb29d9ee571 12 * documentation and/or other materials provided with the distribution.
Wolfgang Betz 0:4fb29d9ee571 13 * 3. Neither the name of the copyright holder nor the names of its
Wolfgang Betz 0:4fb29d9ee571 14 * contributors may be used to endorse or promote products derived
Wolfgang Betz 0:4fb29d9ee571 15 * from this software without specific prior written permission.
Wolfgang Betz 0:4fb29d9ee571 16 *
Wolfgang Betz 0:4fb29d9ee571 17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
Wolfgang Betz 0:4fb29d9ee571 18 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
Wolfgang Betz 0:4fb29d9ee571 19 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
Wolfgang Betz 0:4fb29d9ee571 20 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
Wolfgang Betz 0:4fb29d9ee571 21 * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
Wolfgang Betz 0:4fb29d9ee571 22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
Wolfgang Betz 0:4fb29d9ee571 23 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Wolfgang Betz 0:4fb29d9ee571 24 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
Wolfgang Betz 0:4fb29d9ee571 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
Wolfgang Betz 0:4fb29d9ee571 26 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
Wolfgang Betz 0:4fb29d9ee571 27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
Wolfgang Betz 0:4fb29d9ee571 28 * OF THE POSSIBILITY OF SUCH DAMAGE.
Wolfgang Betz 0:4fb29d9ee571 29 *
Wolfgang Betz 0:4fb29d9ee571 30 */
Wolfgang Betz 0:4fb29d9ee571 31 /*---------------------------------------------------------------------------*/
Wolfgang Betz 0:4fb29d9ee571 32 #ifndef __SPIRIT1_CONST_H__
Wolfgang Betz 0:4fb29d9ee571 33 #define __SPIRIT1_CONST_H__
Wolfgang Betz 0:4fb29d9ee571 34 /*---------------------------------------------------------------------------*/
Wolfgang Betz 0:4fb29d9ee571 35
Wolfgang Betz 0:4fb29d9ee571 36 /*---------------------------------------------------------------------------*/
Wolfgang Betz 0:4fb29d9ee571 37
Wolfgang Betz 0:4fb29d9ee571 38 /* The state bitfield and values for different states, as read from MC_STATE[1:0] registers,
Wolfgang Betz 0:4fb29d9ee571 39 which are returned on any SPI read or write operation. */
Wolfgang Betz 0:4fb29d9ee571 40 #define SPIRIT1_STATE_STATEBITS (0x00FE)
Wolfgang Betz 0:4fb29d9ee571 41 /*---------------------------------------------------------------------------*/
Wolfgang Betz 0:4fb29d9ee571 42
Wolfgang Betz 0:4fb29d9ee571 43 #define SPIRIT1_STATE_STANDBY ((0x0040)<<1)
Wolfgang Betz 0:4fb29d9ee571 44 #define SPIRIT1_STATE_SLEEP ((0x0036)<<1)
Wolfgang Betz 0:4fb29d9ee571 45 #define SPIRIT1_STATE_READY ((0x0003)<<1)
Wolfgang Betz 0:4fb29d9ee571 46 #define SPIRIT1_STATE_LOCK ((0x000F)<<1)
Wolfgang Betz 0:4fb29d9ee571 47 #define SPIRIT1_STATE_RX ((0x0033)<<1)
Wolfgang Betz 0:4fb29d9ee571 48 #define SPIRIT1_STATE_TX ((0x005F)<<1)
Wolfgang Betz 0:4fb29d9ee571 49 /* NB the below states were extracted from ST drivers, but are not specified in the datasheet */
Wolfgang Betz 0:4fb29d9ee571 50 #define SPIRIT1_STATE_PM_SETUP ((0x003D)<<1)
Wolfgang Betz 0:4fb29d9ee571 51 #define SPIRIT1_STATE_XO_SETTLING ((0x0023)<<1)
Wolfgang Betz 0:4fb29d9ee571 52 #define SPIRIT1_STATE_SYNTH_SETUP ((0x0053)<<1)
Wolfgang Betz 0:4fb29d9ee571 53 #define SPIRIT1_STATE_PROTOCOL ((0x001F)<<1)
Wolfgang Betz 0:4fb29d9ee571 54 #define SPIRIT1_STATE_SYNTH_CALIBRATION ((0x004F)<<1)
Wolfgang Betz 0:4fb29d9ee571 55 /*---------------------------------------------------------------------------*/
Wolfgang Betz 0:4fb29d9ee571 56 /* strobe commands */
Wolfgang Betz 0:4fb29d9ee571 57 #define SPIRIT1_STROBE_TX 0x60
Wolfgang Betz 0:4fb29d9ee571 58 #define SPIRIT1_STROBE_RX 0x61
Wolfgang Betz 0:4fb29d9ee571 59 #define SPIRIT1_STROBE_READY 0x62
Wolfgang Betz 0:4fb29d9ee571 60 #define SPIRIT1_STROBE_STANDBY 0x63
Wolfgang Betz 0:4fb29d9ee571 61 #define SPIRIT1_STROBE_SLEEP 0x64
Wolfgang Betz 0:4fb29d9ee571 62 #define SPIRIT1_STROBE_SABORT 0x67
Wolfgang Betz 0:4fb29d9ee571 63 #define SPIRIT1_STROBE_SRES 0x70
Wolfgang Betz 0:4fb29d9ee571 64 #define SPIRIT1_STROBE_FRX 0x71
Wolfgang Betz 0:4fb29d9ee571 65 #define SPIRIT1_STROBE_FTX 0x72
Wolfgang Betz 0:4fb29d9ee571 66 /*---------------------------------------------------------------------------*/
Wolfgang Betz 0:4fb29d9ee571 67
Wolfgang Betz 0:4fb29d9ee571 68
Wolfgang Betz 0:4fb29d9ee571 69
Wolfgang Betz 0:4fb29d9ee571 70 /* Exported types ------------------------------------------------------------*/
Wolfgang Betz 0:4fb29d9ee571 71 /*------------------------------------------------------------------*/
Wolfgang Betz 0:4fb29d9ee571 72
Wolfgang Betz 0:4fb29d9ee571 73
Wolfgang Betz 0:4fb29d9ee571 74 #endif /* __SPIRIT1_CONST_H__ */
Wolfgang Betz 0:4fb29d9ee571 75 /*---------------------------------------------------------------------------*/