2 * Copyright 2010 Grygoriy Fuchedzhy <grygoriy.fuchedzhy@gmail.com>
4 * This file is part of mrf-link.
6 * mrf-link is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * mrf-link is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with mrf-link. If not, see <http://www.gnu.org/licenses/>.
23 // BUF_ means buffer address
24 // RV_ means recommended value
25 // R_ means address register
29 #define MRF_BUF_TX_NORMAL 0x0
30 #define MRF_BUF_TX_BEACON 0x80
31 #define MRF_BUF_TX_GTS1 0x100
32 #define MRF_BUF_TX_GTS2 0x180
33 #define MRF_BUF_SECURITY 0x280
34 #define MRF_BUF_RX 0x300
36 // short address registers
37 #define MRF_R_RXMCR 0x00
38 #define MRF_R_PANIDL 0x01
39 #define MRF_R_PANIDH 0x02
40 #define MRF_R_SADRL 0x03
41 #define MRF_R_SADRH 0x04
42 #define MRF_R_EADR0 0x05
43 #define MRF_R_EADR1 0x06
44 #define MRF_R_EADR2 0x07
45 #define MRF_R_EADR3 0x08
46 #define MRF_R_EADR4 0x09
47 #define MRF_R_EADR5 0x0A
48 #define MRF_R_EADR6 0x0B
49 #define MRF_R_EADR7 0x0C
50 #define MRF_R_RXFLUSH 0x0D
51 #define MRF_R_ORDER 0x10
52 #define MRF_R_TXMCR 0x11
53 #define MRF_R_ACKTMOUT 0x12
54 #define MRF_R_ESLOTG1 0x13
55 #define MRF_R_SYMTICKL 0x14
56 #define MRF_R_SYMTICKH 0x15
57 #define MRF_R_PACON0 0x16
58 #define MRF_R_PACON1 0x17
59 #define MRF_R_PACON2 0x18
60 #define MRF_R_TXBCON0 0x1A
61 #define MRF_R_TXNCON 0x1B
62 #define MRF_R_TXG1CON 0x1C
63 #define MRF_R_TXG2CON 0x1D
64 #define MRF_R_ESLOTG23 0x1E
65 #define MRF_R_ESLOTG45 0x1F
66 #define MRF_R_ESLOTG67 0x20
67 #define MRF_R_TXPEND 0x21
68 #define MRF_R_WAKECON 0x22
69 #define MRF_R_FRMOFFSET 0x23
70 #define MRF_R_TXSTAT 0x24
71 #define MRF_R_TXBCON1 0x25
72 #define MRF_R_GATECLK 0x26
73 #define MRF_R_TXTIME 0x27
74 #define MRF_R_HSYMTMRL 0x28
75 #define MRF_R_HSYMTMRH 0x29
76 #define MRF_R_SOFTRST 0x2A
77 #define MRF_R_SECCON0 0x2C
78 #define MRF_R_SECCON1 0x2D
79 #define MRF_R_TXSTBL 0x2E
80 #define MRF_R_RXSR 0x30
81 #define MRF_R_INTSTAT 0x31
82 #define MRF_R_INTCON 0x32
83 #define MRF_R_GPIO 0x33
84 #define MRF_R_TRISGPIO 0x34
85 #define MRF_R_SLPACK 0x35
86 #define MRF_R_RFCTL 0x36
87 #define MRF_R_SECCR2 0x37
88 #define MRF_R_BBREG0 0x38
89 #define MRF_R_BBREG1 0x39
90 #define MRF_R_BBREG2 0x3A
91 #define MRF_R_BBREG3 0x3B
92 #define MRF_R_BBREG4 0x3C
93 #define MRF_R_BBREG6 0x3E
94 #define MRF_R_CCAEDTH 0x3F
96 // long address registers
97 #define MRF_R_RFCON0 0x200
98 #define MRF_R_RFCON1 0x201
99 #define MRF_R_RFCON2 0x202
100 #define MRF_R_RFCON3 0x203
101 #define MRF_R_RFCON5 0x205
102 #define MRF_R_RFCON6 0x206
103 #define MRF_R_RFCON7 0x207
104 #define MRF_R_RFCON8 0x208
105 #define MRF_R_SLPCAL0 0x209
106 #define MRF_R_SLPCAL1 0x20A
107 #define MRF_R_SLPCAL2 0x20B
108 #define MRF_R_RFSTATE 0x20F
109 #define MRF_R_RSSI 0x210
110 #define MRF_R_SLPCON0 0x211
111 #define MRF_R_SLPCON1 0x220
112 #define MRF_R_WAKETIMEL 0x222
113 #define MRF_R_WAKETIMEH 0x223
114 #define MRF_R_REMCNTL 0x224
115 #define MRF_R_REMCNTH 0x225
116 #define MRF_R_MAINCNT0 0x226
117 #define MRF_R_MAINCNT1 0x227
118 #define MRF_R_MAINCNT2 0x228
119 #define MRF_R_MAINCNT3 0x229
120 #define MRF_R_TESTMODE 0x22F
121 #define MRF_R_ASSOEADR0 0x230
122 #define MRF_R_ASSOEADR1 0x231
123 #define MRF_R_ASSOEADR2 0x232
124 #define MRF_R_ASSOEADR3 0x233
125 #define MRF_R_ASSOEADR4 0x234
126 #define MRF_R_ASSOEADR5 0x235
127 #define MRF_R_ASSOEADR6 0x236
128 #define MRF_R_ASSOEADR7 0x237
129 #define MRF_R_ASSOSADR0 0x238
130 #define MRF_R_ASSOSADR1 0x239
131 #define MRF_R_UPNONCE0 0x240
132 #define MRF_R_UPNONCE1 0x241
133 #define MRF_R_UPNONCE2 0x242
134 #define MRF_R_UPNONCE3 0x243
135 #define MRF_R_UPNONCE4 0x244
136 #define MRF_R_UPNONCE5 0x245
137 #define MRF_R_UPNONCE6 0x246
138 #define MRF_R_UPNONCE7 0x247
139 #define MRF_R_UPNONCE8 0x248
140 #define MRF_R_UPNONCE9 0x249
141 #define MRF_R_UPNONCE10 0x24A
142 #define MRF_R_UPNONCE11 0x24B
143 #define MRF_R_UPNONCE12 0x24C
145 // bits and values for registers
147 #define MRF_B_NOACKRSP 5
148 #define MRF_B_PANCOORD 3
149 #define MRF_B_COORD 2
150 #define MRF_B_ERRPKT 1
151 #define MRF_B_PROMI 0
154 #define MRF_B_WAKEPOL 6
155 #define MRF_B_WAKEPAD 5
156 #define MRF_B_CMDONLY 3
157 #define MRF_B_DATAONLY 2
158 #define MRF_B_BCNONLY 1
159 #define MRF_B_RXFLUSH 0
162 #define MRF_B_NOCSMA 7
163 #define MRF_B_BATLIFEXT 6
164 #define MRF_B_SLOTTED 5
167 #define MRF_B_DRPACK 7
170 #define MRF_B_FIFOEN 7
171 #define MRF_RV_TXONTS (0x6<<2)
174 #define MRF_B_FPSTAT 4
175 #define MRF_B_INDIRECT 3
180 #define MRF_B_ACKREQ 2
186 #define MRF_B_SECEN 1
190 #define MRF_B_GTSSWITCH 1
191 #define MRF_B_FPACK 0
194 #define MRF_B_IMMWAKE 7
195 #define MRF_B_REGWAKE 6
198 #define MRF_B_CCAFAIL 5
199 #define MRF_B_TXG2FNT 4
200 #define MRF_B_TXG1FNT 3
201 #define MRF_B_TXG2STAT 2
202 #define MRF_B_TXG1STAT 1
203 #define MRF_B_TXNSTAT 0
206 #define MRF_B_TXBMSK 7
207 #define MRF_B_WU_BCN 6
210 #define MRF_B_GTSON 3
213 #define MRF_B_RSTPWR 2
214 #define MRF_B_RSTBB 1
215 #define MRF_B_RSTMAC 0
218 #define MRF_B_SECIGNORE 7
219 #define MRF_B_SECSTART 6
220 #define MRF_V_TXNCIPHER_AES_CBC_MAC_32 0x7
221 #define MRF_V_TXNCIPHER_AES_CBC_MAC_64 0x6
222 #define MRF_V_TXNCIPHER_AES_CBC_MAC_128 0x5
223 #define MRF_V_TXNCIPHER_AES_CCM_32 0x4
224 #define MRF_V_TXNCIPHER_AES_CCM_64 0x3
225 #define MRF_V_TXNCIPHER_AES_CCM_128 0x2
226 #define MRF_V_TXNCIPHER_AES_CTR 0x1
227 #define MRF_V_TXNCIPHER_NONE 0x0
228 #define MRF_V_RXCIPHER_AES_CBC_MAC_32 (0x7<<3)
229 #define MRF_V_RXCIPHER_AES_CBC_MAC_64 (0x6<<3)
230 #define MRF_V_RXCIPHER_AES_CBC_MAC_128 (0x5<<3)
231 #define MRF_V_RXCIPHER_AES_CCM_32 (0x4<<3)
232 #define MRF_V_RXCIPHER_AES_CCM_64 (0x3<<3)
233 #define MRF_V_RXCIPHER_AES_CCM_128 (0x2<<3)
234 #define MRF_V_RXCIPHER_AES_CTR (0x1<<3)
235 #define MRF_V_RXCIPHER_NONE (0x0<<3)
238 #define MRF_B_DISDEC 1
239 #define MRF_B_DISENC 0
240 #define MRF_V_TXBCIPHER_AES_CBC_MAC_32 (0x7<<4)
241 #define MRF_V_TXBCIPHER_AES_CBC_MAC_64 (0x6<<4)
242 #define MRF_V_TXBCIPHER_AES_CBC_MAC_128 (0x5<<4)
243 #define MRF_V_TXBCIPHER_AES_CCM_32 (0x4<<4)
244 #define MRF_V_TXBCIPHER_AES_CCM_64 (0x3<<4)
245 #define MRF_V_TXBCIPHER_AES_CCM_128 (0x2<<4)
246 #define MRF_V_TXBCIPHER_AES_CTR (0x1<<4)
247 #define MRF_V_TXBCIPHER_NONE (0x0<<4)
250 #define MRF_RV_RFSTBL (0x9<<4)
251 #define MRF_RV_MSIFS 0x3
254 #define MRF_B_UPSECERR 6
255 #define MRF_B_BATIND 5
261 #define MRF_B_HSYMTMR 5
278 #define MRF_B_SLPACK 7
281 #define MRF_B_RFRST 2
284 #define MRF_B_UPDEC 7
285 #define MRF_B_UPENC 6
286 #define MRF_V_TXG1CIPHER_AES_CBC_MAC_32 0x7
287 #define MRF_V_TXG1CIPHER_AES_CBC_MAC_64 0x6
288 #define MRF_V_TXG1CIPHER_AES_CBC_MAC_128 0x5
289 #define MRF_V_TXG1CIPHER_AES_CCM_32 0x4
290 #define MRF_V_TXG1CIPHER_AES_CCM_64 0x3
291 #define MRF_V_TXG1CIPHER_AES_CCM_128 0x2
292 #define MRF_V_TXG1CIPHER_AES_CTR 0x1
293 #define MRF_V_TXG1CIPHER_NONE 0x0
294 #define MRF_V_TXG2CIPHER_AES_CBC_MAC_32 (0x7<<3)
295 #define MRF_V_TXG2CIPHER_AES_CBC_MAC_64 (0x6<<3)
296 #define MRF_V_TXG2CIPHER_AES_CBC_MAC_128 (0x5<<3)
297 #define MRF_V_TXG2CIPHER_AES_CCM_32 (0x4<<3)
298 #define MRF_V_TXG2CIPHER_AES_CCM_64 (0x3<<3)
299 #define MRF_V_TXG2CIPHER_AES_CCM_128 (0x2<<3)
300 #define MRF_V_TXG2CIPHER_AES_CTR (0x1<<3)
301 #define MRF_V_TXG2CIPHER_NONE (0x0<<3)
304 #define MRF_B_TURBO 0
307 #define MRF_B_RXDECINV 2
310 #define MRF_V_CCAMODE_CARRIER_SENSE 0x40
311 #define MRF_V_CCAMODE_ENERGY_ABOVE_THRESHOLD 0x80
312 #define MRF_V_CCAMODE_CARRIER_SENSE_WITH_ENERGY_ABOVE_THRESHOLD 0xC0
315 #define MRF_B_RSSIMODE1 7
316 #define MRF_B_RSSIMODE2 6
317 #define MRF_B_RSSIRDY 0
320 #define MRF_RV_CCAEDTH 0x69
323 #define MRF_B_RFRST 2
326 #define MRF_RV_VCOOPT 0x1
329 #define MRF_B_PLLEN 7
332 #define MRF_B_TXFIL 7
333 #define MRF_B_20MRECVR 4
334 #define MRF_B_BATEN 3
337 #define MRF_V_SLPCLKSEL_100kHz 0x80
338 #define MRF_V_SLPCLKSEL_32kHz 0x40
341 #define MRF_B_RFVCO 4
344 #define MRF_B_SLPCALRDY 7
345 #define MRF_B_SLPCALEN 4
348 #define MRF_V_RFSTATE_RTSEL2 0xE0
349 #define MRF_V_RFSTATE_RTSEL1 0xC0
350 #define MRF_V_RFSTATE_RX 0xA0
351 #define MRF_V_RFSTATE_TX 0x80
352 #define MRF_V_RFSTATE_CALVCO 0x60
353 #define MRF_V_RFSTATE_SLEEP 0x40
354 #define MRF_V_RFSTATE_CALFIL 0x20
355 #define MRF_V_RFSTATE_RESET 0x00
358 #define MRF_B_INTEDGE 1
359 #define MRF_B_SLPCLKEN 0
362 #define MRF_B_CLKOUTEN 5
365 #define MRF_B_STARTCNT 7
368 #define MRF_V_TESTMODE_CONTROL_EXT_PA_LNA 0xF
369 #define MRF_V_TESTMODE_SINGLE_TONE 0xD
370 #define MRF_V_TESTMODE_NORMAL 0x8
372 #endif // __MRF_DEFS__