Wixel SDK
cc2511_map.h
Go to the documentation of this file.
1 
11 #ifndef _CC2511_MAP_H
12 #define _CC2511_MAP_H
13 
14 // Avoid false-alarm syntax errors in Eclipse.
15 #ifdef __CDT_PARSER__
16 #define __sfr
17 #define __at(x)
18 #define __xdata
19 #define __interrupt(x)
20 #define __using(x)
21 #endif
22 
23 #define SFRBIT(address, name, bit7, bit6, bit5, bit4, bit3, bit2, bit1, bit0) \
24  SFR(address, name) \
25  SBIT(address+0, bit0) \
26  SBIT(address+1, bit1) \
27  SBIT(address+2, bit2) \
28  SBIT(address+3, bit3) \
29  SBIT(address+4, bit4) \
30  SBIT(address+5, bit5) \
31  SBIT(address+6, bit6) \
32  SBIT(address+7, bit7)
33 
34 #if defined SDCC || defined __CDT_PARSER__
35 // Syntax for the SDCC (Small Device C Compiler).
36 #define SFR(address, name) static __sfr __at (address) name;
37 #define SBIT(address, name) static __sbit __at (address) name;
38 #define SFR16(addressH, addressL, name) static __sfr16 __at (((addressH) << 8) + (addressL)) name;
39 #define SFRX(address, name) static volatile unsigned char __xdata __at(address) name;
40 
71 #define ISR(source, bank) void ISR_##source() __interrupt(source##_VECTOR) __using(bank)
72 
73 #else
74 #error "Unknown compiler."
75 #endif
76 
77 // Interrupt vectors (SWRS055F Table 39)
78 #define RFTXRX_VECTOR 0
79 #define ADC_VECTOR 1
80 #define URX0_VECTOR 2
81 #define URX1_VECTOR 3
82 #define ENC_VECTOR 4
83 #define ST_VECTOR 5
84 #define P2INT_VECTOR 6
85 #define UTX0_VECTOR 7
86 #define DMA_VECTOR 8
87 #define T1_VECTOR 9
88 #define T2_VECTOR 10
89 #define T3_VECTOR 11
90 #define T4_VECTOR 12
91 #define P0INT_VECTOR 13
92 #define UTX1_VECTOR 14
93 #define P1INT_VECTOR 15
94 #define RF_VECTOR 16
95 #define WDT_VECTOR 17
96 
97 // Special Function Registers (SWRS055F Table 30)
98 
99 SFRBIT(0x80, P0, P0_7, P0_6, P0_5, P0_4, P0_3, P0_2, P0_1, P0_0)
100 SFR(0x81, SP)
101 SFR(0x82, DPL0)
102 SFR(0x83, DPH0)
103 SFR(0x84, DPL1)
104 SFR(0x85, DPH1)
105 SFR(0x86, U0CSR)
106 SFR(0x87, PCON)
107 
108 SFRBIT(0x88, TCON, URX1IF, _TCON_6, ADCIF, _TCON_4, URX0IF, _TCON_2, RFTXRXIF, _TCON_0)
109 SFR(0x89, P0IFG)
110 SFR(0x8A, P1IFG)
111 SFR(0x8B, P2IFG)
112 SFR(0x8C, PICTL)
113 SFR(0x8D, P1IEN)
114 // 0x8E
115 SFR(0x8F, P0INP)
116 
117 SFRBIT(0x90, P1, P1_7, P1_6, P1_5, P1_4, P1_3, P1_2, P1_1, P1_0)
118 SFR(0x91, RFIM)
119 SFR(0x92, DPS)
120 SFR(0x93, MPAGE)
121 // 0x94
122 SFR(0x95, ENDIAN)
123 // 0x96
124 // 0x97
125 
126 SFRBIT(0x98, S0CON, _SOCON7, _SOCON6, _SOCON5, _SOCON4, _SOCON3, _SOCON2, ENCIF_1, ENCIF_0)
127 // 0x99
128 SFR(0x9A, IEN2)
129 SFR(0x9B, S1CON)
130 SFR(0x9C, T2CT)
131 SFR(0x9D, T2PR)
132 SFR(0x9E, T2CTL)
133 // 0x9F
134 
135 SFRBIT(0xA0, P2, P2_7, P2_6, P2_5, P2_4, P2_3, P2_2, P2_1, P2_0)
136 SFR(0xA1, WORIRQ)
137 SFR(0xA2, WORCTRL)
138 SFR(0xA3, WOREVT0)
139 SFR(0xA4, WOREVT1)
140 SFR(0xA5, WORTIME0)
141 SFR(0xA6, WORTIME1)
142 // 0xA7
143 
144 SFRBIT(0xA8, IEN0, EA, _IEN06, STIE, ENCIE, URX1IE, URX0IE, ADCIE, RFTXRXIE)
145 SFR(0xA9, IP0)
146 // 0xAA
147 SFR(0xAB, FWT)
148 SFR(0xAC, FADDRL)
149 SFR(0xAD, FADDRH)
150 SFR(0xAE, FCTL)
151 SFR(0xAF, FWDATA)
152 
153 // 0xB0
154 SFR(0xB1, ENCDI)
155 SFR(0xB2, ENCDO)
156 SFR(0xB3, ENCCS)
157 SFR(0xB4, ADCCON1)
158 SFR(0xB5, ADCCON2)
159 SFR(0xB6, ADCCON3)
160 // 0xB7
161 
162 SFRBIT(0xB8, IEN1, _IEN17, _IEN16, P0IE, T4IE, T3IE, T2IE, T1IE, DMAIE)
163 SFR(0xB9, IP1)
164 SFR(0xBA, ADCL)
165 SFR(0xBB, ADCH)
166 SFR(0xBC, RNDL)
167 SFR(0xBD, RNDH)
168 SFR(0xBE, SLEEP)
169 // 0xBF
170 
171 SFRBIT(0xC0, IRCON, STIF, _IRCON6, P0IF, T4IF, T3IF, T2IF, T1IF, DMAIF)
172 SFR(0xC1, U0DBUF)
173 SFR(0xC2, U0BAUD)
174 // 0xC3
175 SFR(0xC4, U0UCR)
176 SFR(0xC5, U0GCR)
177 SFR(0xC6, CLKCON)
178 SFR(0xC7, MEMCTR)
179 
180 // 0xC8
181 SFR(0xC9, WDCTL)
182 SFR(0xCA, T3CNT)
183 SFR(0xCB, T3CTL)
184 SFR(0xCC, T3CCTL0)
185 SFR(0xCD, T3CC0)
186 SFR(0xCE, T3CCTL1)
187 SFR(0xCF, T3CC1)
188 
189 SFRBIT(0xD0, PSW, CY, AC, F0, RS1, RS0, OV, F1, P)
190 SFR(0xD1, DMAIRQ)
191 SFR(0xD2, DMA1CFGL)
192 SFR(0xD3, DMA1CFGH)
193 SFR(0xD4, DMA0CFGL)
194 SFR(0xD5, DMA0CFGH)
195 SFR(0xD6, DMAARM)
196 SFR(0xD7, DMAREQ)
197 
198 SFRBIT(0xD8, TIMIF, _TIMIF7, OVFIM, T4CH1IF, T4CH0IF, T4OVFIF, T3CH1IF, T3CH0IF, T3OVFIF)
199 SFR(0xD9, RFD)
200 SFR(0xDA, T1CC0L)
201 SFR(0xDB, T1CC0H)
202 SFR(0xDC, T1CC1L)
203 SFR(0xDD, T1CC1H)
204 SFR(0xDE, T1CC2L)
205 SFR(0xDF, T1CC2H)
206 
207 SFRBIT(0xE0, ACC, ACC_7, ACC_6, ACC_5, ACC_4, ACC_3, ACC_2, ACC_1, ACC_0)
208 SFR(0xE1, RFST)
209 SFR(0xE2, T1CNTL)
210 SFR(0xE3, T1CNTH)
211 SFR(0xE4, T1CTL)
212 SFR(0xE5, T1CCTL0)
213 SFR(0xE6, T1CCTL1)
214 SFR(0xE7, T1CCTL2)
215 
216 SFRBIT(0xE8, IRCON2, _IRCON27, _IRCON26, _IRCON25, WDTIF, P1IF, UTX1IF, UTX0IF, P2IF)
217 SFR(0xE9, RFIF)
218 SFR(0xEA, T4CNT)
219 SFR(0xEB, T4CTL)
220 SFR(0xEC, T4CCTL0)
221 SFR(0xED, T4CC0)
222 SFR(0xEE, T4CCTL1)
223 SFR(0xEF, T4CC1)
224 
225 SFRBIT(0xF0, B, B_7, B_6, B_5, B_4, B_3, B_2, B_1, B_0)
226 SFR(0xF1, PERCFG)
227 SFR(0xF2, ADCCFG)
228 SFR(0xF3, P0SEL)
229 SFR(0xF4, P1SEL)
230 SFR(0xF5, P2SEL)
231 SFR(0xF6, P1INP)
232 SFR(0xF7, P2INP)
233 
234 SFRBIT(0xF8, U1CSR, U1MODE, U1RE, U1SLAVE, U1FE, U1ERR, U1RX_BYTE, U1TX_BYTE, U1ACTIVE)
235 SFR(0xF9, U1DBUF)
236 SFR(0xFA, U1BAUD)
237 SFR(0xFB, U1UCR)
238 SFR(0xFC, U1GCR)
239 SFR(0xFD, P0DIR)
240 SFR(0xFE, P1DIR)
241 SFR(0xFF, P2DIR)
242 
243 #define USB_VECTOR P2INT_VECTOR
244 #define USBIF P2IF
245 
246 // 16-bit SFRs
247 SFR16(0xD5, 0xD4, DMA0CFG)
248 SFR16(0xD3, 0xD2, DMA1CFG)
249 SFR16(0xAD, 0xAC, FADDR)
250 SFR16(0xBB, 0xBA, ADC)
251 SFR16(0xDB, 0xDA, T1CC0)
252 SFR16(0xDD, 0xDC, T1CC1)
253 SFR16(0xDF, 0xDE, T1CC2)
254 
255 // XDATA Radio Registers (SWRS055F Table 32)
256 
257 SFRX(0xDF00, SYNC1)
258 SFRX(0xDF01, SYNC0)
259 SFRX(0xDF02, PKTLEN)
260 SFRX(0xDF03, PKTCTRL1)
261 SFRX(0xDF04, PKTCTRL0)
262 SFRX(0xDF05, ADDR)
263 SFRX(0xDF06, CHANNR)
264 SFRX(0xDF07, FSCTRL1)
265 SFRX(0xDF08, FSCTRL0)
266 SFRX(0xDF09, FREQ2)
267 SFRX(0xDF0A, FREQ1)
268 SFRX(0xDF0B, FREQ0)
269 SFRX(0xDF0C, MDMCFG4)
270 SFRX(0xDF0D, MDMCFG3)
271 SFRX(0xDF0E, MDMCFG2)
272 SFRX(0xDF0F, MDMCFG1)
273 SFRX(0xDF10, MDMCFG0)
274 SFRX(0xDF11, DEVIATN)
275 SFRX(0xDF12, MCSM2)
276 SFRX(0xDF13, MCSM1)
277 SFRX(0xDF14, MCSM0)
278 SFRX(0xDF15, FOCCFG)
279 SFRX(0xDF16, BSCFG)
280 SFRX(0xDF17, AGCCTRL2)
281 SFRX(0xDF18, AGCCTRL1)
282 SFRX(0xDF19, AGCCTRL0)
283 SFRX(0xDF1A, FREND1)
284 SFRX(0xDF1B, FREND0)
285 SFRX(0xDF1C, FSCAL3)
286 SFRX(0xDF1D, FSCAL2)
287 SFRX(0xDF1E, FSCAL1)
288 SFRX(0xDF1F, FSCAL0)
289 
290 SFRX(0xDF23, TEST2)
291 SFRX(0xDF24, TEST1)
292 SFRX(0xDF25, TEST0)
293 
294 SFRX(0xDF2E, PA_TABLE0)
295 SFRX(0xDF2F, IOCFG2)
296 SFRX(0xDF30, IOCFG1)
297 SFRX(0xDF31, IOCFG0)
298 
299 SFRX(0xDF36, PARTNUM)
300 SFRX(0xDF37, VERSION)
301 SFRX(0xDF38, FREQEST)
302 SFRX(0xDF39, LQI)
303 SFRX(0xDF3A, RSSI)
304 SFRX(0xDF3B, MARCSTATE)
305 SFRX(0xDF3C, PKTSTATUS)
306 SFRX(0xDF3D, VCO_VC_DAC)
307 
308 
309 // I2S Registers (SWRS055F Table 33)
310 SFRX(0xDF40, I2SCFG0)
311 SFRX(0xDF41, I2SCFG1)
312 SFRX(0xDF42, I2SDATL)
313 SFRX(0xDF43, I2SDATH)
314 SFRX(0xDF44, I2SWCNT)
315 SFRX(0xDF45, I2SSTAT)
316 SFRX(0xDF46, I2SCLKF0)
317 SFRX(0xDF47, I2SCLKF1)
318 SFRX(0xDF48, I2SCLKF2)
319 
320 
321 // Common USB Registers (SWRS055F Table 34)
322 SFRX(0xDE00, USBADDR)
323 SFRX(0xDE01, USBPOW)
324 SFRX(0xDE02, USBIIF)
325 
326 SFRX(0xDE04, USBOIF)
327 
328 SFRX(0xDE06, USBCIF)
329 SFRX(0xDE07, USBIIE)
330 
331 SFRX(0xDE09, USBOIE)
332 
333 SFRX(0xDE0B, USBCIE)
334 SFRX(0xDE0C, USBFRML)
335 SFRX(0xDE0D, USBFRMH)
336 SFRX(0xDE0E, USBINDEX)
337 
338 // Indexed USB Endpoint Registers (SWRS055F Table 35)
339 SFRX(0xDE10, USBMAXI)
340 SFRX(0xDE11, USBCSIL)
341 SFRX(0xDE12, USBCSIH)
342 SFRX(0xDE13, USBMAXO)
343 SFRX(0xDE14, USBCSOL)
344 SFRX(0xDE15, USBCSOH)
345 SFRX(0xDE16, USBCNTL)
346 SFRX(0xDE17, USBCNTH)
347 
348 // USB Fifo addresses
349 SFRX(0xDE20, USBF0)
350 SFRX(0xDE22, USBF1)
351 SFRX(0xDE24, USBF2)
352 SFRX(0xDE26, USBF3)
353 SFRX(0xDE28, USBF4)
354 SFRX(0xDE2A, USBF5)
355 
356 #define USBCS0 USBCSIL
357 #define USBCNT0 USBCNTL
358 
369 #define XDATA_SFR_ADDRESS(sfr) (0xDF00 + ((unsigned int)&(sfr)))
370 
379 typedef struct
380 {
381  unsigned char SRCADDRH;
382  unsigned char SRCADDRL;
383  unsigned char DESTADDRH;
384  unsigned char DESTADDRL;
385 
387  unsigned char VLEN_LENH;
388  unsigned char LENL;
389 
391  unsigned char DC6;
392 
394  unsigned char DC7;
395 } DMA_CONFIG;
396 
397 
398 #endif
unsigned char DC6
Definition: cc2511_map.h:391
unsigned char VLEN_LENH
Definition: cc2511_map.h:387
unsigned char DC7
Definition: cc2511_map.h:394