1
/* Copyright (c) 2009 Atmel Corporation
4
Redistribution and use in source and binary forms, with or without
5
modification, are permitted provided that the following conditions are met:
7
* Redistributions of source code must retain the above copyright
8
notice, this list of conditions and the following disclaimer.
10
* Redistributions in binary form must reproduce the above copyright
11
notice, this list of conditions and the following disclaimer in
12
the documentation and/or other materials provided with the
15
* Neither the name of the copyright holders nor the names of
16
contributors may be used to endorse or promote products derived
17
from this software without specific prior written permission.
19
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29
POSSIBILITY OF SUCH DAMAGE. */
31
/* $Id: io90scr100.h 1910 2009-03-04 17:45:30Z arcanum $ */
33
/* avr/io90scr100.h - definitions for AT90SCR100 */
35
/* This file should only be included from <avr/io.h>, never directly. */
38
# error "Include <avr/io.h> instead of this file."
42
# define _AVR_IOXXX_H_ "io90scr100.h"
44
# error "Attempt to include more than one <avr/ioXXX.h> file."
48
#ifndef _AVR_AT90SCR100_H_
49
#define _AVR_AT90SCR100_H_ 1
52
/* Registers and associated bit numbers. */
54
#define PINA _SFR_IO8(0x00)
64
#define DDRA _SFR_IO8(0x01)
74
#define PORTA _SFR_IO8(0x02)
84
#define PINB _SFR_IO8(0x03)
94
#define DDRB _SFR_IO8(0x04)
104
#define PORTB _SFR_IO8(0x05)
114
#define PINC _SFR_IO8(0x06)
124
#define DDRC _SFR_IO8(0x07)
134
#define PORTC _SFR_IO8(0x08)
144
#define PIND _SFR_IO8(0x09)
154
#define DDRD _SFR_IO8(0x0A)
164
#define PORTD _SFR_IO8(0x0B)
174
#define PINE _SFR_IO8(0x0C)
184
#define DDRE _SFR_IO8(0x0D)
194
#define PORTE _SFR_IO8(0x0E)
204
#define TIFR0 _SFR_IO8(0x15)
209
#define TIFR1 _SFR_IO8(0x16)
215
#define TIFR2 _SFR_IO8(0x17)
220
#define EIRR _SFR_IO8(0x1A)
224
#define PCIFR _SFR_IO8(0x1B)
230
#define EIFR _SFR_IO8(0x1C)
236
#define EIMSK _SFR_IO8(0x1D)
242
#define GPIOR0 _SFR_IO8(0x1E)
252
#define EECR _SFR_IO8(0x1F)
260
#define EEDR _SFR_IO8(0x20)
270
#define EEAR _SFR_IO16(0x21)
272
#define EEARL _SFR_IO8(0x21)
282
#define EEARH _SFR_IO8(0x22)
288
#define GTCCR _SFR_IO8(0x23)
293
#define TCCR0A _SFR_IO8(0x24)
301
#define TCCR0B _SFR_IO8(0x25)
309
#define TCNT0 _SFR_IO8(0x26)
319
#define OCR0A _SFR_IO8(0x27)
329
#define OCR0B _SFR_IO8(0x28)
339
#define GPIOR1 _SFR_IO8(0x2A)
349
#define GPIOR2 _SFR_IO8(0x2B)
359
#define SPCR _SFR_IO8(0x2C)
369
#define SPSR _SFR_IO8(0x2D)
374
#define SPDR _SFR_IO8(0x2E)
384
#define OCDR _SFR_IO8(0x31)
394
#define SMCR _SFR_IO8(0x33)
400
#define MCUSR _SFR_IO8(0x34)
407
#define MCUCR _SFR_IO8(0x35)
415
#define SPMCSR _SFR_IO8(0x37)
425
#define RAMPZ _SFR_IO8(0x3B)
428
#define WDTCSR _SFR_MEM8(0x60)
438
#define CLKPR _SFR_MEM8(0x61)
445
#define PLLCR _SFR_MEM8(0x62)
450
#define SMONCR _SFR_MEM8(0x63)
455
#define PRR0 _SFR_MEM8(0x64)
463
#define PRR1 _SFR_MEM8(0x65)
471
#define OSCCAL _SFR_MEM8(0x66)
481
#define PCICR _SFR_MEM8(0x68)
487
#define EICRA _SFR_MEM8(0x69)
497
#define PCMSK0 _SFR_MEM8(0x6B)
507
#define PCMSK1 _SFR_MEM8(0x6C)
517
#define PCMSK2 _SFR_MEM8(0x6D)
527
#define TIMSK0 _SFR_MEM8(0x6E)
532
#define TIMSK1 _SFR_MEM8(0x6F)
538
#define TIMSK2 _SFR_MEM8(0x70)
543
#define PCMSK3 _SFR_MEM8(0x73)
545
#define LEDCR _SFR_MEM8(0x75)
555
#define AESCR _SFR_MEM8(0x78)
564
#define AESACR _SFR_MEM8(0x79)
570
#define AESADDR _SFR_MEM8(0x7A)
580
#define AESDR _SFR_MEM8(0x7B)
590
#define TCCR1A _SFR_MEM8(0x80)
598
#define TCCR1B _SFR_MEM8(0x81)
607
#define TCCR1C _SFR_MEM8(0x82)
611
#define TCNT1 _SFR_MEM16(0x84)
613
#define TCNT1L _SFR_MEM8(0x84)
623
#define TCNT1H _SFR_MEM8(0x85)
633
#define ICR1 _SFR_MEM16(0x86)
635
#define ICR1L _SFR_MEM8(0x86)
645
#define ICR1H _SFR_MEM8(0x87)
655
#define OCR1A _SFR_MEM16(0x88)
657
#define OCR1AL _SFR_MEM8(0x88)
667
#define OCR1AH _SFR_MEM8(0x89)
677
#define OCR1B _SFR_MEM16(0x8A)
679
#define OCR1BL _SFR_MEM8(0x8A)
689
#define OCR1BH _SFR_MEM8(0x8B)
699
#define KBLSR _SFR_MEM8(0x8D)
709
#define KBER _SFR_MEM8(0x8E)
719
#define KBFR _SFR_MEM8(0x8F)
729
#define RDWDR _SFR_MEM8(0x90)
739
#define LFSR0 _SFR_MEM8(0x91)
749
#define LFSR1 _SFR_MEM8(0x92)
759
#define LFSR2 _SFR_MEM8(0x93)
769
#define LFSR3 _SFR_MEM8(0x94)
779
#define RNGCR _SFR_MEM8(0x95)
782
#define UHSR _SFR_MEM8(0x99)
785
#define UPINT _SFR_MEM8(0x9A)
791
#define UPBCX _SFR_MEM16(0x9B)
793
#define UPBCXL _SFR_MEM8(0x9B)
803
#define UPBCXH _SFR_MEM8(0x9C)
808
#define UPERRX _SFR_MEM8(0x9D)
817
#define UHCR _SFR_MEM8(0x9E)
826
#define UHINT _SFR_MEM8(0x9F)
835
#define UHIEN _SFR_MEM8(0xA0)
844
#define UHADDR _SFR_MEM8(0xA1)
853
#define UHFNUM _SFR_MEM16(0xA2)
855
#define UHFNUML _SFR_MEM8(0xA2)
865
#define UHFNUMH _SFR_MEM8(0xA3)
870
#define UHFLEN _SFR_MEM8(0xA4)
880
#define UPINRQX _SFR_MEM8(0xA5)
890
#define UPINTX _SFR_MEM8(0xA6)
900
#define UPNUM _SFR_MEM8(0xA7)
904
#define UPRST _SFR_MEM8(0xA8)
910
#define UPCRX _SFR_MEM8(0xA9)
916
#define UPCFG0X _SFR_MEM8(0xAA)
926
#define UPCFG1X _SFR_MEM8(0xAB)
934
#define UPSTAX _SFR_MEM8(0xAC)
943
#define UPCFG2X _SFR_MEM8(0xAD)
953
#define UPIENX _SFR_MEM8(0xAE)
962
#define UPDATX _SFR_MEM8(0xAF)
972
#define TCCR2A _SFR_MEM8(0xB0)
980
#define TCCR2B _SFR_MEM8(0xB1)
988
#define TCNT2 _SFR_MEM8(0xB2)
998
#define OCR2A _SFR_MEM8(0xB3)
1008
#define OCR2B _SFR_MEM8(0xB4)
1018
#define ASSR _SFR_MEM8(0xB6)
1027
#define TWBR _SFR_MEM8(0xB8)
1037
#define TWSR _SFR_MEM8(0xB9)
1046
#define TWAR _SFR_MEM8(0xBA)
1056
#define TWDR _SFR_MEM8(0xBB)
1066
#define TWCR _SFR_MEM8(0xBC)
1075
#define TWAMR _SFR_MEM8(0xBD)
1084
#define UCSR0A _SFR_MEM8(0xC0)
1094
#define UCSR0B _SFR_MEM8(0xC1)
1104
#define UCSR0C _SFR_MEM8(0xC2)
1114
#define UBRR0 _SFR_MEM16(0xC4)
1116
#define UBRR0L _SFR_MEM8(0xC4)
1126
#define UBRR0H _SFR_MEM8(0xC5)
1132
#define UDR0 _SFR_MEM8(0xC6)
1142
#define USBENUM _SFR_MEM8(0xCA)
1147
#define USBCSEX _SFR_MEM8(0xCB)
1156
#define USBDBCEX _SFR_MEM8(0xCC)
1166
#define USBFCEX _SFR_MEM8(0xCD)
1172
#define HSSPITO _SFR_MEM16(0xD1)
1174
#define HSSPITOL _SFR_MEM8(0xD1)
1184
#define HSSPITOH _SFR_MEM8(0xD2)
1187
#define HSSPITOD10 2
1188
#define HSSPITOD11 3
1189
#define HSSPITOD12 4
1190
#define HSSPITOD13 5
1191
#define HSSPITOD14 6
1192
#define HSSPITOD15 7
1194
#define HSSPICNT _SFR_MEM8(0xD3)
1195
#define HSSPICNTD0 0
1196
#define HSSPICNTD1 1
1197
#define HSSPICNTD2 2
1198
#define HSSPICNTD3 3
1199
#define HSSPICNTD4 4
1201
#define HSSPIIER _SFR_MEM8(0xD4)
1207
#define HSSPIGTR _SFR_MEM8(0xD5)
1217
#define HSSPIRDR _SFR_MEM8(0xD6)
1227
#define HSSPITDR _SFR_MEM8(0xD7)
1237
#define HSSPISR _SFR_MEM8(0xD8)
1244
#define HSSPICFG _SFR_MEM8(0xD9)
1254
#define HSSPIIR _SFR_MEM8(0xDA)
1261
#define HSSPICR _SFR_MEM8(0xDB)
1266
#define HSSPIDMACS _SFR_MEM8(0xDC)
1268
#define HSSPIDMADIR 1
1269
#define HSSPIDMAERR 2
1271
#define HSSPIDMAD _SFR_MEM16(0xDD)
1273
#define HSSPIDMADL _SFR_MEM8(0xDD)
1274
#define HSSPIDMAD0 0
1275
#define HSSPIDMAD1 1
1276
#define HSSPIDMAD2 2
1277
#define HSSPIDMAD3 3
1278
#define HSSPIDMAD4 4
1279
#define HSSPIDMAD5 5
1280
#define HSSPIDMAD6 6
1281
#define HSSPIDMAD7 7
1283
#define HSSPIDMADH _SFR_MEM8(0xDE)
1284
#define HSSPIDMAD8 0
1285
#define HSSPIDMAD9 1
1286
#define HSSPIDMAD10 2
1287
#define HSSPIDMAD11 3
1288
#define HSSPIDMAD12 4
1289
#define HSSPIDMAD13 5
1291
#define HSSPIDMAB _SFR_MEM8(0xDF)
1292
#define HSSPIDMAB0 0
1293
#define HSSPIDMAB1 1
1294
#define HSSPIDMAB2 2
1295
#define HSSPIDMAB3 3
1296
#define HSSPIDMAB4 4
1298
#define USBCR _SFR_MEM8(0xE0)
1303
#define USBPI _SFR_MEM8(0xE1)
1310
#define USBPIM _SFR_MEM8(0xE2)
1316
#define USBEI _SFR_MEM8(0xE3)
1326
#define USBEIM _SFR_MEM8(0xE4)
1336
#define USBRSTE _SFR_MEM8(0xE5)
1346
#define USBGS _SFR_MEM8(0xE6)
1352
#define USBFA _SFR_MEM8(0xE7)
1361
#define USBFN _SFR_MEM16(0xE8)
1363
#define USBFNL _SFR_MEM8(0xE8)
1373
#define USBFNH _SFR_MEM8(0xE9)
1380
#define USBDMACS _SFR_MEM8(0xEA)
1388
#define USBDMAD _SFR_MEM16(0xEB)
1390
#define USBDMADL _SFR_MEM8(0xEB)
1400
#define USBDMADH _SFR_MEM8(0xEC)
1408
#define USBDMAB _SFR_MEM8(0xED)
1417
#define DCCR _SFR_MEM8(0xEF)
1422
#define SCICLK _SFR_MEM8(0xF0)
1430
#define SCWT0 _SFR_MEM8(0xF1)
1440
#define SCWT1 _SFR_MEM8(0xF2)
1450
#define SCWT2 _SFR_MEM8(0xF3)
1460
#define SCWT3 _SFR_MEM8(0xF4)
1470
#define SCGT _SFR_MEM16(0xF5)
1472
#define SCGTL _SFR_MEM8(0xF5)
1482
#define SCGTH _SFR_MEM8(0xF6)
1485
#define SCETU _SFR_MEM16(0xF7)
1487
#define SCETUL _SFR_MEM8(0xF7)
1497
#define SCETUH _SFR_MEM8(0xF8)
1503
#define SCIBUF _SFR_MEM8(0xF9)
1513
#define SCSR _SFR_MEM8(0xFA)
1518
#define SCIER _SFR_MEM8(0xFB)
1527
#define SCIIR _SFR_MEM8(0xFC)
1535
#define SCISR _SFR_MEM8(0xFD)
1544
#define SCCON _SFR_MEM8(0xFE)
1553
#define SCICR _SFR_MEM8(0xFF)
1564
/* Interrupt vectors */
1565
/* Vector 0 is the reset vector */
1566
#define INT0_vect_num 1
1567
#define INT0_vect _VECTOR(1) /* External Interrupt Request 0 */
1568
#define INT1_vect_num 2
1569
#define INT1_vect _VECTOR(2) /* External Interrupt Request 1 */
1570
#define INT2_vect_num 3
1571
#define INT2_vect _VECTOR(3) /* External Interrupt Request 2 */
1572
#define INT3_vect_num 4
1573
#define INT3_vect _VECTOR(4) /* External Interrupt Request 3 */
1574
#define PCINT0_vect_num 5
1575
#define PCINT0_vect _VECTOR(5) /* Pin Change Interrupt Request 0 */
1576
#define PCINT1_vect_num 6
1577
#define PCINT1_vect _VECTOR(6) /* Pin Change Interrupt Request 1 */
1578
#define PCINT2_vect_num 7
1579
#define PCINT2_vect _VECTOR(7) /* Pin Change Interrupt Request 2 */
1580
#define WDT_vect_num 8
1581
#define WDT_vect _VECTOR(8) /* Watchdog Time-out Interrupt */
1582
#define TIMER2_COMPA_vect_num 9
1583
#define TIMER2_COMPA_vect _VECTOR(9) /* Timer/Counter2 Compare Match A */
1584
#define TIMER2_COMPB_vect_num 10
1585
#define TIMER2_COMPB_vect _VECTOR(10) /* Timer/Counter2 Compare Match B */
1586
#define TIMER2_OVF_vect_num 11
1587
#define TIMER2_OVF_vect _VECTOR(11) /* Timer/Counter2 Overflow */
1588
#define TIMER1_CAPT_vect_num 12
1589
#define TIMER1_CAPT_vect _VECTOR(12) /* Timer/Counter1 Capture Event */
1590
#define TIMER1_COMPA_vect_num 13
1591
#define TIMER1_COMPA_vect _VECTOR(13) /* Timer/Counter1 Compare Match A */
1592
#define TIMER1_COMPB_vect_num 14
1593
#define TIMER1_COMPB_vect _VECTOR(14) /* Timer/Counter1 Compare Match B */
1594
#define TIMER1_OVF_vect_num 15
1595
#define TIMER1_OVF_vect _VECTOR(15) /* Timer/Counter1 Overflow */
1596
#define TIMER0_COMPA_vect_num 16
1597
#define TIMER0_COMPA_vect _VECTOR(16) /* Timer/Counter0 Compare Match A */
1598
#define TIMER0_COMPB_vect_num 17
1599
#define TIMER0_COMPB_vect _VECTOR(17) /* Timer/Counter0 Compare Match B */
1600
#define TIMER0_OVF_vect_num 18
1601
#define TIMER0_OVF_vect _VECTOR(18) /* Timer/Counter0 Overflow */
1602
#define SPI_STC_vect_num 19
1603
#define SPI_STC_vect _VECTOR(19) /* SPI Serial Transfer Complete */
1604
#define USART0_RX_vect_num 20
1605
#define USART0_RX_vect _VECTOR(20) /* USART0, Rx Complete */
1606
#define USART0_UDRE_vect_num 21
1607
#define USART0_UDRE_vect _VECTOR(21) /* USART0 Data register Empty */
1608
#define USART0_TX_vect_num 22
1609
#define USART0_TX_vect _VECTOR(22) /* USART0, Tx Complete */
1610
#define SUPPLY_MON_vect_num 23
1611
#define SUPPLY_MON_vect _VECTOR(23) /* Supply Monitor Interruption */
1612
#define RFU_vect_num 24
1613
#define RFU_vect _VECTOR(24) /* Reserved for Future Use */
1614
#define EE_READY_vect_num 25
1615
#define EE_READY_vect _VECTOR(25) /* EEPROM Ready */
1616
#define TWI_vect_num 26
1617
#define TWI_vect _VECTOR(26) /* 2-wire Serial Interface */
1618
#define SPM_READY_vect_num 27
1619
#define SPM_READY_vect _VECTOR(27) /* Store Program Memory Read */
1620
#define KEYBOARD_vect_num 28
1621
#define KEYBOARD_vect _VECTOR(28) /* Keyboard Input Changed */
1622
#define AES_Operation_vect_num 29
1623
#define AES_Operation_vect _VECTOR(29) /* AES Block Operation Ended */
1624
#define HSSPI_vect_num 30
1625
#define HSSPI_vect _VECTOR(30) /* High-Speed SPI Interruption */
1626
#define USB_Endpoint_vect_num 31
1627
#define USB_Endpoint_vect _VECTOR(31) /* USB Endpoint Related Interruption */
1628
#define USB_Protocol_vect_num 32
1629
#define USB_Protocol_vect _VECTOR(32) /* USB Protocol Related Interruption */
1630
#define SCIB_vect_num 33
1631
#define SCIB_vect _VECTOR(33) /* Smart Card Reader Interface */
1632
#define USBHost_Control_vect_num 34
1633
#define USBHost_Control_vect _VECTOR(34) /* USB Host Controller Interrupt */
1634
#define USBHost_Pipe_vect_num 35
1635
#define USBHost_Pipe_vect _VECTOR(35) /* USB Host Pipe Interrupt */
1636
#define CPRES_vect_num 36
1637
#define CPRES_vect _VECTOR(36) /* Card Presence Detection */
1638
#define PCINT3_vect_num 37
1639
#define PCINT3_vect _VECTOR(37) /* Pin Change Interrupt Request 3 */
1641
#define _VECTOR_SIZE 4 /* Size of individual vector. */
1642
#define _VECTORS_SIZE (38 * _VECTOR_SIZE)
1646
#define SPM_PAGESIZE (256)
1647
#define RAMSTART (0x100)
1648
#define RAMSIZE (4096)
1649
#define RAMEND (RAMSTART + RAMSIZE - 1)
1650
#define XRAMSTART (0x0)
1651
#define XRAMSIZE (0)
1652
#define XRAMEND (RAMEND)
1653
#define E2END (0x7FF)
1654
#define E2PAGESIZE (4)
1655
#define FLASHEND (0xFFFF)
1659
#define FUSE_MEMORY_SIZE 3
1662
#define FUSE_CKSEL0 (unsigned char)~_BV(0) /* Clock Selection */
1663
#define FUSE_CKSEL3 (unsigned char)~_BV(3) /* Clock Selection */
1664
#define FUSE_SUT0 (unsigned char)~_BV(4) /* Select start-up time */
1665
#define FUSE_SUT1 (unsigned char)~_BV(5) /* Select start-up time */
1666
#define FUSE_CKOUT (unsigned char)~_BV(6) /* Clock output */
1667
#define LFUSE_DEFAULT (FUSE_SUT0)
1669
/* High Fuse Byte */
1670
#define FUSE_BOOTRST (unsigned char)~_BV(0) /* Select Reset Vector */
1671
#define FUSE_BOOTSZ0 (unsigned char)~_BV(1) /* Select Boot Size */
1672
#define FUSE_BOOTSZ1 (unsigned char)~_BV(2) /* Select Boot Size */
1673
#define FUSE_EESAVE (unsigned char)~_BV(3) /* EEPROM memory is preserved through chip erase */
1674
#define FUSE_WDTON (unsigned char)~_BV(4) /* Watchdog timer always on */
1675
#define FUSE_SPIEN (unsigned char)~_BV(5) /* Enable Serial programming and Data Downloading */
1676
#define FUSE_JTAGEN (unsigned char)~_BV(6) /* Enable JTAG */
1677
#define FUSE_OCDEN (unsigned char)~_BV(7) /* Enable OCD */
1678
#define HFUSE_DEFAULT (FUSE_JTAGEN & FUSE_SPIEN & FUSE_BOOTSZ1 & FUSE_BOOTSZ0)
1680
/* Extended Fuse Byte */
1681
#define FUSE_BODENABLE (unsigned char)~_BV(0) /* Brown-out Detector Enable Signal */
1682
#define EFUSE_DEFAULT (0xFF)
1686
#define __LOCK_BITS_EXIST
1687
#define __BOOT_LOCK_BITS_0_EXIST
1688
#define __BOOT_LOCK_BITS_1_EXIST
1692
#define SIGNATURE_0 0x1E
1693
#define SIGNATURE_1 0x96
1694
#define SIGNATURE_2 0xC1
1697
#endif /* _AVR_AT90SCR100_H_ */