avr-libc  2.0.0
Standard C library for AVR-GCC

AVR Libc Home Page

AVRs

AVR Libc Development Pages

Main Page

User Manual

Library Reference

FAQ

Example Projects

eedef.h
1 /* Copyright (c) 2009 Dmitry Xmelkov
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  * Redistributions in binary form must reproduce the above copyright
10  notice, this list of conditions and the following disclaimer in
11  the documentation and/or other materials provided with the
12  distribution.
13  * Neither the name of the copyright holders nor the names of
14  contributors may be used to endorse or promote products derived
15  from this software without specific prior written permission.
16 
17  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27  POSSIBILITY OF SUCH DAMAGE. */
28 
29 /* $Id: eedef.h 2468 2015-02-25 12:53:38Z pitchumani $ */
30 
31 #ifndef _EEDEF_H_
32 #define _EEDEF_H_ 1
33 
34 #ifndef __DOXYGEN__
35 
36 /* EEPROM address arg for a set of byte/word/dword functions and for
37  the internal eeprom_read_blraw(). */
38 #define addr_lo r24
39 #define addr_hi r25
40 
41 /* Number of bytes arg for all block read/write functions, include
42  internal. */
43 #define n_lo r20
44 #define n_hi r21
45 
46 #if __AVR_XMEGA__
47 
48 # define NVM_BASE NVM_ADDR0
49 
50 #else
51 
52 # if !defined (EECR) && defined (DEECR) /* AT86RF401 */
53 # define EECR DEECR
54 # define EEARL DEEAR
55 # define EEDR DEEDR
56 # endif
57 
58 # if !defined (EERE) && defined (EER) /* AT86RF401 */
59 # define EERE EER
60 # endif
61 
62 # if !defined (EEWE) && defined (EEPE) /* A part of Mega and Tiny */
63 # define EEWE EEPE
64 # endif
65 # if !defined (EEWE) && defined (EEL) /* AT86RF401 */
66 # define EEWE EEL
67 # endif
68 
69 # if !defined (EEMWE) && defined (EEMPE) /* A part of Mega and Tiny */
70 # define EEMWE EEMPE
71 # endif
72 # if !defined (EEMWE) && defined (EEU) /* AT86RF401 */
73 # define EEMWE EEU
74 # endif
75 
76 # if !_SFR_IO_REG_P (EECR) \
77  || !_SFR_IO_REG_P (EEDR) \
78  || !_SFR_IO_REG_P (EEARL) \
79  || (defined (EEARH) && !_SFR_IO_REG_P (EEARH))
80 # error
81 # endif
82 
83 #endif /* !__AVR_XMEGA__ */
84 #endif /* !__DOXYGEN__ */
85 #endif /* !_EEDEF_H_ */