~ubuntu-branches/ubuntu/dapper/avr-libc/dapper

« back to all changes in this revision

Viewing changes to include/avr/iotn11.h

  • Committer: Bazaar Package Importer
  • Author(s): Hakan Ardo
  • Date: 2005-03-19 11:16:14 UTC
  • mfrom: (1.1.1 upstream) (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050319111614-4g01s2ftv5x5nxf3
Tags: 1:1.2.3-3
* Added build depends on netpbm
* Added build depends on tetex-extra

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (c) 2002, Marek Michalkiewicz
 
2
   All rights reserved.
 
3
 
 
4
   Redistribution and use in source and binary forms, with or without
 
5
   modification, are permitted provided that the following conditions are met:
 
6
 
 
7
   * Redistributions of source code must retain the above copyright
 
8
     notice, this list of conditions and the following disclaimer.
 
9
 
 
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
 
13
     distribution.
 
14
 
 
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.
 
18
 
 
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. */
 
30
 
 
31
/* $Id: iotn11.h,v 1.5 2004/11/01 22:23:56 arcanum Exp $ */
 
32
 
 
33
/* avr/iotn11.h - definitions for ATtiny10/11 */
 
34
 
 
35
#ifndef _AVR_IOTN11_H_
 
36
#define _AVR_IOTN11_H_ 1
 
37
 
 
38
/* This file should only be included from <avr/io.h>, never directly. */
 
39
 
 
40
#ifndef _AVR_IO_H_
 
41
#  error "Include <avr/io.h> instead of this file."
 
42
#endif
 
43
 
 
44
#ifndef _AVR_IOXXX_H_
 
45
#  define _AVR_IOXXX_H_ "iotn11.h"
 
46
#else
 
47
#  error "Attempt to include more than one <avr/ioXXX.h> file."
 
48
#endif 
 
49
 
 
50
#ifndef __ASSEMBLER__
 
51
#  warning "MCU not supported by the C compiler"
 
52
#endif
 
53
 
 
54
/* I/O registers */
 
55
 
 
56
/* 0x00..0x07 reserved */
 
57
 
 
58
/* Analog Comparator Control and Status Register */
 
59
#define ACSR    _SFR_IO8(0x08)
 
60
 
 
61
/* 0x09..0x15 reserved */
 
62
 
 
63
/* Input Pins, Port B */
 
64
#define PINB    _SFR_IO8(0x16)
 
65
 
 
66
/* Data Direction Register, Port B */
 
67
#define DDRB    _SFR_IO8(0x17)
 
68
 
 
69
/* Data Register, Port B */
 
70
#define PORTB   _SFR_IO8(0x18)
 
71
 
 
72
/* 0x19..0x20 reserved */
 
73
 
 
74
/* Watchdog Timer Control Register */
 
75
#define WDTCR   _SFR_IO8(0x21)
 
76
 
 
77
/* 0x22..0x31 reserved */
 
78
 
 
79
/* Timer/Counter0 (8-bit) */
 
80
#define TCNT0   _SFR_IO8(0x32)
 
81
 
 
82
/* Timer/Counter0 Control Register */
 
83
#define TCCR0   _SFR_IO8(0x33)
 
84
 
 
85
/* MCU general Status Register */
 
86
#define MCUSR   _SFR_IO8(0x34)
 
87
 
 
88
/* MCU general Control Register */
 
89
#define MCUCR   _SFR_IO8(0x35)
 
90
 
 
91
/* 0x36..0x37 reserved */
 
92
 
 
93
/* Timer/Counter Interrupt Flag Register */
 
94
#define TIFR    _SFR_IO8(0x38)
 
95
 
 
96
/* Timer/Counter Interrupt MaSK Register */
 
97
#define TIMSK   _SFR_IO8(0x39)
 
98
 
 
99
/* General Interrupt Flag Register */
 
100
#define GIFR    _SFR_IO8(0x3A)
 
101
 
 
102
/* General Interrupt MaSK register */
 
103
#define GIMSK   _SFR_IO8(0x3B)
 
104
 
 
105
/* 0x3C..0x3E reserved */
 
106
 
 
107
/* 0x3F SREG */
 
108
 
 
109
/* Interrupt vectors */
 
110
 
 
111
#define SIG_INTERRUPT0          _VECTOR(1)
 
112
#define SIG_PIN                 _VECTOR(2)
 
113
#define SIG_OVERFLOW0           _VECTOR(3)
 
114
#define SIG_COMPARATOR          _VECTOR(4)
 
115
 
 
116
#define _VECTORS_SIZE 10
 
117
 
 
118
/* Bit numbers */
 
119
 
 
120
/* GIMSK */
 
121
#define INT0    6
 
122
#define PCIE    5
 
123
 
 
124
/* GIFR */
 
125
#define INTF0   6
 
126
#define PCIF    5
 
127
 
 
128
/* TIMSK */
 
129
#define TOIE0   1
 
130
 
 
131
/* TIFR */
 
132
#define TOV0    1
 
133
 
 
134
/* MCUCR */
 
135
#define SE      5
 
136
#define SM      4
 
137
#define ISC01   1
 
138
#define ISC00   0
 
139
 
 
140
/* TCCR0 */
 
141
#define CS02    2
 
142
#define CS01    1
 
143
#define CS00    0
 
144
 
 
145
/* WDTCR */
 
146
#define WDTOE   4
 
147
#define WDE     3
 
148
#define WDP2    2
 
149
#define WDP1    1
 
150
#define WDP0    0
 
151
 
 
152
/*
 
153
   PB5 = RESET#
 
154
   PB4 = XTAL2
 
155
   PB3 = XTAL1
 
156
   PB2 = T0
 
157
   PB1 = INT0 / AIN1
 
158
   PB0 = AIN0
 
159
 */
 
160
 
 
161
/* PORTB */
 
162
#define PB4     4
 
163
#define PB3     3
 
164
#define PB2     2
 
165
#define PB1     1
 
166
#define PB0     0
 
167
 
 
168
/* DDRB */
 
169
#define DDB4    4
 
170
#define DDB3    3
 
171
#define DDB2    2
 
172
#define DDB1    1
 
173
#define DDB0    0
 
174
 
 
175
/* PINB */
 
176
#define PINB5   5
 
177
#define PINB4   4
 
178
#define PINB3   3
 
179
#define PINB2   2
 
180
#define PINB1   1
 
181
#define PINB0   0
 
182
 
 
183
/* ACSR */
 
184
#define ACD     7
 
185
#define ACO     5
 
186
#define ACI     4
 
187
#define ACIE    3
 
188
#define ACIS1   1
 
189
#define ACIS0   0
 
190
 
 
191
/* Last memory addresses */
 
192
#define RAMEND          0x1F
 
193
#define XRAMEND         0x0
 
194
#define E2END           0x0
 
195
#define FLASHEND        0x3FF
 
196
 
 
197
#endif /* _AVR_IOTN11_H_ */