Tiva Driver Lib
eeprom.h
1 //*****************************************************************************
2 //
3 // eeprom.h - Prototypes for the EEPROM driver.
4 //
5 // Copyright (c) 2010-2013 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 1.1 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 //
80 //
81 #define EEPROM_INIT_RETRY 1
82 
83 //
91 //
92 #define EEPROM_INIT_ERROR 2
93 
94 //*****************************************************************************
95 //
96 // Error indicators returned by various EEPROM API calls. These will be ORed
97 // together into the final return code.
98 //
99 //*****************************************************************************
100 
101 //
106 //
107 #define EEPROM_RC_INVPL 0x00000100
108 
109 //
112 //
113 #define EEPROM_RC_WRBUSY 0x00000020
114 
115 //
121 //
122 #define EEPROM_RC_NOPERM 0x00000010
123 
124 //
129 //
130 #define EEPROM_RC_WKCOPY 0x00000008
131 
132 //
136 //
137 #define EEPROM_RC_WKERASE 0x00000004
138 
139 //
143 //
144 #define EEPROM_RC_WORKING 0x00000001
145 
146 //*****************************************************************************
147 //
148 // Values that can be passed to EEPROMBlockProtectSet() in the ui32Protect
149 // parameter, and returned by EEPROMBlockProtectGet().
150 //
151 //*****************************************************************************
152 
153 //
158 //
159 #define EEPROM_PROT_SUPERVISOR_ONLY 0x00000008
160 
161 //
167 //
168 #define EEPROM_PROT_RW_LRO_URW 0x00000000
169 
170 //
174 //
175 #define EEPROM_PROT_NA_LNA_URW 0x00000001
176 
177 //
183 //
184 #define EEPROM_PROT_RO_LNA_URO 0x00000002
185 
186 //*****************************************************************************
187 //
191 //
192 //*****************************************************************************
193 #define EEPROM_INT_PROGRAM 0x00000004
194 
195 //*****************************************************************************
196 //
210 //
211 //*****************************************************************************
212 #define EEPROMBlockFromAddr(ui32Addr) ((ui32Addr) >> 6)
213 
214 //*****************************************************************************
215 //
226 //
227 //*****************************************************************************
228 #define EEPROMAddrFromBlock(ui32Block) ((ui32Block) << 6)
229 
230 //*****************************************************************************
231 //
232 // Close the Doxygen group.
234 //
235 //*****************************************************************************
236 
237 //*****************************************************************************
238 //
239 // Prototypes for the APIs.
240 //
241 //*****************************************************************************
242 extern uint32_t EEPROMInit(void);
243 extern uint32_t EEPROMSizeGet(void);
244 extern uint32_t EEPROMBlockCountGet(void);
245 extern void EEPROMRead(uint32_t *pui32Data, uint32_t ui32Address,
246  uint32_t ui32Count);
247 extern uint32_t EEPROMProgram(uint32_t *pui32Data,
248  uint32_t ui32Address,
249  uint32_t ui32Count);
250 extern uint32_t EEPROMProgramNonBlocking(uint32_t ui32Data,
251  uint32_t ui32Address);
252 extern uint32_t EEPROMStatusGet(void);
253 extern uint32_t EEPROMMassErase(void);
254 extern uint32_t EEPROMBlockProtectGet(uint32_t ui32Block);
255 extern uint32_t EEPROMBlockProtectSet(uint32_t ui32Block,
256  uint32_t ui32Protect);
257 extern uint32_t EEPROMBlockPasswordSet(uint32_t ui32Block,
258  uint32_t *pui32Password,
259  uint32_t ui32Count);
260 extern uint32_t EEPROMBlockLock(uint32_t ui32Block);
261 extern uint32_t EEPROMBlockUnlock(uint32_t ui32Block,
262  uint32_t *pui32Password,
263  uint32_t ui32Count);
264 extern void EEPROMBlockHide(uint32_t ui32Block);
265 extern void EEPROMIntEnable(uint32_t ui32IntFlags);
266 extern void EEPROMIntDisable(uint32_t ui32IntFlags);
267 extern uint32_t EEPROMIntStatus(bool bMasked);
268 extern void EEPROMIntClear(uint32_t ui32IntFlags);
269 
270 //*****************************************************************************
271 //
272 // Mark the end of the C bindings section for C++ compilers.
273 //
274 //*****************************************************************************
275 #ifdef __cplusplus
276 }
277 #endif
278 
279 #endif // __DRIVERLIB_EEPROM_H__
uint32_t EEPROMStatusGet(void)
Definition: eeprom.c:1149
uint32_t EEPROMBlockUnlock(uint32_t ui32Block, uint32_t *pui32Password, uint32_t ui32Count)
Definition: eeprom.c:903
void EEPROMRead(uint32_t *pui32Data, uint32_t ui32Address, uint32_t ui32Count)
Definition: eeprom.c:312
uint32_t EEPROMBlockCountGet(void)
Definition: eeprom.c:275
uint32_t EEPROMProgram(uint32_t *pui32Data, uint32_t ui32Address, uint32_t ui32Count)
Definition: eeprom.c:387
uint32_t EEPROMBlockLock(uint32_t ui32Block)
Definition: eeprom.c:850
uint32_t EEPROMIntStatus(bool bMasked)
Definition: eeprom.c:1066
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:774
void EEPROMBlockHide(uint32_t ui32Block)
Definition: eeprom.c:963
void EEPROMIntClear(uint32_t ui32IntFlags)
Definition: eeprom.c:1115
uint32_t EEPROMBlockProtectSet(uint32_t ui32Block, uint32_t ui32Protect)
Definition: eeprom.c:708
uint32_t EEPROMSizeGet(void)
Definition: eeprom.c:253
void EEPROMIntDisable(uint32_t ui32IntFlags)
Definition: eeprom.c:1031
uint32_t EEPROMBlockProtectGet(uint32_t ui32Block)
Definition: eeprom.c:644
void EEPROMIntEnable(uint32_t ui32IntFlags)
Definition: eeprom.c:995
uint32_t EEPROMInit(void)
Definition: eeprom.c:181
uint32_t EEPROMMassErase(void)
Definition: eeprom.c:588