EE445M RTOS
Taken at the University of Texas Spring 2015
eeprom.h
Go to the documentation of this file.
1 //*****************************************************************************
2 //
3 // eeprom.h - Prototypes for the EEPROM driver.
4 //
5 // Copyright (c) 2010-2014 Texas Instruments Incorporated. All rights reserved.
6 // Software License Agreement
7 //
8 // Redistribution and use in source and binary forms, with or without
9 // modification, are permitted provided that the following conditions
10 // are met:
11 //
12 // Redistributions of source code must retain the above copyright
13 // notice, this list of conditions and the following disclaimer.
14 //
15 // Redistributions in binary form must reproduce the above copyright
16 // notice, this list of conditions and the following disclaimer in the
17 // documentation and/or other materials provided with the
18 // distribution.
19 //
20 // Neither the name of Texas Instruments Incorporated nor the names of
21 // its contributors may be used to endorse or promote products derived
22 // from this software without specific prior written permission.
23 //
24 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
27 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
28 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
29 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
30 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 //
36 // This is part of revision 2.1.0.12573 of the Tiva Peripheral Driver Library.
37 //
38 //*****************************************************************************
39 
40 #ifndef __DRIVERLIB_EEPROM_H__
41 #define __DRIVERLIB_EEPROM_H__
42 
43 //*****************************************************************************
44 //
45 // If building with a C++ compiler, make all of the definitions in this header
46 // have a C binding.
47 //
48 //*****************************************************************************
49 #ifdef __cplusplus
50 extern "C"
51 {
52 #endif
53 
54 //*****************************************************************************
55 //
58 //
59 //*****************************************************************************
60 
61 //*****************************************************************************
62 //
63 // Values returned by EEPROMInit.
64 //
65 //*****************************************************************************
66 
67 //
71 //
72 #define EEPROM_INIT_OK 0
73 
74 //
82 //
83 #define EEPROM_INIT_ERROR 2
84 
85 //*****************************************************************************
86 //
87 // Error indicators returned by various EEPROM API calls. These will be ORed
88 // together into the final return code.
89 //
90 //*****************************************************************************
91 
92 //
95 //
96 #define EEPROM_RC_WRBUSY 0x00000020
97 
98 //
104 //
105 #define EEPROM_RC_NOPERM 0x00000010
106 
107 //
112 //
113 #define EEPROM_RC_WKCOPY 0x00000008
114 
115 //
119 //
120 #define EEPROM_RC_WKERASE 0x00000004
121 
122 //
126 //
127 #define EEPROM_RC_WORKING 0x00000001
128 
129 //*****************************************************************************
130 //
131 // Values that can be passed to EEPROMBlockProtectSet() in the ui32Protect
132 // parameter, and returned by EEPROMBlockProtectGet().
133 //
134 //*****************************************************************************
135 
136 //
141 //
142 #define EEPROM_PROT_SUPERVISOR_ONLY 0x00000008
143 
144 //
150 //
151 #define EEPROM_PROT_RW_LRO_URW 0x00000000
152 
153 //
157 //
158 #define EEPROM_PROT_NA_LNA_URW 0x00000001
159 
160 //
166 //
167 #define EEPROM_PROT_RO_LNA_URO 0x00000002
168 
169 //*****************************************************************************
170 //
174 //
175 //*****************************************************************************
176 #define EEPROM_INT_PROGRAM 0x00000004
177 
178 //*****************************************************************************
179 //
193 //
194 //*****************************************************************************
195 #define EEPROMBlockFromAddr(ui32Addr) ((ui32Addr) >> 6)
196 
197 //*****************************************************************************
198 //
209 //
210 //*****************************************************************************
211 #define EEPROMAddrFromBlock(ui32Block) ((ui32Block) << 6)
212 
213 //*****************************************************************************
214 //
215 // Close the Doxygen group.
217 //
218 //*****************************************************************************
219 
220 //*****************************************************************************
221 //
222 // Prototypes for the APIs.
223 //
224 //*****************************************************************************
225 extern uint32_t EEPROMInit(void);
226 extern uint32_t EEPROMSizeGet(void);
227 extern uint32_t EEPROMBlockCountGet(void);
228 extern void EEPROMRead(uint32_t *pui32Data, uint32_t ui32Address,
229  uint32_t ui32Count);
230 extern uint32_t EEPROMProgram(uint32_t *pui32Data,
231  uint32_t ui32Address,
232  uint32_t ui32Count);
233 extern uint32_t EEPROMProgramNonBlocking(uint32_t ui32Data,
234  uint32_t ui32Address);
235 extern uint32_t EEPROMStatusGet(void);
236 extern uint32_t EEPROMMassErase(void);
237 extern uint32_t EEPROMBlockProtectGet(uint32_t ui32Block);
238 extern uint32_t EEPROMBlockProtectSet(uint32_t ui32Block,
239  uint32_t ui32Protect);
240 extern uint32_t EEPROMBlockPasswordSet(uint32_t ui32Block,
241  uint32_t *pui32Password,
242  uint32_t ui32Count);
243 extern uint32_t EEPROMBlockLock(uint32_t ui32Block);
244 extern uint32_t EEPROMBlockUnlock(uint32_t ui32Block,
245  uint32_t *pui32Password,
246  uint32_t ui32Count);
247 extern void EEPROMBlockHide(uint32_t ui32Block);
248 extern void EEPROMIntEnable(uint32_t ui32IntFlags);
249 extern void EEPROMIntDisable(uint32_t ui32IntFlags);
250 extern uint32_t EEPROMIntStatus(bool bMasked);
251 extern void EEPROMIntClear(uint32_t ui32IntFlags);
252 
253 #ifndef DEPRECATED
254 //*****************************************************************************
255 //
256 // The following definitions appeared in previous revisions of this file
257 // but have been deprecated and should not be used by applications.
258 //
259 //*****************************************************************************
260 
261 //
262 // This value used to be one of those which could be returned from a call to
263 // EEPROMInit(). It transpires that it is was incorrect and has been removed
264 // after EEPROMInit() was reworked for TivaWare 2.1.
265 //
266 #define EEPROM_INIT_RETRY 1
267 
268 //
269 // This return code is not available from any Tiva part and has been removed.
270 //
271 #define EEPROM_RC_INVPL 0x00000100
272 
273 #endif
274 
275 //*****************************************************************************
276 //
277 // Mark the end of the C bindings section for C++ compilers.
278 //
279 //*****************************************************************************
280 #ifdef __cplusplus
281 }
282 #endif
283 
284 #endif // __DRIVERLIB_EEPROM_H__
uint32_t EEPROMStatusGet(void)
Definition: eeprom.c:1146
uint32_t EEPROMBlockUnlock(uint32_t ui32Block, uint32_t *pui32Password, uint32_t ui32Count)
Definition: eeprom.c:900
void EEPROMRead(uint32_t *pui32Data, uint32_t ui32Address, uint32_t ui32Count)
Definition: eeprom.c:307
uint32_t EEPROMBlockCountGet(void)
Definition: eeprom.c:270
uint32_t EEPROMProgram(uint32_t *pui32Data, uint32_t ui32Address, uint32_t ui32Count)
Definition: eeprom.c:381
uint32_t EEPROMBlockLock(uint32_t ui32Block)
Definition: eeprom.c:847
uint32_t EEPROMIntStatus(bool bMasked)
Definition: eeprom.c:1063
uint32_t EEPROMProgramNonBlocking(uint32_t ui32Data, uint32_t ui32Address)
Definition: eeprom.c:534
uint32_t EEPROMBlockPasswordSet(uint32_t ui32Block, uint32_t *pui32Password, uint32_t ui32Count)
Definition: eeprom.c:771
void EEPROMBlockHide(uint32_t ui32Block)
Definition: eeprom.c:960
void EEPROMIntClear(uint32_t ui32IntFlags)
Definition: eeprom.c:1112
uint32_t EEPROMBlockProtectSet(uint32_t ui32Block, uint32_t ui32Protect)
Definition: eeprom.c:706
uint32_t EEPROMSizeGet(void)
Definition: eeprom.c:248
void EEPROMIntDisable(uint32_t ui32IntFlags)
Definition: eeprom.c:1028
uint32_t EEPROMBlockProtectGet(uint32_t ui32Block)
Definition: eeprom.c:643
void EEPROMIntEnable(uint32_t ui32IntFlags)
Definition: eeprom.c:992
uint32_t EEPROMInit(void)
Definition: eeprom.c:176
uint32_t EEPROMMassErase(void)
Definition: eeprom.c:587