RTEMS CPU Kit with SuperCore  4.11.3
io86r401.h
Go to the documentation of this file.
1 
9 /*
10  * Copyright (c) 2002, Colin O'Flynn
11  * All rights reserved.
12  *
13  * Redistribution and use in source and binary forms, with or without
14  * modification, are permitted provided that the following conditions are met:
15  *
16  * * Redistributions of source code must retain the above copyright
17  * notice, this list of conditions and the following disclaimer.
18  *
19  * * Redistributions in binary form must reproduce the above copyright
20  * notice, this list of conditions and the following disclaimer in
21  * the documentation and/or other materials provided with the
22  * distribution.
23  *
24  * * Neither the name of the copyright holders nor the names of
25  * contributors may be used to endorse or promote products derived
26  * from this software without specific prior written permission.
27  *
28  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
29  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
30  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
31  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
32  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
33  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
34  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
35  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
36  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
37  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38  * POSSIBILITY OF SUCH DAMAGE.
39  */
40 
41 #ifndef _AVR_IO86RF401_H_
42 #define _AVR_IO86RF401_H_ 1
43 
51 #ifndef _AVR_IO_H_
52 # error "Include <avr/io.h> instead of this file."
53 #endif
54 
55 #ifndef _AVR_IOXXX_H_
56 # define _AVR_IOXXX_H_ "io86r401.h"
57 #else
58 # error "Attempt to include more than one <avr/ioXXX.h> file."
59 #endif
60 
61 #include <avr/sfr_defs.h>
62 
63 /* Status REGister */
64 #define SREG _SFR_IO8(0x3F)
65 
66 /* Stack Pointer */
67 #define SP _SFR_IO16(0x3D)
68 #define SPH _SFR_IO8(0x3E)
69 #define SPL _SFR_IO8(0x3D)
70 
71 /*Battery low configeration register */
72 #define BL_CONFIG _SFR_IO8(0x35)
73 
74 /*Button detect register*/
75 #define B_DET _SFR_IO8(0x34)
76 
77 /*AVR Configeration register*/
78 #define AVR_CONFIG _SFR_IO8(0x33)
79 
80 /* I/O registers */
81 
82 /*Data in register */
83 #define IO_DATIN _SFR_IO8(0x32)
84 
85 /*Data out register */
86 #define IO_DATOUT _SFR_IO8(0x31)
87 
88 /*IO Enable register */
89 #define IO_ENAB _SFR_IO8(0x30)
90 
91 /* Watchdog Timer Control Register */
92 #define WDTCR _SFR_IO8(0x22)
93 
94 /* Bit Timer Control Register */
95 #define BTCR _SFR_IO8(0x21)
96 
97 #define BTCNT _SFR_IO8(0x20)
98 
99 /*
100 NOTE: EEPROM name's changed to have D in front on them, per datasheet, but
101 you may want to remove the leading D.
102 */
103 /* EEPROM Control Register */
104 
105 /* EEPROM Address Register */
106 #define DEEAR _SFR_IO8(0x1E)
107 #define DEEARL _SFR_IO8(0x1E)
108 
109 /* EEPROM Data Register */
110 #define DEEDR _SFR_IO8(0x1D)
111 /* EEPROM Control Register */
112 #define DEECR _SFR_IO8(0x1C)
113 
114 /* Lock Detector Configuration Register 2 */
115 #define LOCKDET2 _SFR_IO8(0x17)
116 
117 /* VCO Tuning Register*/
118 #define VCOTUNE _SFR_IO8(0x16)
119 
120 /* Power Attenuation Control Register */
121 #define PWR_ATTEN _SFR_IO8(0x14)
122 
123 /* Transmitter Control Register */
124 #define TX_CNTL _SFR_IO8(0x12)
125 
126 /* Lock Detector Configuration Register 1 */
127 #define LOCKDET1 _SFR_IO8(0x10)
128 
129 
130 /* Interrupt vectors */
131 
132 /* Transmission Done, Bit Timer Flag 2 Interrupt */
133 #define TXDONE_vect _VECTOR(1)
134 #define SIG_TXDONE _VECTOR(1)
135 
136 /* Transmit Buffer Empty, Bit Itmer Flag 0 Interrupt */
137 #define TXEMPTY_vect _VECTOR(2)
138 #define SIG_TXBE _VECTOR(2)
139 
140 #define _VECTORS_SIZE 12
141 
142 /*
143  * The Register Bit names are represented by their bit number (0-7).
144  */
145 
146 /* Lock Detector Configuration Register 1 - LOCKDET1 */
147 #define UPOK 4
148 #define ENKO 3
149 #define BOD 2
150 #define CS1 1
151 #define CS0 0
152 
153 /* Transmit Control Register - TX_CNTL */
154 #define TXE 5
155 #define TXK 4
156 #define LOC 2
157 
158 /* Power Attenuation Control Register - PWR_ATTEN */
159 #define PCC2 5
160 #define PCC1 4
161 #define PCC0 3
162 #define PCF2 2
163 #define PCF1 1
164 #define PCF0 0
165 
166 /* VCO Tuning Register 6 - VCOTUNE --NOTE: [] removed from names*/
167 #define VCOVDET1 7
168 #define VCOVDET0 6
169 #define VCOTUNE4 4
170 #define VCOTUNE3 3
171 #define VCOTUNE2 2
172 #define VCOTUNE1 1
173 #define VCOTUNE0 0
174 
175 /* Lock Detector Configuration Register 2 - LOCKDET2 --NOTE: [] removed from names*/
176 #define EUD 7
177 #define LAT 6
178 #define ULC2 5
179 #define ULC1 4
180 #define ULC0 3
181 #define LC2 2
182 #define LC1 1
183 #define LC0 0
184 
185 /* Data EEPROM Control Register - DEECR */
186 #define BSY 3
187 #define EEU 2
188 #define EEL 1
189 #define EER 0
190 
191 /* Data EEPROM Data Register - DEEDR */
192 #define ED7 7
193 #define ED6 6
194 #define ED5 5
195 #define ED4 4
196 #define ED3 3
197 #define ED2 2
198 #define ED1 1
199 #define ED0 0
200 
201 /* Data EEPROM Address Register - DEEAR */
202 #define PA6 6
203 #define PA5 5
204 #define PA4 4
205 #define PA3 3
206 #define BA2 2 /* B is not a typo! */
207 #define BA1 1
208 #define BA0 0
209 
210 /* Bit Timer Count Register - BTCNT */
211 #define C7 7
212 #define C6 6
213 #define C5 5
214 #define C4 4
215 #define C3 3
216 #define C2 2
217 #define C1 1
218 #define C0 0
219 
220 /* Bit Timer Control Register - BTCR */
221 #define C9 7
222 #define C8 6
223 #define M1 5
224 #define M0 4
225 #define IE 3
226 #define F2 2
227 #define DATA 1
228 #define F0 0
229 
230 /* Watchdog Timer Control Register - WDTCR */
231 #define WDTOE 4
232 #define WDE 3
233 #define WDP2 2
234 #define WDP1 1
235 #define WDP0 0
236 
237 /* I/O Enable Register - IO_ENAB */
238 #define BOHYST 6
239 #define IOE5 5
240 #define IOE4 4
241 #define IOE3 3
242 #define IOE2 2
243 #define IOE1 1
244 #define IOE0 0
245 
246 /* Note: No PORTB or whatever, this is the equivalent. */
247 /* I/O Data Out Register - IO_DATOUT */
248 #define IOO5 5
249 #define IOO4 4
250 #define IOO3 3
251 #define IOO2 2
252 #define IOO1 1
253 #define IOO0 0
254 
255 /* Note: No PINB or whatever, this is the equivalent. */
256 /* I/O Data In Register - IO_DATIN */
257 #define IOI5 5
258 #define IOI4 4
259 #define IOI3 3
260 #define IOI2 2
261 #define IOI1 1
262 #define IOI0 0
263 
264 /* AVR Configuration Register - AVR_CONFIG */
265 #define ACS1 6
266 #define ACS0 5
267 #define TM 4
268 #define BD 3
269 #define BLI 2
270 #define SLEEP 1
271 #define BBM 0
272 
273 /* Button Detect Register - B_DET */
274 #define BD5 5
275 #define BD4 4
276 #define BD3 3
277 #define BD2 2
278 #define BD1 1
279 #define BD0 0
280 
281 /* Battery Low Configuration Register - BL_CONFIG */
282 #define BL 7
283 #define BLV 6
284 #define BL5 5
285 #define BL4 4
286 #define BL3 3
287 #define BL2 2
288 #define BL1 1
289 #define BL0 0
290 
291 /* Pointer definition */
292 #define XL r26
293 #define XH r27
294 #define YL r28
295 #define YH r29
296 #define ZL r30
297 #define ZH r31
298 
299 /* Constants */
300 #define RAMEND 0xDF
301 #define XRAMEND RAMEND
302 #define E2END 0x7F
303 #define E2PAGESIZE 0
304 #define FLASHEND 0x07FF
305 
306 
307 /* Fuses */
308 #define FUSE_MEMORY_SIZE 0
309 
310 
311 /* Lock Bits */
312 #define __LOCK_BITS_EXIST
313 
314 
315 /* Signature */
316 #define SIGNATURE_0 0x1E
317 #define SIGNATURE_1 0x91
318 #define SIGNATURE_2 0x81
319 
321 #endif /* _AVR_IO86RF401_H_ */
Macros for Accessing AVR Special Function Registers.