HelloWorld_IDS01A4 mbed application for Spirit1 P2P demo.

Dependencies:   mbed

Fork of HelloWorld_IDS01A5_Program by rosarium pila

mbed 2.0 (a.k.a classic) HelloWorld example for Spirit1 to transfer data from one node to another.
To send the predefined data packet from the sender to the receiver, user needs to press User Button on the board. The LED on the receiver expansion board will toggle on reception of data successfully.
Data packets sent and received can be seen on USB serial terminal.

EVALUATION BOARDS RF FREQUENCY DESCRIPTION :
X-NUCLEO-IDS01A4 868 MHz 868 MHz RF expansion board based on SPIRIT1

Committer:
rosarium
Date:
Thu May 25 16:38:55 2017 +0000
Revision:
0:2ddc0583bcec
First draft version of HelloWorld_IDS01A5

Who changed what in which revision?

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