~ubuntu-branches/ubuntu/breezy/avr-libc/breezy

« back to all changes in this revision

Viewing changes to include/iotn28.h

  • Committer: Bazaar Package Importer
  • Author(s): Hakan Ardo
  • Date: 2002-04-15 14:53:38 UTC
  • Revision ID: james.westby@ubuntu.com-20020415145338-c8hi0tn5bx74w7o3
Tags: upstream-20020203
ImportĀ upstreamĀ versionĀ 20020203

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
   iotn28.h - internal register definitions for ATtiny28
 
3
 
 
4
   Contributors:
 
5
     Created by Marek Michalkiewicz <marekm@linux.org.pl>
 
6
 
 
7
   THIS SOFTWARE IS NOT COPYRIGHTED
 
8
 
 
9
   This source code is offered for use in the public domain.  You may
 
10
   use, modify or distribute it freely.
 
11
 
 
12
   This code is distributed in the hope that it will be useful, but
 
13
   WITHOUT ANY WARRANTY.  ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
 
14
   DISCLAIMED.  This includes but is not limited to warranties of
 
15
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
16
 
 
17
   Based on preliminary Atmel datasheet Rev. 1062B-10/99.
 
18
 */
 
19
 
 
20
#ifndef __IOTN28
 
21
#define __IOTN28
 
22
 
 
23
#ifndef __ASSEMBLER__
 
24
#  warning "MCU not supported by the C compiler"
 
25
#endif
 
26
 
 
27
/* I/O space addresses */
 
28
 
 
29
#define OSCCAL  0x00
 
30
 
 
31
#define WDTCR   0x01
 
32
 
 
33
#define MODCR   0x02
 
34
 
 
35
#define TCNT0   0x03
 
36
#define TCCR0   0x04
 
37
 
 
38
#define IFR     0x05
 
39
#define ICR     0x06
 
40
 
 
41
#define MCUCS   0x07
 
42
 
 
43
#define ACSR    0x08
 
44
 
 
45
/* 0x09..0x0F reserved */
 
46
 
 
47
#define PIND    0x10
 
48
#define DDRD    0x11
 
49
#define PORTD   0x12
 
50
 
 
51
/* 0x13..0x15 reserved */
 
52
 
 
53
#define PINB    0x16
 
54
 
 
55
/* 0x17..0x18 reserved */
 
56
 
 
57
#define PINA    0x19
 
58
#define PACR    0x1A
 
59
#define PORTA   0x1B
 
60
 
 
61
/* 0x1C..0x3E reserved */
 
62
 
 
63
#define SREG    0x3F
 
64
 
 
65
/* Interrupt vectors (byte addresses) */
 
66
 
 
67
#define SIG_INTERRUPT0          _vector_1
 
68
#define SIG_INTERRUPT1          _vector_2
 
69
#define SIG_PIN                 _vector_3
 
70
#define SIG_OVERFLOW0           _vector_4
 
71
#define SIG_COMPARATOR          _vector_5
 
72
 
 
73
#define END_VECTOR              (5)
 
74
#define INT_VECT_SIZE (0x0c)
 
75
 
 
76
/* Bit numbers */
 
77
 
 
78
/* ICR */
 
79
#define INT1    7
 
80
#define INT0    6
 
81
#define LLIE    5
 
82
#define TOIE0   4
 
83
#define ISC11   3
 
84
#define ISC10   2
 
85
#define ISC01   1
 
86
#define ISC00
 
87
 
 
88
/* IFR */
 
89
#define INTF1   7
 
90
#define INTF0   6
 
91
#define TOV0    4
 
92
 
 
93
/* MCUCS */
 
94
#define PLUPB   7
 
95
#define SE      5
 
96
#define SM      4
 
97
#define WDRF    3
 
98
#define EXTRF   1
 
99
#define PORF    0
 
100
 
 
101
/* TCCR0 */
 
102
#define FOV0    7
 
103
#define OOM01   4
 
104
#define OOM00   3
 
105
#define CS02    2
 
106
#define CS01    1
 
107
#define CS00    0
 
108
 
 
109
/* MODCR */
 
110
#define ONTIM4  7
 
111
#define ONTIM3  6
 
112
#define ONTIM2  5
 
113
#define ONTIM1  4
 
114
#define ONTIM0  3
 
115
#define MCONF2  2
 
116
#define MCONF1  1
 
117
#define MCONF0  0
 
118
 
 
119
/* WDTCR */
 
120
#define WDTOE   4
 
121
#define WDE     3
 
122
#define WDP2    2
 
123
#define WDP1    1
 
124
#define WDP0    0
 
125
 
 
126
/* EECR */
 
127
#define EERIE   3
 
128
#define EEMWE   2
 
129
#define EEWE    1
 
130
#define EERE    0
 
131
 
 
132
/*
 
133
   PA2 = IR
 
134
 */
 
135
 
 
136
/* PORTA */
 
137
#define PA3     3
 
138
#define PA2     2
 
139
#define PA1     1
 
140
#define PA0     0
 
141
 
 
142
/* PACR */
 
143
#define DDA3    3
 
144
#define PA2HC   2
 
145
#define DDA1    1
 
146
#define DDA0    0
 
147
 
 
148
/* PINA */
 
149
#define PINA3   3
 
150
#define PINA1   1
 
151
#define PINA0   0
 
152
 
 
153
/*
 
154
   PB4 = INT1
 
155
   PB3 = INT0
 
156
   PB2 = T0
 
157
   PB1 = AIN1
 
158
   PB0 = AIN0
 
159
 */
 
160
 
 
161
/* PINB */
 
162
#define PINB7   7
 
163
#define PINB6   6
 
164
#define PINB5   5
 
165
#define PINB4   4
 
166
#define PINB3   3
 
167
#define PINB2   2
 
168
#define PINB1   1
 
169
#define PINB0   0
 
170
 
 
171
/* PORTD */
 
172
#define PD7     7
 
173
#define PD6     6
 
174
#define PD5     5
 
175
#define PD4     4
 
176
#define PD3     3
 
177
#define PD2     2
 
178
#define PD1     1
 
179
#define PD0     0
 
180
 
 
181
/* DDRD */
 
182
#define DDD7    7
 
183
#define DDD6    6
 
184
#define DDD5    5
 
185
#define DDD4    4
 
186
#define DDD3    3
 
187
#define DDD2    2
 
188
#define DDD1    1
 
189
#define DDD0    0
 
190
 
 
191
/* PIND */
 
192
#define PIND7   7
 
193
#define PIND6   6
 
194
#define PIND5   5
 
195
#define PIND4   4
 
196
#define PIND3   3
 
197
#define PIND2   2
 
198
#define PIND1   1
 
199
#define PIND0   0
 
200
 
 
201
/* ACSR */
 
202
#define ACD     7
 
203
#define ACO     5
 
204
#define ACI     4
 
205
#define ACIE    3
 
206
#define ACIS1   1
 
207
#define ACIS0   0
 
208
 
 
209
#define ZL r30
 
210
#define ZH r31
 
211
 
 
212
/* Last memory addresses */
 
213
#define RAMEND          0x1F
 
214
#define XRAMEND         0x0
 
215
#define E2END           0x0
 
216
#define FLASHEND        0x7FF
 
217
 
 
218
#endif  /* __IOTN28 */