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