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 Institute nor the names of its contributors
Wolfgang Betz 0:4fb29d9ee571 14 * may be used to endorse or promote products derived from this software
Wolfgang Betz 0:4fb29d9ee571 15 * without specific prior written permission.
Wolfgang Betz 0:4fb29d9ee571 16 *
Wolfgang Betz 0:4fb29d9ee571 17 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
Wolfgang Betz 0:4fb29d9ee571 18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Wolfgang Betz 0:4fb29d9ee571 19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
Wolfgang Betz 0:4fb29d9ee571 20 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
Wolfgang Betz 0:4fb29d9ee571 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Wolfgang Betz 0:4fb29d9ee571 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
Wolfgang Betz 0:4fb29d9ee571 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
Wolfgang Betz 0:4fb29d9ee571 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
Wolfgang Betz 0:4fb29d9ee571 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
Wolfgang Betz 0:4fb29d9ee571 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
Wolfgang Betz 0:4fb29d9ee571 27 * SUCH DAMAGE.
Wolfgang Betz 0:4fb29d9ee571 28 *
Wolfgang Betz 0:4fb29d9ee571 29 * This file is part of the Contiki operating system.
Wolfgang Betz 0:4fb29d9ee571 30 *
Wolfgang Betz 0:4fb29d9ee571 31 */
Wolfgang Betz 0:4fb29d9ee571 32 /*---------------------------------------------------------------------------*/
Wolfgang Betz 0:4fb29d9ee571 33 #ifndef __SPIRIT1_ARCH_H__
Wolfgang Betz 0:4fb29d9ee571 34 #define __SPIRIT1_ARCH_H__
Wolfgang Betz 0:4fb29d9ee571 35 /*---------------------------------------------------------------------------*/
Wolfgang Betz 0:4fb29d9ee571 36 #include "string.h"
Wolfgang Betz 0:4fb29d9ee571 37 #include "SPIRIT_Management.h"
Wolfgang Betz 0:4fb29d9ee571 38 #include "radio_gpio.h"
Wolfgang Betz 0:4fb29d9ee571 39 #include "radio_spi.h"
Wolfgang Betz 0:4fb29d9ee571 40 #include "st-lib.h"
Wolfgang Betz 0:4fb29d9ee571 41 /*---------------------------------------------------------------------------*/
Wolfgang Betz 0:4fb29d9ee571 42 #define IRQ_ENABLE() st_lib_radio_gpio_interrupt_cmd(RADIO_GPIO_IRQ,0x0F,0x0F,ENABLE);
Wolfgang Betz 0:4fb29d9ee571 43 #define IRQ_DISABLE() st_lib_radio_gpio_interrupt_cmd(RADIO_GPIO_IRQ,0x0F,0x0F,DISABLE);
Wolfgang Betz 0:4fb29d9ee571 44 #define spirit_spi_busy() (!(RADIO_SPI_CS_PORT->IDR & RADIO_SPI_CS_PIN))
Wolfgang Betz 0:4fb29d9ee571 45 #define SPIRIT1_STATUS() (spirit1_arch_refresh_status() & SPIRIT1_STATE_STATEBITS)
Wolfgang Betz 0:4fb29d9ee571 46 /*---------------------------------------------------------------------------*/
Wolfgang Betz 0:4fb29d9ee571 47 uint16_t spirit1_arch_refresh_status(void);
Wolfgang Betz 0:4fb29d9ee571 48 /*---------------------------------------------------------------------------*/
Wolfgang Betz 0:4fb29d9ee571 49 #endif /* __SPIRIT1_ARCH_H__ */