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 Jul 06 11:13:31 2017 +0200
Revision:
67:93bec0baf1de
Parent:
34:edda6a7238ec
Clarify some comments

Who changed what in which revision?

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