RTEMS CPU Kit with SuperCore
4.11.3
Main Page
Related Pages
Modules
+
Data Structures
Data Structures
+
Data Fields
+
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
+
Variables
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
+
Files
File List
+
Globals
+
All
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
+
Functions
_
a
b
c
d
e
f
g
i
j
l
m
n
o
p
q
r
s
t
u
v
w
+
Variables
_
b
c
d
i
r
+
Typedefs
a
b
c
d
f
h
i
m
o
p
q
r
s
t
u
w
x
+
Enumerations
b
c
d
e
h
i
m
o
p
r
s
t
w
+
Enumerator
c
i
m
p
r
s
t
w
+
Macros
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
w
mnt
data0
chrisj
rtems
releases
rtems-release.git
4.11.3
ws-rtems
rtems-4.11.3
cpukit
score
cpu
avr
avr
common.h
Go to the documentation of this file.
1
14
/*
15
* Copyright (c) 2007 Eric B. Weddington
16
* All rights reserved.
17
*
18
* Redistribution and use in source and binary forms, with or without
19
* modification, are permitted provided that the following conditions are met:
20
*
21
* * Redistributions of source code must retain the above copyright
22
* notice, this list of conditions and the following disclaimer.
23
*
24
* * Redistributions in binary form must reproduce the above copyright
25
* notice, this list of conditions and the following disclaimer in
26
* the documentation and/or other materials provided with the
27
* distribution.
28
*
29
* * Neither the name of the copyright holders nor the names of
30
* contributors may be used to endorse or promote products derived
31
* from this software without specific prior written permission.
32
*
33
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
34
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
35
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
36
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
37
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
38
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
39
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
40
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
41
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
42
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
43
* POSSIBILITY OF SUCH DAMAGE.
44
*/
45
46
47
48
#ifndef _AVR_COMMON_H
49
#define _AVR_COMMON_H
50
58
#include <
avr/sfr_defs.h
>
59
60
/*------------ Registers Not Previously Defined ------------*/
61
62
/*
63
These are registers that are not previously defined in the individual
64
IO header files, OR they are defined here because they are used in parts of
65
avr-libc even if a device is not selected but a general architecture has
66
been selected.
67
*/
68
69
70
/*
71
Stack pointer register.
72
73
AVR architecture 1 has no RAM, thus no stack pointer.
74
75
All other architectures do have a stack pointer. Some devices have only
76
less than 256 bytes of possible RAM locations (128 Bytes of SRAM
77
and no option for external RAM), thus SPH is officially "reserved"
78
for them.
79
*/
80
#if __AVR_ARCH__ >= 100
81
# ifndef SPL
82
# define SPL _SFR_MEM8(0x3D)
83
# endif
84
# ifndef SPH
85
# define SPH _SFR_MEM8(0x3E)
86
# endif
87
# ifndef SP
88
# define SP _SFR_MEM16(0x3D)
89
# endif
90
#elif __AVR_ARCH__ != 1
91
# ifndef SPL
92
# define SPL _SFR_IO8(0x3D)
93
# endif
94
# if XRAMEND < 0x100 && !defined(__COMPILING_AVR_LIBC__)
95
# ifndef SP
96
# define SP _SFR_IO8(0x3D)
97
# endif
98
# else
99
# ifndef SP
100
# define SP _SFR_IO16(0x3D)
101
# endif
102
# ifndef SPH
103
# define SPH _SFR_IO8(0x3E)
104
# endif
105
# endif
/* XRAMEND < 0x100 && !defined(__COMPILING_AVR_LIBC__) */
106
#endif
/* __AVR_ARCH__ != 1 */
107
108
109
/* Status Register */
110
#ifndef SREG
111
# if __AVR_ARCH__ >= 100
112
# define SREG _SFR_MEM8(0x3F)
113
# else
114
# define SREG _SFR_IO8(0x3F)
115
# endif
116
#endif
117
118
119
/* SREG bit definitions */
120
#ifndef SREG_C
121
# define SREG_C (0)
122
#endif
123
#ifndef SREG_Z
124
# define SREG_Z (1)
125
#endif
126
#ifndef SREG_N
127
# define SREG_N (2)
128
#endif
129
#ifndef SREG_V
130
# define SREG_V (3)
131
#endif
132
#ifndef SREG_S
133
# define SREG_S (4)
134
#endif
135
#ifndef SREG_H
136
# define SREG_H (5)
137
#endif
138
#ifndef SREG_T
139
# define SREG_T (6)
140
#endif
141
#ifndef SREG_I
142
# define SREG_I (7)
143
#endif
144
145
146
#if defined(__COMPILING_AVR_LIBC__)
147
148
/* AVR 6 Architecture */
149
# if __AVR_ARCH__ == 6
150
# ifndef EIND
151
# define EIND _SFR_IO8(0X3C)
152
# endif
153
/* XMEGA Architectures */
154
# elif __AVR_ARCH__ >= 100
155
# ifndef EIND
156
# define EIND _SFR_MEM8(0x3C)
157
# endif
158
# endif
159
160
/*
161
Only few devices come without EEPROM. In order to assemble the
162
EEPROM library components without defining a specific device, we
163
keep the EEPROM-related definitions here.
164
*/
165
166
/* EEPROM Control Register */
167
# ifndef EECR
168
# define EECR _SFR_IO8(0x1C)
169
# endif
170
171
/* EEPROM Data Register */
172
# ifndef EEDR
173
# define EEDR _SFR_IO8(0x1D)
174
# endif
175
176
/* EEPROM Address Register */
177
# ifndef EEAR
178
# define EEAR _SFR_IO16(0x1E)
179
# endif
180
# ifndef EEARL
181
# define EEARL _SFR_IO8(0x1E)
182
# endif
183
# ifndef EEARH
184
# define EEARH _SFR_IO8(0x1F)
185
# endif
186
187
/* EEPROM Control Register bits */
188
# ifndef EERE
189
# define EERE (0)
190
# endif
191
# ifndef EEWE
192
# define EEWE (1)
193
# endif
194
# ifndef EEMWE
195
# define EEMWE (2)
196
# endif
197
# ifndef EERIE
198
# define EERIE (3)
199
# endif
200
201
#endif
/* __COMPILING_AVR_LIBC__ */
202
203
204
205
/*------------ Common Symbols ------------*/
206
207
/*
208
Generic definitions for registers that are common across multiple AVR devices
209
and families.
210
*/
211
212
/* Pointer registers definitions */
213
#if __AVR_ARCH__ != 1
/* avr1 does not have X and Y pointers */
214
# define XL r26
215
# define XH r27
216
# define YL r28
217
# define YH r29
218
#endif
/* #if __AVR_ARCH__ != 1 */
219
#define ZL r30
220
#define ZH r31
221
222
223
/* Status Register */
224
#if defined(SREG)
225
# define AVR_STATUS_REG SREG
226
# if __AVR_ARCH__ >= 100
227
# define AVR_STATUS_ADDR _SFR_MEM_ADDR(SREG)
228
# else
229
# define AVR_STATUS_ADDR _SFR_IO_ADDR(SREG)
230
# endif
231
#endif
232
233
/* Stack Pointer (combined) Register */
234
#if defined(SP)
235
# define AVR_STACK_POINTER_REG SP
236
# if __AVR_ARCH__ >= 100
237
# define AVR_STACK_POINTER_ADDR _SFR_MEM_ADDR(SP)
238
# else
239
# define AVR_STACK_POINTER_ADDR _SFR_IO_ADDR(SP)
240
# endif
241
#endif
242
243
/* Stack Pointer High Register */
244
#if defined(SPH)
245
# define _HAVE_AVR_STACK_POINTER_HI 1
246
# define AVR_STACK_POINTER_HI_REG SPH
247
# if __AVR_ARCH__ >= 100
248
# define AVR_STACK_POINTER_HI_ADDR _SFR_MEM_ADDR(SPH)
249
# else
250
# define AVR_STACK_POINTER_HI_ADDR _SFR_IO_ADDR(SPH)
251
# endif
252
#endif
253
254
/* Stack Pointer Low Register */
255
#if defined(SPL)
256
# define AVR_STACK_POINTER_LO_REG SPL
257
# if __AVR_ARCH__ >= 100
258
# define AVR_STACK_POINTER_LO_ADDR _SFR_MEM_ADDR(SPL)
259
# else
260
# define AVR_STACK_POINTER_LO_ADDR _SFR_IO_ADDR(SPL)
261
# endif
262
#endif
263
264
/* RAMPD Register */
265
#if defined(RAMPD)
266
# define AVR_RAMPD_REG RAMPD
267
# if __AVR_ARCH__ >= 100
268
# define AVR_RAMPD_ADDR _SFR_MEM_ADDR(RAMPD)
269
# else
270
# define AVR_RAMPD_ADDR _SFR_IO_ADDR(RAMPD)
271
# endif
272
#endif
273
274
/* RAMPX Register */
275
#if defined(RAMPX)
276
# define AVR_RAMPX_REG RAMPX
277
# if __AVR_ARCH__ >= 100
278
# define AVR_RAMPX_ADDR _SFR_MEM_ADDR(RAMPX)
279
# else
280
# define AVR_RAMPX_ADDR _SFR_IO_ADDR(RAMPX)
281
# endif
282
#endif
283
284
/* RAMPY Register */
285
#if defined(RAMPY)
286
# define AVR_RAMPY_REG RAMPY
287
# if __AVR_ARCH__ >= 100
288
# define AVR_RAMPY_ADDR _SFR_MEM_ADDR(RAMPY)
289
# else
290
# define AVR_RAMPY_ADDR _SFR_IO_ADDR(RAMPY)
291
# endif
292
#endif
293
294
/* RAMPZ Register */
295
#if defined(RAMPZ)
296
# define AVR_RAMPZ_REG RAMPZ
297
# if __AVR_ARCH__ >= 100
298
# define AVR_RAMPZ_ADDR _SFR_MEM_ADDR(RAMPZ)
299
# else
300
# define AVR_RAMPZ_ADDR _SFR_IO_ADDR(RAMPZ)
301
# endif
302
#endif
303
304
/* Extended Indirect Register */
305
#if defined(EIND)
306
# define AVR_EXTENDED_INDIRECT_REG EIND
307
# if __AVR_ARCH__ >= 100
308
# define AVR_EXTENDED_INDIRECT_ADDR _SFR_MEM_ADDR(EIND)
309
# else
310
# define AVR_EXTENDED_INDIRECT_ADDR _SFR_IO_ADDR(EIND)
311
# endif
312
#endif
313
314
/*------------ Workaround to old compilers (4.1.2 and earlier) ------------*/
315
316
#ifndef __AVR_HAVE_MOVW__
317
# if defined(__AVR_ENHANCED__) && __AVR_ENHANCED__
318
# define __AVR_HAVE_MOVW__ 1
319
# endif
320
#endif
321
322
#ifndef __AVR_HAVE_LPMX__
323
# if defined(__AVR_ENHANCED__) && __AVR_ENHANCED__
324
# define __AVR_HAVE_LPMX__ 1
325
# endif
326
#endif
327
328
#ifndef __AVR_HAVE_MUL__
329
# if defined(__AVR_ENHANCED__) && __AVR_ENHANCED__
330
# define __AVR_HAVE_MUL__ 1
331
# endif
332
#endif
333
335
#endif
/* _AVR_COMMON_H */
sfr_defs.h
Macros for Accessing AVR Special Function Registers.
Generated by
1.8.13