1 | /** |
---|
2 | * @file avr/iotn261a.h |
---|
3 | * |
---|
4 | * @brief Definitions for ATtiny261A |
---|
5 | * |
---|
6 | * This file should only be included from <avr/io.h>, never directly. |
---|
7 | */ |
---|
8 | |
---|
9 | /* |
---|
10 | * Copyright (c) 2009 Atmel Corporation |
---|
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_IO_H_ |
---|
42 | # error "Include <avr/io.h> instead of this file." |
---|
43 | #endif |
---|
44 | |
---|
45 | #ifndef _AVR_IOXXX_H_ |
---|
46 | # define _AVR_IOXXX_H_ "iotn261a.h" |
---|
47 | #else |
---|
48 | # error "Attempt to include more than one <avr/ioXXX.h> file." |
---|
49 | #endif |
---|
50 | |
---|
51 | |
---|
52 | #ifndef _AVR_ATtiny261A_H_ |
---|
53 | #define _AVR_ATtiny261A_H_ 1 |
---|
54 | |
---|
55 | /** |
---|
56 | * @defgroup Avr_iotn261a ATtiny261A Definitions |
---|
57 | * |
---|
58 | * @ingroup avr |
---|
59 | */ |
---|
60 | /**@{*/ |
---|
61 | |
---|
62 | /* Registers and associated bit numbers. */ |
---|
63 | |
---|
64 | #define TCCR1E _SFR_IO8(0x00) |
---|
65 | #define OC1OE0 0 |
---|
66 | #define OC1OE1 1 |
---|
67 | #define OC1OE2 2 |
---|
68 | #define OC1OE3 3 |
---|
69 | #define OC1OE4 4 |
---|
70 | #define OC1OE5 5 |
---|
71 | |
---|
72 | #define DIDR0 _SFR_IO8(0x01) |
---|
73 | #define ADC0D 0 |
---|
74 | #define ADC1D 1 |
---|
75 | #define ADC2D 2 |
---|
76 | #define AREFD 3 |
---|
77 | #define ADC3D 4 |
---|
78 | #define ADC4D 5 |
---|
79 | #define ADC5D 6 |
---|
80 | #define ADC6D 7 |
---|
81 | |
---|
82 | #define DIDR1 _SFR_IO8(0x02) |
---|
83 | #define ADC7D 4 |
---|
84 | #define ADC8D 5 |
---|
85 | #define ADC9D 6 |
---|
86 | #define ADC10D 7 |
---|
87 | |
---|
88 | #define ADCSRB _SFR_IO8(0x03) |
---|
89 | #define ADTS0 0 |
---|
90 | #define ADTS1 1 |
---|
91 | #define ADTS2 2 |
---|
92 | #define MUX5 3 |
---|
93 | #define REFS2 4 |
---|
94 | #define IPR 5 |
---|
95 | #define GSEL 6 |
---|
96 | #define BIN 7 |
---|
97 | |
---|
98 | #ifndef __ASSEMBLER__ |
---|
99 | #define ADC _SFR_IO16(0x04) |
---|
100 | #endif |
---|
101 | #define ADCW _SFR_IO16(0x04) |
---|
102 | |
---|
103 | #define ADCL _SFR_IO8(0x04) |
---|
104 | #define ADCL0 0 |
---|
105 | #define ADCL1 1 |
---|
106 | #define ADCL2 2 |
---|
107 | #define ADCL3 3 |
---|
108 | #define ADCL4 4 |
---|
109 | #define ADCL5 5 |
---|
110 | #define ADCL6 6 |
---|
111 | #define ADCL7 7 |
---|
112 | |
---|
113 | #define ADCH _SFR_IO8(0x05) |
---|
114 | #define ADCH0 0 |
---|
115 | #define ADCH1 1 |
---|
116 | #define ADCH2 2 |
---|
117 | #define ADCH3 3 |
---|
118 | #define ADCH4 4 |
---|
119 | #define ADCH5 5 |
---|
120 | #define ADCH6 6 |
---|
121 | #define ADCH7 7 |
---|
122 | |
---|
123 | #define ADCSRA _SFR_IO8(0x06) |
---|
124 | #define ADPS0 0 |
---|
125 | #define ADPS1 1 |
---|
126 | #define ADPS2 2 |
---|
127 | #define ADIE 3 |
---|
128 | #define ADIF 4 |
---|
129 | #define ADATE 5 |
---|
130 | #define ADSC 6 |
---|
131 | #define ADEN 7 |
---|
132 | |
---|
133 | #define ADMUX _SFR_IO8(0x07) |
---|
134 | #define MUX0 0 |
---|
135 | #define MUX1 1 |
---|
136 | #define MUX2 2 |
---|
137 | #define MUX3 3 |
---|
138 | #define MUX4 4 |
---|
139 | #define ADLAR 5 |
---|
140 | #define REFS0 6 |
---|
141 | #define REFS1 7 |
---|
142 | |
---|
143 | #define ACSRA _SFR_IO8(0x08) |
---|
144 | #define ACIS0 0 |
---|
145 | #define ACIS1 1 |
---|
146 | #define ACME 2 |
---|
147 | #define ACIE 3 |
---|
148 | #define ACI 4 |
---|
149 | #define ACO 5 |
---|
150 | #define ACBG 6 |
---|
151 | #define ACD 7 |
---|
152 | |
---|
153 | #define ACSRB _SFR_IO8(0x09) |
---|
154 | #define ACM0 0 |
---|
155 | #define ACM1 1 |
---|
156 | #define ACM2 2 |
---|
157 | #define HLEV 6 |
---|
158 | #define HSEL 7 |
---|
159 | |
---|
160 | #define GPIOR0 _SFR_IO8(0x0A) |
---|
161 | #define GPIOR00 0 |
---|
162 | #define GPIOR01 1 |
---|
163 | #define GPIOR02 2 |
---|
164 | #define GPIOR03 3 |
---|
165 | #define GPIOR04 4 |
---|
166 | #define GPIOR05 5 |
---|
167 | #define GPIOR06 6 |
---|
168 | #define GPIOR07 7 |
---|
169 | |
---|
170 | #define GPIOR1 _SFR_IO8(0x0B) |
---|
171 | #define GPIOR10 0 |
---|
172 | #define GPIOR11 1 |
---|
173 | #define GPIOR12 2 |
---|
174 | #define GPIOR13 3 |
---|
175 | #define GPIOR14 4 |
---|
176 | #define GPIOR15 5 |
---|
177 | #define GPIOR16 6 |
---|
178 | #define GPIOR17 7 |
---|
179 | |
---|
180 | #define GPIOR2 _SFR_IO8(0x0C) |
---|
181 | #define GPIOR20 0 |
---|
182 | #define GPIOR21 1 |
---|
183 | #define GPIOR22 2 |
---|
184 | #define GPIOR23 3 |
---|
185 | #define GPIOR24 4 |
---|
186 | #define GPIOR25 5 |
---|
187 | #define GPIOR26 6 |
---|
188 | #define GPIOR27 7 |
---|
189 | |
---|
190 | #define USICR _SFR_IO8(0x0D) |
---|
191 | #define USITC 0 |
---|
192 | #define USICLK 1 |
---|
193 | #define USICS0 2 |
---|
194 | #define USICS1 3 |
---|
195 | #define USIWM0 4 |
---|
196 | #define USIWM1 5 |
---|
197 | #define USIOIE 6 |
---|
198 | #define USISIE 7 |
---|
199 | |
---|
200 | #define USISR _SFR_IO8(0x0E) |
---|
201 | #define USICNT0 0 |
---|
202 | #define USICNT1 1 |
---|
203 | #define USICNT2 2 |
---|
204 | #define USICNT3 3 |
---|
205 | #define USIDC 4 |
---|
206 | #define USIPF 5 |
---|
207 | #define USIOIF 6 |
---|
208 | #define USISIF 7 |
---|
209 | |
---|
210 | #define USIDR _SFR_IO8(0x0F) |
---|
211 | #define USIDR0 0 |
---|
212 | #define USIDR1 1 |
---|
213 | #define USIDR2 2 |
---|
214 | #define USIDR3 3 |
---|
215 | #define USIDR4 4 |
---|
216 | #define USIDR5 5 |
---|
217 | #define USIDR6 6 |
---|
218 | #define USIDR7 7 |
---|
219 | |
---|
220 | #define USIBR _SFR_IO8(0x10) |
---|
221 | #define USIBR0 0 |
---|
222 | #define USIBR1 1 |
---|
223 | #define USIBR2 2 |
---|
224 | #define USIBR3 3 |
---|
225 | #define USIBR4 4 |
---|
226 | #define USIBR5 5 |
---|
227 | #define USIBR6 6 |
---|
228 | #define USIBR7 7 |
---|
229 | |
---|
230 | #define USIPP _SFR_IO8(0x11) |
---|
231 | #define USIPOS 0 |
---|
232 | |
---|
233 | #define OCR0B _SFR_IO8(0x12) |
---|
234 | #define OCR0B_0 0 |
---|
235 | #define OCR0B_1 1 |
---|
236 | #define OCR0B_2 2 |
---|
237 | #define OCR0B_3 3 |
---|
238 | #define OCR0B_4 4 |
---|
239 | #define OCR0B_5 5 |
---|
240 | #define OCR0B_6 6 |
---|
241 | #define OCR0B_7 7 |
---|
242 | |
---|
243 | #define OCR0A _SFR_IO8(0x13) |
---|
244 | #define OCR0A_0 0 |
---|
245 | #define OCR0A_1 1 |
---|
246 | #define OCR0A_2 2 |
---|
247 | #define OCR0A_3 3 |
---|
248 | #define OCR0A_4 4 |
---|
249 | #define OCR0A_5 5 |
---|
250 | #define OCR0A_6 6 |
---|
251 | #define OCR0A_7 7 |
---|
252 | |
---|
253 | #define TCNT0H _SFR_IO8(0x14) |
---|
254 | #define TCNT0H_0 0 |
---|
255 | #define TCNT0H_1 1 |
---|
256 | #define TCNT0H_2 2 |
---|
257 | #define TCNT0H_3 3 |
---|
258 | #define TCNT0H_4 4 |
---|
259 | #define TCNT0H_5 5 |
---|
260 | #define TCNT0H_6 6 |
---|
261 | #define TCNT0H_7 7 |
---|
262 | |
---|
263 | #define TCCR0A _SFR_IO8(0x15) |
---|
264 | #define WGM00 0 |
---|
265 | #define ACIC0 3 |
---|
266 | #define ICES0 4 |
---|
267 | #define ICNC0 5 |
---|
268 | #define ICEN0 6 |
---|
269 | #define TCW0 7 |
---|
270 | |
---|
271 | #define PINB _SFR_IO8(0x16) |
---|
272 | #define PINB0 0 |
---|
273 | #define PINB1 1 |
---|
274 | #define PINB2 2 |
---|
275 | #define PINB3 3 |
---|
276 | #define PINB4 4 |
---|
277 | #define PINB5 5 |
---|
278 | #define PINB6 6 |
---|
279 | #define PINB7 7 |
---|
280 | |
---|
281 | #define DDRB _SFR_IO8(0x17) |
---|
282 | #define DDB0 0 |
---|
283 | #define DDB1 1 |
---|
284 | #define DDB2 2 |
---|
285 | #define DDB3 3 |
---|
286 | #define DDB4 4 |
---|
287 | #define DDB5 5 |
---|
288 | #define DDB6 6 |
---|
289 | #define DDB7 7 |
---|
290 | |
---|
291 | #define PORTB _SFR_IO8(0x18) |
---|
292 | #define PORTB0 0 |
---|
293 | #define PORTB1 1 |
---|
294 | #define PORTB2 2 |
---|
295 | #define PORTB3 3 |
---|
296 | #define PORTB4 4 |
---|
297 | #define PORTB5 5 |
---|
298 | #define PORTB6 6 |
---|
299 | #define PORTB7 7 |
---|
300 | |
---|
301 | #define PINA _SFR_IO8(0x19) |
---|
302 | #define PINA0 0 |
---|
303 | #define PINA1 1 |
---|
304 | #define PINA2 2 |
---|
305 | #define PINA3 3 |
---|
306 | #define PINA4 4 |
---|
307 | #define PINA5 5 |
---|
308 | #define PINA6 6 |
---|
309 | #define PINA7 7 |
---|
310 | |
---|
311 | #define DDRA _SFR_IO8(0x1A) |
---|
312 | #define DDA0 0 |
---|
313 | #define DDA1 1 |
---|
314 | #define DDA2 2 |
---|
315 | #define DDA3 3 |
---|
316 | #define DDA4 4 |
---|
317 | #define DDA5 5 |
---|
318 | #define DDA6 6 |
---|
319 | #define DDA7 7 |
---|
320 | |
---|
321 | #define PORTA _SFR_IO8(0x1B) |
---|
322 | #define PORTA0 0 |
---|
323 | #define PORTA1 1 |
---|
324 | #define PORTA2 2 |
---|
325 | #define PORTA3 3 |
---|
326 | #define PORTA4 4 |
---|
327 | #define PORTA5 5 |
---|
328 | #define PORTA6 6 |
---|
329 | #define PORTA7 7 |
---|
330 | |
---|
331 | #define EECR _SFR_IO8(0x1C) |
---|
332 | #define EERE 0 |
---|
333 | #define EEPE 1 |
---|
334 | #define EEMPE 2 |
---|
335 | #define EERIE 3 |
---|
336 | #define EEPM0 4 |
---|
337 | #define EEPM1 5 |
---|
338 | |
---|
339 | #define EEDR _SFR_IO8(0x1D) |
---|
340 | #define EEDR0 0 |
---|
341 | #define EEDR1 1 |
---|
342 | #define EEDR2 2 |
---|
343 | #define EEDR3 3 |
---|
344 | #define EEDR4 4 |
---|
345 | #define EEDR5 5 |
---|
346 | #define EEDR6 6 |
---|
347 | #define EEDR7 7 |
---|
348 | |
---|
349 | #define EEAR _SFR_IO16(0x1E) |
---|
350 | |
---|
351 | #define EEARL _SFR_IO8(0x1E) |
---|
352 | #define EEAR0 0 |
---|
353 | #define EEAR1 1 |
---|
354 | #define EEAR2 2 |
---|
355 | #define EEAR3 3 |
---|
356 | #define EEAR4 4 |
---|
357 | #define EEAR5 5 |
---|
358 | #define EEAR6 6 |
---|
359 | #define EEAR7 7 |
---|
360 | |
---|
361 | #define EEARH _SFR_IO8(0x1F) |
---|
362 | #define EEAR8 0 |
---|
363 | |
---|
364 | #define DWDR _SFR_IO8(0x20) |
---|
365 | #define DWDR0 0 |
---|
366 | #define DWDR1 1 |
---|
367 | #define DWDR2 2 |
---|
368 | #define DWDR3 3 |
---|
369 | #define DWDR4 4 |
---|
370 | #define DWDR5 5 |
---|
371 | #define DWDR6 6 |
---|
372 | #define DWDR7 7 |
---|
373 | |
---|
374 | #define WDTCR _SFR_IO8(0x21) |
---|
375 | #define WDP0 0 |
---|
376 | #define WDP1 1 |
---|
377 | #define WDP2 2 |
---|
378 | #define WDE 3 |
---|
379 | #define WDCE 4 |
---|
380 | #define WDP3 5 |
---|
381 | #define WDIE 6 |
---|
382 | #define WDIF 7 |
---|
383 | |
---|
384 | #define PCMSK1 _SFR_IO8(0x22) |
---|
385 | #define PCINT8 0 |
---|
386 | #define PCINT9 1 |
---|
387 | #define PCINT10 2 |
---|
388 | #define PCINT11 3 |
---|
389 | #define PCINT12 4 |
---|
390 | #define PCINT13 5 |
---|
391 | #define PCINT14 6 |
---|
392 | #define PCINT15 7 |
---|
393 | |
---|
394 | #define PCMSK0 _SFR_IO8(0x23) |
---|
395 | #define PCINT0 0 |
---|
396 | #define PCINT1 1 |
---|
397 | #define PCINT2 2 |
---|
398 | #define PCINT3 3 |
---|
399 | #define PCINT4 4 |
---|
400 | #define PCINT5 5 |
---|
401 | #define PCINT6 6 |
---|
402 | #define PCINT7 7 |
---|
403 | |
---|
404 | #define DT1 _SFR_IO8(0x24) |
---|
405 | #define DT1L0 0 |
---|
406 | #define DT1L1 1 |
---|
407 | #define DT1L2 2 |
---|
408 | #define DT1L3 3 |
---|
409 | #define DT1H0 4 |
---|
410 | #define DT1H1 5 |
---|
411 | #define DT1H2 6 |
---|
412 | #define DT1H3 7 |
---|
413 | |
---|
414 | #define TC1H _SFR_IO8(0x25) |
---|
415 | #define TC18 0 |
---|
416 | #define TC19 1 |
---|
417 | |
---|
418 | #define TCCR1D _SFR_IO8(0x26) |
---|
419 | #define WGM10 0 |
---|
420 | #define WGM11 1 |
---|
421 | #define FPF1 2 |
---|
422 | #define FPAC1 3 |
---|
423 | #define FPES1 4 |
---|
424 | #define FPNC1 5 |
---|
425 | #define FPEN1 6 |
---|
426 | #define FPIE1 7 |
---|
427 | |
---|
428 | #define TCCR1C _SFR_IO8(0x27) |
---|
429 | #define PWM1D 0 |
---|
430 | #define FOC1D 1 |
---|
431 | #define COM1D0 2 |
---|
432 | #define COM1D1 3 |
---|
433 | #define COM1B0S 4 |
---|
434 | #define COM1B1S 5 |
---|
435 | #define COM1A0S 6 |
---|
436 | #define COM1A1S 7 |
---|
437 | |
---|
438 | #define CLKPR _SFR_IO8(0x28) |
---|
439 | #define CLKPS0 0 |
---|
440 | #define CLKPS1 1 |
---|
441 | #define CLKPS2 2 |
---|
442 | #define CLKPS3 3 |
---|
443 | #define CLKPCE 7 |
---|
444 | |
---|
445 | #define PLLCSR _SFR_IO8(0x29) |
---|
446 | #define PLOCK 0 |
---|
447 | #define PLLE 1 |
---|
448 | #define PCKE 2 |
---|
449 | #define LSM 7 |
---|
450 | |
---|
451 | #define OCR1D _SFR_IO8(0x2A) |
---|
452 | #define OCR1D0 0 |
---|
453 | #define OCR1D1 1 |
---|
454 | #define OCR1D2 2 |
---|
455 | #define OCR1D3 3 |
---|
456 | #define OCR1D4 4 |
---|
457 | #define OCR1D5 5 |
---|
458 | #define OCR1D6 6 |
---|
459 | #define OCR1D7 7 |
---|
460 | |
---|
461 | #define OCR1C _SFR_IO8(0x2B) |
---|
462 | #define OCR1C0 0 |
---|
463 | #define OCR1C1 1 |
---|
464 | #define OCR1C2 2 |
---|
465 | #define OCR1C3 3 |
---|
466 | #define OCR1C4 4 |
---|
467 | #define OCR1C5 5 |
---|
468 | #define OCR1C6 6 |
---|
469 | #define OCR1C7 7 |
---|
470 | |
---|
471 | #define OCR1B _SFR_IO8(0x2C) |
---|
472 | #define OCR1B0 0 |
---|
473 | #define OCR1B1 1 |
---|
474 | #define OCR1B2 2 |
---|
475 | #define OCR1B3 3 |
---|
476 | #define OCR1B4 4 |
---|
477 | #define OCR1B5 5 |
---|
478 | #define OCR1B6 6 |
---|
479 | #define OCR1B7 7 |
---|
480 | |
---|
481 | #define OCR1A _SFR_IO8(0x2D) |
---|
482 | #define OCR1A0 0 |
---|
483 | #define OCR1A1 1 |
---|
484 | #define OCR1A2 2 |
---|
485 | #define OCR1A3 3 |
---|
486 | #define OCR1A4 4 |
---|
487 | #define OCR1A5 5 |
---|
488 | #define OCR1A6 6 |
---|
489 | #define OCR1A7 7 |
---|
490 | |
---|
491 | #define TCNT1 _SFR_IO8(0x2E) |
---|
492 | #define TC1H_0 0 |
---|
493 | #define TC1H_1 1 |
---|
494 | #define TC1H_2 2 |
---|
495 | #define TC1H_3 3 |
---|
496 | #define TC1H_4 4 |
---|
497 | #define TC1H_5 5 |
---|
498 | #define TC1H_6 6 |
---|
499 | #define TC1H_7 7 |
---|
500 | |
---|
501 | #define TCCR1B _SFR_IO8(0x2F) |
---|
502 | #define CS10 0 |
---|
503 | #define CS11 1 |
---|
504 | #define CS12 2 |
---|
505 | #define CS13 3 |
---|
506 | #define DTPS10 4 |
---|
507 | #define DTPS11 5 |
---|
508 | #define PSR1 6 |
---|
509 | |
---|
510 | #define TCCR1A _SFR_IO8(0x30) |
---|
511 | #define PWM1B 0 |
---|
512 | #define PWM1A 1 |
---|
513 | #define FOC1B 2 |
---|
514 | #define FOC1A 3 |
---|
515 | #define COM1B0 4 |
---|
516 | #define COM1B1 5 |
---|
517 | #define COM1A0 6 |
---|
518 | #define COM1A1 7 |
---|
519 | |
---|
520 | #define OSCCAL _SFR_IO8(0x31) |
---|
521 | #define CAL0 0 |
---|
522 | #define CAL1 1 |
---|
523 | #define CAL2 2 |
---|
524 | #define CAL3 3 |
---|
525 | #define CAL4 4 |
---|
526 | #define CAL5 5 |
---|
527 | #define CAL6 6 |
---|
528 | #define CAL7 7 |
---|
529 | |
---|
530 | #define TCNT0L _SFR_IO8(0x32) |
---|
531 | #define TCNT0L_0 0 |
---|
532 | #define TCNT0L_1 1 |
---|
533 | #define TCNT0L_2 2 |
---|
534 | #define TCNT0L_3 3 |
---|
535 | #define TCNT0L_4 4 |
---|
536 | #define TCNT0L_5 5 |
---|
537 | #define TCNT0L_6 6 |
---|
538 | #define TCNT0L_7 7 |
---|
539 | |
---|
540 | #define TCCR0B _SFR_IO8(0x33) |
---|
541 | #define CS00 0 |
---|
542 | #define CS01 1 |
---|
543 | #define CS02 2 |
---|
544 | #define PSR0 3 |
---|
545 | #define TSM 4 |
---|
546 | |
---|
547 | #define MCUSR _SFR_IO8(0x34) |
---|
548 | #define PORF 0 |
---|
549 | #define EXTRF 1 |
---|
550 | #define BORF 2 |
---|
551 | #define WDRF 3 |
---|
552 | |
---|
553 | #define MCUCR _SFR_IO8(0x35) |
---|
554 | #define ISC00 0 |
---|
555 | #define ISC01 1 |
---|
556 | #define BODSE 2 |
---|
557 | #define SM0 3 |
---|
558 | #define SM1 4 |
---|
559 | #define SE 5 |
---|
560 | #define PUD 6 |
---|
561 | #define BODS 7 |
---|
562 | |
---|
563 | #define PRR _SFR_IO8(0x36) |
---|
564 | #define PRADC 0 |
---|
565 | #define PRUSI 1 |
---|
566 | #define PRTIM0 2 |
---|
567 | #define PRTIM1 3 |
---|
568 | |
---|
569 | #define SPMCSR _SFR_IO8(0x37) |
---|
570 | #define SPMEN 0 |
---|
571 | #define PGERS 1 |
---|
572 | #define PGWRT 2 |
---|
573 | #define RFLB 3 |
---|
574 | #define CTPB 4 |
---|
575 | |
---|
576 | #define TIFR _SFR_IO8(0x38) |
---|
577 | #define ICF0 0 |
---|
578 | #define TOV0 1 |
---|
579 | #define TOV1 2 |
---|
580 | #define OCF0B 3 |
---|
581 | #define OCF0A 4 |
---|
582 | #define OCF1B 5 |
---|
583 | #define OCF1A 6 |
---|
584 | #define OCF1D 7 |
---|
585 | |
---|
586 | #define TIMSK _SFR_IO8(0x39) |
---|
587 | #define TICIE0 0 |
---|
588 | #define TOIE0 1 |
---|
589 | #define TOIE1 2 |
---|
590 | #define OCIE0B 3 |
---|
591 | #define OCIE0A 4 |
---|
592 | #define OCIE1B 5 |
---|
593 | #define OCIE1A 6 |
---|
594 | #define OCIE1D 7 |
---|
595 | |
---|
596 | #define GIFR _SFR_IO8(0x3A) |
---|
597 | #define PCIF 5 |
---|
598 | #define INTF0 6 |
---|
599 | #define INTF1 7 |
---|
600 | |
---|
601 | #define GIMSK _SFR_IO8(0x3B) |
---|
602 | #define PCIE0 4 |
---|
603 | #define PCIE1 5 |
---|
604 | #define INT0 6 |
---|
605 | #define INT1 7 |
---|
606 | |
---|
607 | |
---|
608 | /* Interrupt vectors */ |
---|
609 | /* Vector 0 is the reset vector */ |
---|
610 | #define INT0_vect_num 1 |
---|
611 | #define INT0_vect _VECTOR(1) /* External Interrupt 0 */ |
---|
612 | #define PCINT_vect_num 2 |
---|
613 | #define PCINT_vect _VECTOR(2) /* Pin Change Interrupt */ |
---|
614 | #define TIMER1_COMPA_vect_num 3 |
---|
615 | #define TIMER1_COMPA_vect _VECTOR(3) /* Timer/Counter1 Compare Match 1A */ |
---|
616 | #define TIMER1_COMPB_vect_num 4 |
---|
617 | #define TIMER1_COMPB_vect _VECTOR(4) /* Timer/Counter1 Compare Match 1B */ |
---|
618 | #define TIMER1_OVF_vect_num 5 |
---|
619 | #define TIMER1_OVF_vect _VECTOR(5) /* Timer/Counter1 Overflow */ |
---|
620 | #define TIMER0_OVF_vect_num 6 |
---|
621 | #define TIMER0_OVF_vect _VECTOR(6) /* Timer/Counter0 Overflow */ |
---|
622 | #define USI_START_vect_num 7 |
---|
623 | #define USI_START_vect _VECTOR(7) /* USI Start */ |
---|
624 | #define USI_OVF_vect_num 8 |
---|
625 | #define USI_OVF_vect _VECTOR(8) /* USI Overflow */ |
---|
626 | #define EE_RDY_vect_num 9 |
---|
627 | #define EE_RDY_vect _VECTOR(9) /* EEPROM Ready */ |
---|
628 | #define ANA_COMP_vect_num 10 |
---|
629 | #define ANA_COMP_vect _VECTOR(10) /* Analog Comparator */ |
---|
630 | #define ADC_vect_num 11 |
---|
631 | #define ADC_vect _VECTOR(11) /* ADC Conversion Complete */ |
---|
632 | #define WDT_vect_num 12 |
---|
633 | #define WDT_vect _VECTOR(12) /* Watchdog Time-Out */ |
---|
634 | #define INT1_vect_num 13 |
---|
635 | #define INT1_vect _VECTOR(13) /* External Interrupt 1 */ |
---|
636 | #define TIMER0_COMPA_vect_num 14 |
---|
637 | #define TIMER0_COMPA_vect _VECTOR(14) /* Timer/Counter0 Compare Match A */ |
---|
638 | #define TIMER0_COMPB_vect_num 15 |
---|
639 | #define TIMER0_COMPB_vect _VECTOR(15) /* Timer/Counter0 Compare Match B */ |
---|
640 | #define TIMER0_CAPT_vect_num 16 |
---|
641 | #define TIMER0_CAPT_vect _VECTOR(16) /* ADC Conversion Complete */ |
---|
642 | #define TIMER1_COMPD_vect_num 17 |
---|
643 | #define TIMER1_COMPD_vect _VECTOR(17) /* Timer/Counter1 Compare Match D */ |
---|
644 | #define FAULT_PROTECTION_vect_num 18 |
---|
645 | #define FAULT_PROTECTION_vect _VECTOR(18) /* Timer/Counter1 Fault Protection */ |
---|
646 | |
---|
647 | #define _VECTOR_SIZE 2 /* Size of individual vector. */ |
---|
648 | #define _VECTORS_SIZE (19 * _VECTOR_SIZE) |
---|
649 | |
---|
650 | |
---|
651 | /* Constants */ |
---|
652 | #define SPM_PAGESIZE (32) |
---|
653 | #define RAMSTART (0x60) |
---|
654 | #define RAMSIZE (128) |
---|
655 | #define RAMEND (RAMSTART + RAMSIZE - 1) |
---|
656 | #define XRAMSTART (NA) |
---|
657 | #define XRAMSIZE (0) |
---|
658 | #define XRAMEND (RAMEND) |
---|
659 | #define E2END (0x7F) |
---|
660 | #define E2PAGESIZE (4) |
---|
661 | #define FLASHEND (0x7FF) |
---|
662 | |
---|
663 | |
---|
664 | /* Fuses */ |
---|
665 | #define FUSE_MEMORY_SIZE 3 |
---|
666 | |
---|
667 | /* Low Fuse Byte */ |
---|
668 | #define FUSE_CKSEL0 (unsigned char)~_BV(0) /* Select Clock source */ |
---|
669 | #define FUSE_CKSEL1 (unsigned char)~_BV(1) /* Select Clock source */ |
---|
670 | #define FUSE_CKSEL2 (unsigned char)~_BV(2) /* Select Clock source */ |
---|
671 | #define FUSE_CKSEL3 (unsigned char)~_BV(3) /* Select Clock source */ |
---|
672 | #define FUSE_SUT0 (unsigned char)~_BV(4) /* Select start-up time */ |
---|
673 | #define FUSE_SUT1 (unsigned char)~_BV(5) /* Select start-up time */ |
---|
674 | #define FUSE_CKOUT (unsigned char)~_BV(6) /* Clock Output Enable */ |
---|
675 | #define FUSE_CKDIV8 (unsigned char)~_BV(7) /* Divide clock by 8 */ |
---|
676 | #define LFUSE_DEFAULT (FUSE_CKSEL0 & FUSE_CKSEL2 & FUSE_CKSEL3 & FUSE_SUT0 & FUSE_CKDIV8) |
---|
677 | |
---|
678 | /* High Fuse Byte */ |
---|
679 | #define FUSE_BODLEVEL0 (unsigned char)~_BV(0) /* Brown-out Detector trigger level */ |
---|
680 | #define FUSE_BODLEVEL1 (unsigned char)~_BV(1) /* Brown-out Detector trigger level */ |
---|
681 | #define FUSE_BODLEVEL2 (unsigned char)~_BV(2) /* Brown-out Detector trigger level */ |
---|
682 | #define FUSE_EESAVE (unsigned char)~_BV(3) /* EEPROM memory is preserved through the Chip Erase */ |
---|
683 | #define FUSE_WDTON (unsigned char)~_BV(4) /* Watchdog Timer always on */ |
---|
684 | #define FUSE_SPIEN (unsigned char)~_BV(5) /* Enable Serial Program and Data Downloading */ |
---|
685 | #define FUSE_DWEN (unsigned char)~_BV(6) /* DebugWIRE Enable */ |
---|
686 | #define FUSE_RSTDISBL (unsigned char)~_BV(7) /* External Reset disable */ |
---|
687 | #define HFUSE_DEFAULT (FUSE_SPIEN) |
---|
688 | |
---|
689 | /* Extended Fuse Byte */ |
---|
690 | #define FUSE_SELFPRGEN (unsigned char)~_BV(0) /* Self-Programming Enable */ |
---|
691 | #define EFUSE_DEFAULT (0xFF) |
---|
692 | |
---|
693 | |
---|
694 | /* Lock Bits */ |
---|
695 | #define __LOCK_BITS_EXIST |
---|
696 | |
---|
697 | |
---|
698 | /* Signature */ |
---|
699 | #define SIGNATURE_0 0x1E |
---|
700 | #define SIGNATURE_1 0x91 |
---|
701 | #define SIGNATURE_2 0x0C |
---|
702 | |
---|
703 | |
---|
704 | /* Device Pin Definitions */ |
---|
705 | #define DI_B_DDR DDRMOSI |
---|
706 | #define DI_B_PORT PORTMOSI |
---|
707 | #define DI_B_PIN PINMOSI |
---|
708 | #define DI_B_BIT MOSI |
---|
709 | |
---|
710 | #define SDA_B_DDR DDRMOSI |
---|
711 | #define SDA_B_PORT PORTMOSI |
---|
712 | #define SDA_B_PIN PINMOSI |
---|
713 | #define SDA_B_BIT MOSI |
---|
714 | |
---|
715 | #define _OC1A_DDR DDRMOSI |
---|
716 | #define _OC1A_PORT PORTMOSI |
---|
717 | #define _OC1A_PIN PINMOSI |
---|
718 | #define _OC1A_BIT MOSI |
---|
719 | |
---|
720 | #define PCINT8_DDR DDRMOSI |
---|
721 | #define PCINT8_PORT PORTMOSI |
---|
722 | #define PCINT8_PIN PINMOSI |
---|
723 | #define PCINT8_BIT MOSI |
---|
724 | |
---|
725 | #define PB0_DDR DDRMOSI |
---|
726 | #define PB0_PORT PORTMOSI |
---|
727 | #define PB0_PIN PINMOSI |
---|
728 | #define PB0_BIT MOSI |
---|
729 | |
---|
730 | #define DO_B_DDR DDRMISO |
---|
731 | #define DO_B_PORT PORTMISO |
---|
732 | #define DO_B_PIN PINMISO |
---|
733 | #define DO_B_BIT MISO |
---|
734 | |
---|
735 | #define OC1A_DDR DDRMISO |
---|
736 | #define OC1A_PORT PORTMISO |
---|
737 | #define OC1A_PIN PINMISO |
---|
738 | #define OC1A_BIT MISO |
---|
739 | |
---|
740 | #define PCINT9_DDR DDRMISO |
---|
741 | #define PCINT9_PORT PORTMISO |
---|
742 | #define PCINT9_PIN PINMISO |
---|
743 | #define PCINT9_BIT MISO |
---|
744 | |
---|
745 | #define PB1_DDR DDRMISO |
---|
746 | #define PB1_PORT PORTMISO |
---|
747 | #define PB1_PIN PINMISO |
---|
748 | #define PB1_BIT MISO |
---|
749 | |
---|
750 | #define USCK_B_DDR DDRSCK |
---|
751 | #define USCK_B_PORT PORTSCK |
---|
752 | #define USCK_B_PIN PINSCK |
---|
753 | #define USCK_B_BIT SCK |
---|
754 | |
---|
755 | #define SCL_B_DDR DDRSCK |
---|
756 | #define SCL_B_PORT PORTSCK |
---|
757 | #define SCL_B_PIN PINSCK |
---|
758 | #define SCL_B_BIT SCK |
---|
759 | |
---|
760 | #define OC1B_DDR DDRSCK |
---|
761 | #define OC1B_PORT PORTSCK |
---|
762 | #define OC1B_PIN PINSCK |
---|
763 | #define OC1B_BIT SCK |
---|
764 | |
---|
765 | #define PCINT10_DDR DDRSCK |
---|
766 | #define PCINT10_PORT PORTSCK |
---|
767 | #define PCINT10_PIN PINSCK |
---|
768 | #define PCINT10_BIT SCK |
---|
769 | |
---|
770 | #define PB2_DDR DDRSCK |
---|
771 | #define PB2_PORT PORTSCK |
---|
772 | #define PB2_PIN PINSCK |
---|
773 | #define PB2_BIT SCK |
---|
774 | |
---|
775 | #define PCINT11_DDR DDROC1B |
---|
776 | #define PCINT11_PORT PORTOC1B |
---|
777 | #define PCINT11_PIN PINOC1B |
---|
778 | #define PCINT11_BIT OC1B |
---|
779 | |
---|
780 | #define PB3_DDR DDROC1B |
---|
781 | #define PB3_PORT PORTOC1B |
---|
782 | #define PB3_PIN PINOC1B |
---|
783 | #define PB3_BIT OC1B |
---|
784 | |
---|
785 | #define PCINT12_DDR DDRADC |
---|
786 | #define PCINT12_PORT PORTADC |
---|
787 | #define PCINT12_PIN PINADC |
---|
788 | #define PCINT12_BIT ADC7 |
---|
789 | |
---|
790 | #define _OC1D_DDR DDRADC |
---|
791 | #define _OC1D_PORT PORTADC |
---|
792 | #define _OC1D_PIN PINADC |
---|
793 | #define _OC1D_BIT ADC7 |
---|
794 | |
---|
795 | #define CLKI_DDR DDRADC |
---|
796 | #define CLKI_PORT PORTADC |
---|
797 | #define CLKI_PIN PINADC |
---|
798 | #define CLKI_BIT ADC7 |
---|
799 | |
---|
800 | #define PB4_DDR DDRADC |
---|
801 | #define PB4_PORT PORTADC |
---|
802 | #define PB4_PIN PINADC |
---|
803 | #define PB4_BIT ADC7 |
---|
804 | |
---|
805 | #define PCINT13_DDR DDRADC |
---|
806 | #define PCINT13_PORT PORTADC |
---|
807 | #define PCINT13_PIN PINADC |
---|
808 | #define PCINT13_BIT ADC8 |
---|
809 | |
---|
810 | #define OC1D_DDR DDRADC |
---|
811 | #define OC1D_PORT PORTADC |
---|
812 | #define OC1D_PIN PINADC |
---|
813 | #define OC1D_BIT ADC8 |
---|
814 | |
---|
815 | #define CKLO_DDR DDRADC |
---|
816 | #define CKLO_PORT PORTADC |
---|
817 | #define CKLO_PIN PINADC |
---|
818 | #define CKLO_BIT ADC8 |
---|
819 | |
---|
820 | #define PB5_DDR DDRADC |
---|
821 | #define PB5_PORT PORTADC |
---|
822 | #define PB5_PIN PINADC |
---|
823 | #define PB5_BIT ADC8 |
---|
824 | |
---|
825 | #define INT0_DDR DDRADC |
---|
826 | #define INT0_PORT PORTADC |
---|
827 | #define INT0_PIN PINADC |
---|
828 | #define INT0_BIT ADC9 |
---|
829 | |
---|
830 | #define T0_DDR DDRADC |
---|
831 | #define T0_PORT PORTADC |
---|
832 | #define T0_PIN PINADC |
---|
833 | #define T0_BIT ADC9 |
---|
834 | |
---|
835 | #define PCINT14_DDR DDRADC |
---|
836 | #define PCINT14_PORT PORTADC |
---|
837 | #define PCINT14_PIN PINADC |
---|
838 | #define PCINT14_BIT ADC9 |
---|
839 | |
---|
840 | #define PB6_DDR DDRADC |
---|
841 | #define PB6_PORT PORTADC |
---|
842 | #define PB6_PIN PINADC |
---|
843 | #define PB6_BIT ADC9 |
---|
844 | |
---|
845 | #define PCINT15_DDR DDRADC1 |
---|
846 | #define PCINT15_PORT PORTADC1 |
---|
847 | #define PCINT15_PIN PINADC1 |
---|
848 | #define PCINT15_BIT ADC10 |
---|
849 | |
---|
850 | #define PB7_DDR DDRADC1 |
---|
851 | #define PB7_PORT PORTADC1 |
---|
852 | #define PB7_PIN PINADC1 |
---|
853 | #define PB7_BIT ADC10 |
---|
854 | |
---|
855 | #define AIN1_DDR DDRADC |
---|
856 | #define AIN1_PORT PORTADC |
---|
857 | #define AIN1_PIN PINADC |
---|
858 | #define AIN1_BIT ADC6 |
---|
859 | |
---|
860 | #define PCINT7_DDR DDRADC |
---|
861 | #define PCINT7_PORT PORTADC |
---|
862 | #define PCINT7_PIN PINADC |
---|
863 | #define PCINT7_BIT ADC6 |
---|
864 | |
---|
865 | #define PA7_DDR DDRADC |
---|
866 | #define PA7_PORT PORTADC |
---|
867 | #define PA7_PIN PINADC |
---|
868 | #define PA7_BIT ADC6 |
---|
869 | |
---|
870 | #define AIN0_DDR DDRADC |
---|
871 | #define AIN0_PORT PORTADC |
---|
872 | #define AIN0_PIN PINADC |
---|
873 | #define AIN0_BIT ADC5 |
---|
874 | |
---|
875 | #define PCINT6_DDR DDRADC |
---|
876 | #define PCINT6_PORT PORTADC |
---|
877 | #define PCINT6_PIN PINADC |
---|
878 | #define PCINT6_BIT ADC5 |
---|
879 | |
---|
880 | #define PA6_DDR DDRADC |
---|
881 | #define PA6_PORT PORTADC |
---|
882 | #define PA6_PIN PINADC |
---|
883 | #define PA6_BIT ADC5 |
---|
884 | |
---|
885 | #define AIN2_DDR DDRADC |
---|
886 | #define AIN2_PORT PORTADC |
---|
887 | #define AIN2_PIN PINADC |
---|
888 | #define AIN2_BIT ADC4 |
---|
889 | |
---|
890 | #define PCINT5_DDR DDRADC |
---|
891 | #define PCINT5_PORT PORTADC |
---|
892 | #define PCINT5_PIN PINADC |
---|
893 | #define PCINT5_BIT ADC4 |
---|
894 | |
---|
895 | #define PA5_DDR DDRADC |
---|
896 | #define PA5_PORT PORTADC |
---|
897 | #define PA5_PIN PINADC |
---|
898 | #define PA5_BIT ADC4 |
---|
899 | |
---|
900 | #define ICP0_DDR DDRADC |
---|
901 | #define ICP0_PORT PORTADC |
---|
902 | #define ICP0_PIN PINADC |
---|
903 | #define ICP0_BIT ADC3 |
---|
904 | |
---|
905 | #define PCINT4_DDR DDRADC |
---|
906 | #define PCINT4_PORT PORTADC |
---|
907 | #define PCINT4_PIN PINADC |
---|
908 | #define PCINT4_BIT ADC3 |
---|
909 | |
---|
910 | #define PA4_DDR DDRADC |
---|
911 | #define PA4_PORT PORTADC |
---|
912 | #define PA4_PIN PINADC |
---|
913 | #define PA4_BIT ADC3 |
---|
914 | |
---|
915 | #define PCINT3_DDR DDRAREF |
---|
916 | #define PCINT3_PORT PORTAREF |
---|
917 | #define PCINT3_PIN PINAREF |
---|
918 | #define PCINT3_BIT AREF |
---|
919 | |
---|
920 | #define PA3_DDR DDRAREF |
---|
921 | #define PA3_PORT PORTAREF |
---|
922 | #define PA3_PIN PINAREF |
---|
923 | #define PA3_BIT AREF |
---|
924 | |
---|
925 | #define INT1_DDR DDRADC |
---|
926 | #define INT1_PORT PORTADC |
---|
927 | #define INT1_PIN PINADC |
---|
928 | #define INT1_BIT ADC2 |
---|
929 | |
---|
930 | #define USCK_A_DDR DDRADC |
---|
931 | #define USCK_A_PORT PORTADC |
---|
932 | #define USCK_A_PIN PINADC |
---|
933 | #define USCK_A_BIT ADC2 |
---|
934 | |
---|
935 | #define SCL_A_DDR DDRADC |
---|
936 | #define SCL_A_PORT PORTADC |
---|
937 | #define SCL_A_PIN PINADC |
---|
938 | #define SCL_A_BIT ADC2 |
---|
939 | |
---|
940 | #define PCINT2_DDR DDRADC |
---|
941 | #define PCINT2_PORT PORTADC |
---|
942 | #define PCINT2_PIN PINADC |
---|
943 | #define PCINT2_BIT ADC2 |
---|
944 | |
---|
945 | #define PA2_DDR DDRADC |
---|
946 | #define PA2_PORT PORTADC |
---|
947 | #define PA2_PIN PINADC |
---|
948 | #define PA2_BIT ADC2 |
---|
949 | |
---|
950 | #define DO_A_DDR DDRADC |
---|
951 | #define DO_A_PORT PORTADC |
---|
952 | #define DO_A_PIN PINADC |
---|
953 | #define DO_A_BIT ADC1 |
---|
954 | |
---|
955 | #define PCINT1_DDR DDRADC |
---|
956 | #define PCINT1_PORT PORTADC |
---|
957 | #define PCINT1_PIN PINADC |
---|
958 | #define PCINT1_BIT ADC1 |
---|
959 | |
---|
960 | #define PA1_DDR DDRADC |
---|
961 | #define PA1_PORT PORTADC |
---|
962 | #define PA1_PIN PINADC |
---|
963 | #define PA1_BIT ADC1 |
---|
964 | |
---|
965 | #define DI_A_DDR DDRADC |
---|
966 | #define DI_A_PORT PORTADC |
---|
967 | #define DI_A_PIN PINADC |
---|
968 | #define DI_A_BIT ADC0 |
---|
969 | |
---|
970 | #define SDA_A_DDR DDRADC |
---|
971 | #define SDA_A_PORT PORTADC |
---|
972 | #define SDA_A_PIN PINADC |
---|
973 | #define SDA_A_BIT ADC0 |
---|
974 | |
---|
975 | #define PCINT0_DDR DDRADC |
---|
976 | #define PCINT0_PORT PORTADC |
---|
977 | #define PCINT0_PIN PINADC |
---|
978 | #define PCINT0_BIT ADC0 |
---|
979 | |
---|
980 | #define PA0_DDR DDRADC |
---|
981 | #define PA0_PORT PORTADC |
---|
982 | #define PA0_PIN PINADC |
---|
983 | #define PA0_BIT ADC0 |
---|
984 | |
---|
985 | /**@}*/ |
---|
986 | #endif /* _AVR_ATtiny261A_H_ */ |
---|