EVE 1.0
eeprom.h
Go to the documentation of this file.
1 /**
2  * \addtogroup dev
3  * @{
4  */
5 
6 /**
7  * \defgroup eeprom EEPROM API
8  *
9  * The EEPROM API defines a common interface for EEPROM access on
10  * Contiki platforms.
11  *
12  * A platform with EEPROM support must implement this API.
13  *
14  * @{
15  */
16 
17 /**
18  * \file
19  * EEPROM functions.
20  * \author Adam Dunkels <adam@sics.se>
21  */
22 
23 /* Copyright (c) 2004 Swedish Institute of Computer Science.
24  * All rights reserved.
25  *
26  * Redistribution and use in source and binary forms, with or without modification,
27  * are permitted provided that the following conditions are met:
28  *
29  * 1. Redistributions of source code must retain the above copyright notice,
30  * this list of conditions and the following disclaimer.
31  * 2. Redistributions in binary form must reproduce the above copyright notice,
32  * this list of conditions and the following disclaimer in the documentation
33  * and/or other materials provided with the distribution.
34  * 3. The name of the author may not be used to endorse or promote products
35  * derived from this software without specific prior written permission.
36  *
37  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
38  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
39  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
40  * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
41  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
42  * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
43  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
44  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
45  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
46  * OF SUCH DAMAGE.
47  *
48  *
49  * Author: Adam Dunkels <adam@sics.se>
50  *
51  */
52 
53 
54 #ifndef EEPROM_H_
55 #define EEPROM_H_
56 
57 typedef unsigned short eeprom_addr_t;
58 
59 /**
60  * Write a buffer into EEPROM.
61  *
62  * This function writes a buffer of the specified size into EEPROM.
63  *
64  * \param addr The address in EEPROM to which the buffer should be written.
65  *
66  * \param buf A pointer to the buffer from which data is to be read.
67  *
68  * \param size The number of bytes to write into EEPROM.
69  *
70  *
71  */
72 void eeprom_write(eeprom_addr_t addr, unsigned char *buf, int size);
73 
74 /**
75  * Read data from the EEPROM.
76  *
77  * This function reads a number of bytes from the specified address in
78  * EEPROM and into a buffer in memory.
79  *
80  * \param addr The address in EEPROM from which the data should be read.
81  *
82  * \param buf A pointer to the buffer to which the data should be stored.
83  *
84  * \param size The number of bytes to read.
85  *
86  *
87  */
88 void eeprom_read(eeprom_addr_t addr, unsigned char *buf, int size);
89 
90 /**
91  * Initialize the EEPROM module
92  *
93  * This function initializes the EEPROM module and is called from the
94  * bootup code.
95  *
96  */
97 
98 void eeprom_init(void);
99 
100 #endif /* EEPROM_H_ */
101 
102 /** @} */
103 /** @} */
void eeprom_init(void)
Definition: eeprom.c:482
void eeprom_read(eeprom_addr_t addr, unsigned char *buf, int size)
Definition: eeprom.c:471
void eeprom_write(eeprom_addr_t addr, unsigned char *buf, int size)
Definition: eeprom.c:460