eedef.8h
01 1 Copyright (c) 2009 Dmitry Xmelkov
022All rights reserved.
033
044Redistribution and use in source and binary forms, with or without
055modification, are permitted provided that the following conditions are met:
066
077* Redistributions of source code must retain the above copyright
088notice, this list of conditions and the following disclaimer.
099* Redistributions in binary form must reproduce the above copyright
1010notice, this list of conditions and the following disclaimer in
1111the documentation and/or other materials provided with the
1212distribution.
1313* Neither the name of the copyright holders nor the names of
1414contributors may be used to endorse or promote products derived
1515from this software without specific prior written permission.
1616
1717THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
1818AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1919IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2020ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
2121LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2222CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2323SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
2424INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
2525CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
2626ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2727POSSIBILITY OF SUCH DAMAGE. */
2828
2929/* $Id: eedef.h 2468 2015-02-25 12:53:38Z pitchumani $ */
3030
3131#ifndef _EEDEF_H_
3232#define _EEDEF_H_ 1
3333
3434#ifndef __DOXYGEN__
3535
3636/* EEPROM address arg for a set of byte/word/dword functions and for
3737the internal eeprom_read_blraw(). */
3838#define addr_lo r24
3939#define addr_hi r25
4040
4141/* Number of bytes arg for all block read/write functions, include
4242internal. */
4343#define n_lo r20
4444#define n_hi r21
4545
4646#if __AVR_XMEGA__
4747
4848# define NVM_BASE NVM_ADDR0
4949
5050#else
5151
5252# if !defined (EECR) && defined (DEECR) /* AT86RF401 */
5353# define EECR DEECR
5454# define EEARL DEEAR
5555# define EEDR DEEDR
5656# endif
5757
5858# if !defined (EERE) && defined (EER) /* AT86RF401 */
5959# define EERE EER
6060# endif
6161
6262# if !defined (EEWE) && defined (EEPE) /* A part of Mega and Tiny */
6363# define EEWE EEPE
6464# endif
6565# if !defined (EEWE) && defined (EEL) /* AT86RF401 */
6666# define EEWE EEL
6767# endif
6868
6969# if !defined (EEMWE) && defined (EEMPE) /* A part of Mega and Tiny */
7070# define EEMWE EEMPE
7171# endif
7272# if !defined (EEMWE) && defined (EEU) /* AT86RF401 */
7373# define EEMWE EEU
7474# endif
7575
7676# if !_SFR_IO_REG_P (EECR) \
7777|| !_SFR_IO_REG_P (EEDR) \
7878|| !_SFR_IO_REG_P (EEARL) \
7979|| (defined (EEARH) && !_SFR_IO_REG_P (EEARH))
8080# error
8181# endif
8282
8383#endif /* !__AVR_XMEGA__ */
8484#endif /* !__DOXYGEN__ */
8585#endif /* !_EEDEF_H_ */