70 #ifndef ti_drivers_NVS__include
71 #define ti_drivers_NVS__include
77 #if defined (__cplusplus)
98 #define NVS_CMD_RESERVED 32
112 #define NVS_STATUS_RESERVED -32
127 #define NVS_STATUS_SUCCESS 0
135 #define NVS_STATUS_ERROR -1
144 #define NVS_STATUS_UNDEFINEDCMD -2
169 #define NVS_EFAIL (-1)
170 #define NVS_EOFFSET (-3)
171 #define NVS_EALIGN (-4)
172 #define NVS_ENOTENOUGHBYTES (-5)
173 #define NVS_EALREADYWRITTEN (-6)
174 #define NVS_ECOPYBLOCK (-7)
195 #define NVS_WRITE_EXCLUSIVE (0x1)
203 #define NVS_WRITE_ERASE (0x2)
212 #define NVS_WRITE_VALIDATE (0x4)
298 void *buffer,
size_t bufferSize);
305 void *buffer,
size_t bufferSize,
368 extern void NVS_close(NVS_Handle handle);
389 extern int NVS_control(NVS_Handle handle,
unsigned int cmd, uintptr_t arg);
457 extern int NVS_read(NVS_Handle handle,
size_t offset,
void *buffer,
491 extern int NVS_write(NVS_Handle handle,
size_t offset,
void *buffer,
492 size_t bufferSize,
unsigned int flags);
494 #if defined (__cplusplus)
struct NVS_FxnTable NVS_FxnTable
The definition of an NVS function table that contains the required set of functions to control a spec...
struct NVS_Attrs NVS_Attrs
NVS attributes.
int(* NVS_GetAttrsFxn)(NVS_Handle handle, NVS_Attrs *attrs)
A function pointer to a driver specific implementation of NVS_getAttrs().
Definition: NVS.h:279
NVS attributes.
Definition: NVS.h:246
void const * hwAttrs
Definition: NVS.h:358
void NVS_exit(void)
Function to de-initialize the NVS module.
void * object
Definition: NVS.h:355
int NVS_write(NVS_Handle handle, size_t offset, void *buffer, size_t bufferSize, unsigned int flags)
Write data to an NVS block.
NVS_CloseFxn closeFxn
Definition: NVS.h:315
struct NVS_Params NVS_Params
NVS Parameters.
NVS Global configuration.
Definition: NVS.h:350
NVS_Handle(* NVS_OpenFxn)(NVS_Handle handle, NVS_Params *params)
A function pointer to a driver specific implementation of NVS_open().
Definition: NVS.h:291
int NVS_control(NVS_Handle handle, unsigned int cmd, uintptr_t arg)
Function performs implementation specific features on a given NVS_Handle.
bool eraseOnOpen
Definition: NVS.h:223
void(* NVS_CloseFxn)(NVS_Handle handle)
A function pointer to a driver specific implementation of NVS_close().
Definition: NVS.h:260
NVS_GetAttrsFxn getAttrsFxn
Definition: NVS.h:324
struct NVS_Config NVS_Config
NVS Global configuration.
NVS_ReadFxn readFxn
Definition: NVS.h:333
void(* NVS_ExitFxn)(NVS_Handle handle)
A function pointer to a driver specific implementation of NVS_exit().
Definition: NVS.h:273
NVS_WriteFxn writeFxn
Definition: NVS.h:336
int(* NVS_WriteFxn)(NVS_Handle handle, size_t offset, void *buffer, size_t bufferSize, unsigned int flags)
A function pointer to a driver specific implementation of NVS_write().
Definition: NVS.h:304
void NVS_init(void)
Function to initialize the NVS module.
NVS Parameters.
Definition: NVS.h:222
NVS_ControlFxn controlFxn
Definition: NVS.h:318
size_t pageSize
Definition: NVS.h:247
struct NVS_Config * NVS_Handle
A handle that is returned from the NVS_open() call.
Definition: NVS.h:254
void(* NVS_InitFxn)(NVS_Handle handle)
A function pointer to a driver specific implementation of NVS_init().
Definition: NVS.h:285
int NVS_read(NVS_Handle handle, size_t offset, void *buffer, size_t bufferSize)
Read data from an NVS block.
NVS_InitFxn initFxn
Definition: NVS.h:327
NVS_Handle NVS_open(int index, NVS_Params *params)
Get an NVS block for reading and writing.
void NVS_close(NVS_Handle handle)
Function to close an NVS handle.
NVS_OpenFxn openFxn
Definition: NVS.h:330
int NVS_erase(NVS_Handle handle)
Erase the block of storage reference by an NVS handle.
NVS_FxnTable const * fxnTablePtr
Definition: NVS.h:352
The definition of an NVS function table that contains the required set of functions to control a spec...
Definition: NVS.h:313
int(* NVS_ControlFxn)(NVS_Handle handle, unsigned int cmd, uintptr_t arg)
A function pointer to a driver specific implementation of NVS_control().
Definition: NVS.h:266
NVS_ExitFxn exitFxn
Definition: NVS.h:321
int NVS_getAttrs(NVS_Handle handle, NVS_Attrs *attrs)
Function to get the NVS attributes.
int(* NVS_ReadFxn)(NVS_Handle handle, size_t offset, void *buffer, size_t bufferSize)
A function pointer to a driver specific implementation of NVS_read().
Definition: NVS.h:297
size_t blockSize
Definition: NVS.h:248