Contiki 2.5
cc2420_const.h
1 /*
2  * Copyright (c) 2006, Swedish Institute of Computer Science
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 /* @(#)$Id: cc2420_const.h,v 1.4 2010/06/24 09:28:12 nifi Exp $ */
32 
33 #ifndef CC2420_CONST_H
34 #define CC2420_CONST_H
35 
36 /*
37  * All constants are from the Chipcon CC2420 Data Sheet that at one
38  * point in time could be found at
39  * http://www.chipcon.com/files/CC2420_Data_Sheet_1_4.pdf
40  *
41  * The page numbers below refer to pages in this document.
42  */
43 
44 /* Page 27. */
45 enum cc2420_status_byte {
46  CC2420_XOSC16M_STABLE = 6,
47  CC2420_TX_UNDERFLOW = 5,
48  CC2420_ENC_BUSY = 4,
49  CC2420_TX_ACTIVE = 3,
50  CC2420_LOCK = 2,
51  CC2420_RSSI_VALID = 1,
52 };
53 
54 /* Page 27. */
55 enum cc2420_memory_size {
56  CC2420_RAM_SIZE = 368,
57  CC2420_FIFO_SIZE = 128,
58 };
59 
60 /* Page 29. */
61 enum cc2420_address {
62  CC2420RAM_TXFIFO = 0x000,
63  CC2420RAM_RXFIFO = 0x080,
64  CC2420RAM_KEY0 = 0x100,
65  CC2420RAM_RXNONCE = 0x110,
66  CC2420RAM_SABUF = 0x120,
67  CC2420RAM_KEY1 = 0x130,
68  CC2420RAM_TXNONCE = 0x140,
69  CC2420RAM_CBCSTATE = 0x150,
70  CC2420RAM_IEEEADDR = 0x160,
71  CC2420RAM_PANID = 0x168,
72  CC2420RAM_SHORTADDR = 0x16A,
73 };
74 
75 /* Page 60. */
76 enum cc2420_register {
77  CC2420_SNOP = 0x00,
78  CC2420_SXOSCON = 0x01,
79  CC2420_STXCAL = 0x02,
80  CC2420_SRXON = 0x03,
81  CC2420_STXON = 0x04,
82  CC2420_STXONCCA = 0x05,
83  CC2420_SRFOFF = 0x06,
84  CC2420_SXOSCOFF = 0x07,
85  CC2420_SFLUSHRX = 0x08,
86  CC2420_SFLUSHTX = 0x09,
87  CC2420_SACK = 0x0A,
88  CC2420_SACKPEND = 0x0B,
89  CC2420_SRXDEC = 0x0C,
90  CC2420_STXENC = 0x0D,
91  CC2420_SAES = 0x0E,
92  CC2420_foo = 0x0F,
93  CC2420_MAIN = 0x10,
94  CC2420_MDMCTRL0 = 0x11,
95  CC2420_MDMCTRL1 = 0x12,
96  CC2420_RSSI = 0x13,
97  CC2420_SYNCWORD = 0x14,
98  CC2420_TXCTRL = 0x15,
99  CC2420_RXCTRL0 = 0x16,
100  CC2420_RXCTRL1 = 0x17,
101  CC2420_FSCTRL = 0x18,
102  CC2420_SECCTRL0 = 0x19,
103  CC2420_SECCTRL1 = 0x1A,
104  CC2420_BATTMON = 0x1B,
105  CC2420_IOCFG0 = 0x1C,
106  CC2420_IOCFG1 = 0x1D,
107  CC2420_MANFIDL = 0x1E,
108  CC2420_MANFIDH = 0x1F,
109  CC2420_FSMTC = 0x20,
110  CC2420_MANAND = 0x21,
111  CC2420_MANOR = 0x22,
112  CC2420_AGCCTRL = 0x23,
113  CC2420_AGCTST0 = 0x24,
114  CC2420_AGCTST1 = 0x25,
115  CC2420_AGCTST2 = 0x26,
116  CC2420_FSTST0 = 0x27,
117  CC2420_FSTST1 = 0x28,
118  CC2420_FSTST2 = 0x29,
119  CC2420_FSTST3 = 0x2A,
120  CC2420_RXBPFTST = 0x2B,
121  CC2420_FSMSTATE = 0x2C,
122  CC2420_ADCTST = 0x2D,
123  CC2420_DACTST = 0x2E,
124  CC2420_TOPTST = 0x2F,
125  CC2420_RESERVED = 0x30,
126  /* 0x31 - 0x3D not used */
127  CC2420_TXFIFO = 0x3E,
128  CC2420_RXFIFO = 0x3F,
129 };
130 
131 /* Page 69. */
132 enum cc2420_secctrl0 {
133  CC2420_SECCTRL0_NO_SECURITY = 0x0000,
134  CC2420_SECCTRL0_CBC_MAC = 0x0001,
135  CC2420_SECCTRL0_CTR = 0x0002,
136  CC2420_SECCTRL0_CCM = 0x0003,
137 
138  CC2420_SECCTRL0_SEC_M_IDX = 2,
139 
140  CC2420_SECCTRL0_RXKEYSEL0 = 0x0000,
141  CC2420_SECCTRL0_RXKEYSEL1 = 0x0020,
142 
143  CC2420_SECCTRL0_TXKEYSEL0 = 0x0000,
144  CC2420_SECCTRL0_TXKEYSEL1 = 0x0040,
145 
146  CC2420_SECCTRL0_SAKEYSEL0 = 0x0000,
147  CC2420_SECCTRL0_SAKEYSEL1 = 0x0080,
148 
149  CC2420_SECCTRL0_SEC_CBC_HEAD = 0x0100,
150  CC2420_SECCTRL0_RXFIFO_PROTECTION = 0x0200,
151 };
152 
153 #endif /* CC2420_CONST_H */