189 #ifndef ti_drivers_NVS__include 190 #define ti_drivers_NVS__include 196 #if defined (__cplusplus) 217 #define NVS_CMD_RESERVED (32) 231 #define NVS_STATUS_RESERVED (-32) 248 #define NVS_STATUS_SUCCESS (0) 257 #define NVS_STATUS_ERROR (-1) 266 #define NVS_STATUS_UNDEFINEDCMD (-2) 273 #define NVS_STATUS_TIMEOUT (-3) 282 #define NVS_STATUS_INV_OFFSET (-4) 290 #define NVS_STATUS_INV_ALIGNMENT (-5) 299 #define NVS_STATUS_INV_SIZE (-6) 308 #define NVS_STATUS_INV_WRITE (-7) 342 #define NVS_WRITE_ERASE (0x1) 352 #define NVS_WRITE_PRE_VERIFY (0x2) 361 #define NVS_WRITE_POST_VERIFY (0x4) 373 #define NVS_LOCK_WAIT_FOREVER (~(0U)) 378 #define NVS_LOCK_NO_WAIT (0U) 394 #define NVS_REGION_NOT_ADDRESSABLE ((void *)(~(0U))) 449 typedef int_fast16_t (*
NVS_EraseFxn) (NVS_Handle handle,
size_t offset,
474 typedef int_fast16_t (*
NVS_ReadFxn) (NVS_Handle handle,
size_t offset,
475 void *buffer,
size_t bufferSize);
481 typedef int_fast16_t (*
NVS_WriteFxn) (NVS_Handle handle,
size_t offset,
482 void *buffer,
size_t bufferSize,
483 uint_fast16_t flags);
489 typedef int_fast16_t (*
NVS_LockFxn) (NVS_Handle handle, uint32_t timeout);
563 extern void NVS_close(NVS_Handle handle);
584 extern int_fast16_t
NVS_control(NVS_Handle handle, uint_fast16_t cmd, uintptr_t arg);
616 extern int_fast16_t
NVS_erase(NVS_Handle handle,
size_t offset,
size_t size);
667 extern int_fast16_t
NVS_lock(NVS_Handle handle, uint32_t timeout);
708 extern int_fast16_t
NVS_read(NVS_Handle handle,
size_t offset,
void *buffer,
761 extern int_fast16_t
NVS_write(NVS_Handle handle,
size_t offset,
void *buffer,
762 size_t bufferSize, uint_fast16_t flags);
764 #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...
void * object
Definition: NVS.h:550
struct NVS_Attrs NVS_Attrs
NVS attributes.
NVS attributes.
Definition: NVS.h:417
NVS_Handle(* NVS_OpenFxn)(uint_least8_t index, NVS_Params *params)
A function pointer to a driver specific implementation of NVS_open().
Definition: NVS.h:468
int_fast16_t NVS_control(NVS_Handle handle, uint_fast16_t cmd, uintptr_t arg)
Function performs implementation specific features on a given NVS_Handle.
void * custom
Definition: NVS.h:407
void(* NVS_GetAttrsFxn)(NVS_Handle handle, NVS_Attrs *attrs)
A function pointer to a driver specific implementation of NVS_getAttrs().
Definition: NVS.h:456
int_fast16_t(* NVS_EraseFxn)(NVS_Handle handle, size_t offset, size_t size)
A function pointer to a driver specific implementation of NVS_erase().
Definition: NVS.h:449
NVS_CloseFxn closeFxn
Definition: NVS.h:504
struct NVS_Params NVS_Params
NVS Parameters.
int_fast16_t NVS_write(NVS_Handle handle, size_t offset, void *buffer, size_t bufferSize, uint_fast16_t flags)
Write data to the NVS region associated with the NVS_Handle.
struct NVS_Config_ * NVS_Handle
A handle that is returned from the NVS_open() call.
Definition: NVS.h:430
NVS_Handle NVS_open(uint_least8_t index, NVS_Params *params)
Open an NVS region for reading and writing.
void NVS_Params_init(NVS_Params *params)
Function to initialize the NVS_Params struct to its defaults.
int_fast16_t NVS_erase(NVS_Handle handle, size_t offset, size_t size)
Erase size bytes of the region beginning at offset bytes from the base of the region referenced by th...
void(* NVS_CloseFxn)(NVS_Handle handle)
A function pointer to a driver specific implementation of NVS_close().
Definition: NVS.h:436
NVS_GetAttrsFxn getAttrsFxn
Definition: NVS.h:513
void NVS_unlock(NVS_Handle handle)
Function to unlock the NVS driver.
size_t sectorSize
Definition: NVS.h:423
size_t regionSize
Definition: NVS.h:422
struct NVS_Config_ NVS_Config
NVS Global configuration.
NVS_ReadFxn readFxn
Definition: NVS.h:525
void * regionBase
Definition: NVS.h:418
NVS_LockFxn lockFxn
Definition: NVS.h:519
void(* NVS_InitFxn)(void)
A function pointer to a driver specific implementation of NVS_init().
Definition: NVS.h:462
NVS_WriteFxn writeFxn
Definition: NVS.h:531
void NVS_init(void)
Function to initialize the NVS module.
NVS Parameters.
Definition: NVS.h:406
NVS_ControlFxn controlFxn
Definition: NVS.h:507
int_fast16_t(* 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:474
int_fast16_t(* NVS_WriteFxn)(NVS_Handle handle, size_t offset, void *buffer, size_t bufferSize, uint_fast16_t flags)
A function pointer to a driver specific implementation of NVS_write().
Definition: NVS.h:481
NVS_EraseFxn eraseFxn
Definition: NVS.h:510
NVS_InitFxn initFxn
Definition: NVS.h:516
NVS_FxnTable const * fxnTablePtr
Definition: NVS.h:547
void NVS_close(NVS_Handle handle)
Function to close an NVS_Handle.
NVS_OpenFxn openFxn
Definition: NVS.h:522
void(* NVS_UnlockFxn)(NVS_Handle handle)
A function pointer to a driver specific implementation of NVS_unlock().
Definition: NVS.h:495
int_fast16_t NVS_lock(NVS_Handle handle, uint32_t timeout)
Function to lock the NVS driver.
NVS Global configuration.
Definition: NVS.h:545
int_fast16_t NVS_read(NVS_Handle handle, size_t offset, void *buffer, size_t bufferSize)
Read data from the NVS region associated with the NVS_Handle.
void NVS_getAttrs(NVS_Handle handle, NVS_Attrs *attrs)
Function to get the NVS attributes.
void const * hwAttrs
Definition: NVS.h:553
The definition of an NVS function table that contains the required set of functions to control a spec...
Definition: NVS.h:502
int_fast16_t(* NVS_LockFxn)(NVS_Handle handle, uint32_t timeout)
A function pointer to a driver specific implementation of NVS_lock().
Definition: NVS.h:489
NVS_UnlockFxn unlockFxn
Definition: NVS.h:528
int_fast16_t(* NVS_ControlFxn)(NVS_Handle handle, uint_fast16_t cmd, uintptr_t arg)
A function pointer to a driver specific implementation of NVS_control().
Definition: NVS.h:442