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