D:/DRISSI/arduino-0022/arduino-0022/libraries/EEPROM/EEPROM.cpp
00001 /*
00002   EEPROM.cpp - EEPROM library
00003   Copyright (c) 2006 David A. Mellis.  All right reserved.
00004 
00005   This library is free software; you can redistribute it and/or
00006   modify it under the terms of the GNU Lesser General Public
00007   License as published by the Free Software Foundation; either
00008   version 2.1 of the License, or (at your option) any later version.
00009 
00010   This library is distributed in the hope that it will be useful,
00011   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013   Lesser General Public License for more details.
00014 
00015   You should have received a copy of the GNU Lesser General Public
00016   License along with this library; if not, write to the Free Software
00017   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00018 */
00019 
00020 /******************************************************************************
00021  * Includes
00022  ******************************************************************************/
00023 
00024 #include <avr/eeprom.h>
00025 #include "WConstants.h"
00026 #include "EEPROM.h"
00027 
00028 /******************************************************************************
00029  * Definitions
00030  ******************************************************************************/
00031 
00032 /******************************************************************************
00033  * Constructors
00034  ******************************************************************************/
00035 
00036 /******************************************************************************
00037  * User API
00038  ******************************************************************************/
00039 
00040 uint8_t EEPROMClass::read(int address)
00041 {
00042         return eeprom_read_byte((unsigned char *) address);
00043 }
00044 
00045 void EEPROMClass::write(int address, uint8_t value)
00046 {
00047         eeprom_write_byte((unsigned char *) address, value);
00048 }
00049 
00050 EEPROMClass EEPROM;