Main Page | Modules | Data Structures | File List | Data Fields | Globals | Examples

eeprom.h

Go to the documentation of this file.
00001 /**
00002  * \file
00003  * EEPROM functions.
00004  * \author Adam Dunkels <adam@sics.se>
00005  */
00006 
00007 /* Copyright (c) 2004 Swedish Institute of Computer Science.
00008  * All rights reserved.
00009  *
00010  * Redistribution and use in source and binary forms, with or without modification,
00011  * are permitted provided that the following conditions are met:
00012  *
00013  * 1. Redistributions of source code must retain the above copyright notice,
00014  *    this list of conditions and the following disclaimer.
00015  * 2. Redistributions in binary form must reproduce the above copyright notice,
00016  *    this list of conditions and the following disclaimer in the documentation
00017  *    and/or other materials provided with the distribution.
00018  * 3. The name of the author may not be used to endorse or promote products
00019  *    derived from this software without specific prior written permission.
00020  *
00021  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
00022  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
00023  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
00024  * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00025  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
00026  * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00027  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00028  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
00029  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
00030  * OF SUCH DAMAGE.
00031  *
00032  * $Id: eeprom.h,v 1.1 2004/11/12 13:07:21 adam Exp $
00033  *
00034  * Author: Adam Dunkels <adam@sics.se>
00035  *
00036  */
00037 
00038 
00039 #ifndef __EEPROM_H__
00040 #define __EEPROM_H__
00041 
00042 typedef unsigned short eeprom_addr_t;
00043 #define EEPROM_NULL 0
00044 
00045 /**
00046  * Write a buffer into EEPROM.
00047  *
00048  * This function writes a buffer of the specified size into EEPROM.
00049  *
00050  * \param addr The address in EEPROM to which the buffer should be written.
00051  *
00052  * \param buf A pointer to the buffer from which data is to be read.
00053  *
00054  * \param size The number of bytes to write into EEPROM.
00055  *
00056  *
00057  */
00058 void eeprom_write(eeprom_addr_t addr, unsigned char *buf, int size);
00059 
00060 /**
00061  * Read data from the EEPROM.
00062  *
00063  * This function reads a number of bytes from the specified address in
00064  * EEPROM and into a buffer in memory.
00065  *
00066  * \param addr The address in EEPROM from which the data should be read.
00067  *
00068  * \param buf A pointer to the buffer to which the data should be stored.
00069  *
00070  * \param size The number of bytes to read.  
00071  *
00072  *
00073  */
00074 void eeprom_read(eeprom_addr_t addr, unsigned char *buf, int size);
00075 
00076 #endif /* __EEPROM_H__ */

Generated on Wed Jul 6 01:18:59 2005 for Contiki/ESB by doxygen 1.3.6