NVSMSP432.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-2017, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 /*
34  * ======== NVSMSP432.h ========
35  */
36 
37 #ifndef ti_drivers_nvs_NVSMSP432__include
38 #define ti_drivers_nvs_NVSMSP432__include
39 
40 #include <stdint.h>
41 #include <stdbool.h>
42 
43 #if defined (__cplusplus)
44 extern "C" {
45 #endif
46 
79 extern const NVS_FxnTable NVSMSP432_fxnTable;
80 
192 typedef struct NVSMSP432_HWAttrs {
193  void *regionBase;
194  size_t regionSize;
196 
197 /*
198  * @brief NVSMSP432 Object
199  *
200  * The application must not access any member variables of this structure!
201  */
202 typedef struct NVSMSP432_Object {
203  bool opened; /* Has this region been opened */
205 
206 /*
207  * @brief NVSMSP432 driver public APIs
208  *
209  * @{
210  */
211 
212 extern void NVSMSP432_close(NVS_Handle handle);
213 extern int_fast16_t NVSMSP432_control(NVS_Handle handle, uint_fast16_t cmd,
214  uintptr_t arg);
215 extern int_fast16_t NVSMSP432_erase(NVS_Handle handle, size_t offset,
216  size_t size);
217 extern void NVSMSP432_getAttrs(NVS_Handle handle, NVS_Attrs *attrs);
218 extern void NVSMSP432_init();
219 extern int_fast16_t NVSMSP432_lock(NVS_Handle handle, uint32_t timeout);
220 extern NVS_Handle NVSMSP432_open(uint_least8_t index, NVS_Params *params);
221 extern int_fast16_t NVSMSP432_read(NVS_Handle handle, size_t offset,
222  void *buffer, size_t bufferSize);
223 extern void NVSMSP432_unlock(NVS_Handle handle);
224 extern int_fast16_t NVSMSP432_write(NVS_Handle handle, size_t offset,
225  void *buffer, size_t bufferSize, uint_fast16_t flags);
228 #if defined (__cplusplus)
229 }
230 #endif /* defined (__cplusplus) */
231 
233 #endif /* ti_drivers_nvs_NVSMSP432__include */
void NVSMSP432_unlock(NVS_Handle handle)
int_fast16_t NVSMSP432_erase(NVS_Handle handle, size_t offset, size_t size)
NVS attributes.
Definition: NVS.h:418
size_t regionSize
Definition: NVSMSP432.h:194
int_fast16_t NVSMSP432_lock(NVS_Handle handle, uint32_t timeout)
NVSMSP432 attributes.
Definition: NVSMSP432.h:192
Definition: NVSMSP432.h:202
int_fast16_t NVSMSP432_read(NVS_Handle handle, size_t offset, void *buffer, size_t bufferSize)
const NVS_FxnTable NVSMSP432_fxnTable
NVS function pointer table.
int_fast16_t NVSMSP432_write(NVS_Handle handle, size_t offset, void *buffer, size_t bufferSize, uint_fast16_t flags)
struct NVSMSP432_Object NVSMSP432_Object
NVS Parameters.
Definition: NVS.h:397
void * regionBase
Definition: NVSMSP432.h:193
void NVSMSP432_getAttrs(NVS_Handle handle, NVS_Attrs *attrs)
int_fast16_t NVSMSP432_control(NVS_Handle handle, uint_fast16_t cmd, uintptr_t arg)
NVS Global configuration.
Definition: NVS.h:542
void NVSMSP432_close(NVS_Handle handle)
struct NVSMSP432_HWAttrs NVSMSP432_HWAttrs
NVSMSP432 attributes.
The definition of an NVS function table that contains the required set of functions to control a spec...
Definition: NVS.h:499
NVS_Handle NVSMSP432_open(uint_least8_t index, NVS_Params *params)
void NVSMSP432_init()
bool opened
Definition: NVSMSP432.h:203
Copyright 2017, Texas Instruments Incorporated