cc2420_registers.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Freie Universit├Ąt Berlin
3  * 2016 Inria
4  *
5  * This file is subject to the terms and conditions of the GNU Lesser
6  * General Public License v2.1. See the file LICENSE in the top level
7  * directory for more details.
8  */
9 
21 #ifndef CC2420_REGISTERS_H
22 #define CC2420_REGISTERS_H
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
32 #define CC2420_OPT_AUTOACK (0x0001)
33 #define CC2420_OPT_CSMA (0x0002)
34 #define CC2420_OPT_PROMISCUOUS (0x0004)
36 #define CC2420_OPT_PRELOADING (0x0008)
37 #define CC2420_OPT_TELL_TX_START (0x0010)
39 #define CC2420_OPT_TELL_TX_END (0x0020)
41 #define CC2420_OPT_TELL_RX_START (0x0040)
43 #define CC2420_OPT_TELL_RX_END (0x0080)
51 enum {
57 };
58 
62 enum {
63  CC2420_STATE_PD = 0,
64  CC2420_STATE_IDLE = 1,
65  CC2420_STATE_TX_PRE = 34,
68 };
69 
74 #define CC2420_REG_WRITE (0x00)
75 #define CC2420_REG_READ (0x40)
76 #define CC2420_RAM (0x80)
77 #define CC2420_RAM_WRITE (0x00)
78 #define CC2420_RAM_READ (0x20)
79 #define CC2420_FIFO_READ (CC2420_REG_RXFIFO | CC2420_REG_READ)
80 #define CC2420_FIFO_WRITE (CC2420_REG_TXFIFO | CC2420_REG_WRITE)
81 
89 #define CC2420_STROBE_NOP (0x00)
90 #define CC2420_STROBE_XOSCON (0x01)
91 #define CC2420_STROBE_TXCAL (0x02)
92 #define CC2420_STROBE_RXON (0x03)
93 #define CC2420_STROBE_TXON (0x04)
94 #define CC2420_STROBE_TXONCCA (0x05)
95 #define CC2420_STROBE_RFOFF (0x06)
96 #define CC2420_STROBE_XOSCOFF (0x07)
97 #define CC2420_STROBE_FLUSHRX (0x08)
98 #define CC2420_STROBE_FLUSHTX (0x09)
99 #define CC2420_STROBE_ACK (0x0A)
100 #define CC2420_STROBE_ACKPEND (0x0B)
101 #define CC2420_STROBE_RXDEC (0x0C)
102 #define CC2420_STROBE_TXENC (0x0D)
103 #define CC2420_STROBE_AES (0x0E)
111 #define CC2420_REG_MAIN (0x10)
112 #define CC2420_REG_MDMCTRL0 (0x11)
113 #define CC2420_REG_MDMCTRL1 (0x12)
114 #define CC2420_REG_RSSI (0x13)
115 #define CC2420_REG_SYNCWORD (0x14)
116 #define CC2420_REG_TXCTRL (0x15)
117 #define CC2420_REG_RXCTRL0 (0x16)
118 #define CC2420_REG_RXCTRL1 (0x17)
119 #define CC2420_REG_FSCTRL (0x18)
120 #define CC2420_REG_SECCTRL0 (0x19)
121 #define CC2420_REG_SECCTRL1 (0x1A)
122 #define CC2420_REG_BATTMON (0x1B)
123 #define CC2420_REG_IOCFG0 (0x1C)
124 #define CC2420_REG_IOCFG1 (0x1D)
125 #define CC2420_REG_MANFIDL (0x1e)
126 #define CC2420_REG_MANFIDH (0x1F)
127 #define CC2420_REG_FSMTC (0x20)
128 #define CC2420_REG_MANAND (0x21)
129 #define CC2420_REG_MANOR (0x22)
130 #define CC2420_REG_AGCCTRL (0x23)
131 #define CC2420_REG_AGCTST0 (0x24)
132 #define CC2420_REG_AGCTST1 (0x25)
133 #define CC2420_REG_AGCTST2 (0x26)
134 #define CC2420_REG_FSTST0 (0x27)
135 #define CC2420_REG_FSTST1 (0x28)
136 #define CC2420_REG_FSTST2 (0x29)
137 #define CC2420_REG_FSTST3 (0x2A)
138 #define CC2420_REG_RXBPFTST (0x2B)
139 #define CC2420_REG_FSMSTATE (0x2C)
140 #define CC2420_REG_ADCTST (0x2D)
141 #define CC2420_REG_DACTST (0x2E)
142 #define CC2420_REG_TOPTST (0x2F)
143 #define CC2420_REG_TXFIFO (0x3E)
144 #define CC2420_REG_RXFIFO (0x3F)
152 #define CC2420_RAM_TXFIFO (0x0000)
153 #define CC2420_RAM_RXFIFO (0x0080)
154 #define CC2420_RAM_KEY0 (0x0100)
155 #define CC2420_RAM_RXNONCE (0x0110)
156 #define CC2420_RAM_RXCTR (0x0110)
157 #define CC2420_RAM_SABUF (0x0120)
158 #define CC2420_RAM_KEY1 (0x0130)
159 #define CC2420_RAM_TXNONCE (0x0140)
160 #define CC2420_RAM_TXCTR (0x0140)
161 #define CC2420_RAM_CBCSTATE (0x0150)
162 #define CC2420_RAM_IEEEADR (0x0160)
163 #define CC2420_RAM_PANID (0x0168)
164 #define CC2420_RAM_SHORTADR (0x016A)
165 
172 #define CC2420_STATUS_XOSC_STABLE (0x40)
173 #define CC2420_STATUS_TX_UNDERFLOW (0x20)
174 #define CC2420_STATUS_ENC_BUSY (0x10)
175 #define CC2420_STATUS_TX_ACTIVE (0x08)
176 #define CC2420_STATUS_PLL_LOCK (0x04)
177 #define CC2420_STATUS_RSSI_VALID (0x02)
178 
184 #define CC2420_MDMCTRL0_RES_FRM (0x2000
185 #define CC2420_MDMCTRL0_ADR_DECODE (0x0800)
186 #define CC2420_MDMCTRL0_PAN_COORD (0x1000)
187 #define CC2420_MDMCTRL0_AUTOCRC (0x0020)
188 #define CC2420_MDMCTRL0_AUTOACK (0x0010)
189 #define CC2420_MDMCTRL0_PREAMBLE_M (0x000f)
190 #define CC2420_MDMCTRL0_PREAMBLE_3B (0x0002)
191 
197 #define CC2420_TXCTRL_PA_MASK (0x001f)
198 
204 #define CC2420_RXCTRL1_RXBPF_LOCUR (0x2000)
205 
211 #define CC2420_FSCTRL_LOCK_THR_MASK (0xc000)
212 #define CC2420_FSCTRL_CAL_DONE (0x2000)
213 #define CC2420_FSCTRL_CAL_RUNNING (0x1000)
214 #define CC2420_FSCTRL_LOCK_LENGTH (0x0800)
215 #define CC2420_FSCTRL_LOCK_STATUS (0x0400)
216 #define CC2420_FSCTRL_FREQ_MASK (0x03ff)
217 
223 #define CC2420_SECCTRL0_RXFIFO_PROT (0x0200)
224 
229 #define CC2420_MANFIDL_VAL (0x233d)
230 
234 #define CC2420_MANFIDH_VAL (0x3000)
235 
236 
237 #ifdef __cplusplus
238 }
239 #endif
240 
241 #endif /* CC2420_REGISTERS_H */
transmit packet without CCA
transmit packet using CCA
receive buffer overflow
receive state
transmitting preamble
receive SFD search