Easily add all supported connectivity methods to your mbed OS project

Dependencies:   type-yd-driver

Committer:
MACRUM
Date:
Wed Jul 12 10:52:58 2017 +0000
Revision:
0:615f90842ce8
Initial commit

Who changed what in which revision?

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