194 #ifndef ti_drivers_NVS__include 195 #define ti_drivers_NVS__include 201 #if defined (__cplusplus) 222 #define NVS_CMD_RESERVED (32) 236 #define NVS_STATUS_RESERVED (-32) 253 #define NVS_STATUS_SUCCESS (0) 262 #define NVS_STATUS_ERROR (-1) 271 #define NVS_STATUS_UNDEFINEDCMD (-2) 278 #define NVS_STATUS_TIMEOUT (-3) 286 #define NVS_STATUS_INV_OFFSET (-4) 294 #define NVS_STATUS_INV_ALIGNMENT (-5) 303 #define NVS_STATUS_INV_SIZE (-6) 312 #define NVS_STATUS_INV_WRITE (-7) 346 #define NVS_WRITE_ERASE (0x1) 356 #define NVS_WRITE_PRE_VERIFY (0x2) 365 #define NVS_WRITE_POST_VERIFY (0x4) 377 #define NVS_LOCK_WAIT_FOREVER (~(0U)) 382 #define NVS_LOCK_NO_WAIT (0U) 398 #define NVS_REGION_NOT_ADDRESSABLE ((void *)(~(0U))) 459 typedef int_fast16_t (*
NVS_EraseFxn) (NVS_Handle handle,
size_t offset,
484 typedef int_fast16_t (*
NVS_ReadFxn) (NVS_Handle handle,
size_t offset,
485 void *buffer,
size_t bufferSize);
491 typedef int_fast16_t (*
NVS_WriteFxn) (NVS_Handle handle,
size_t offset,
492 void *buffer,
size_t bufferSize,
493 uint_fast16_t flags);
499 typedef int_fast16_t (*
NVS_LockFxn) (NVS_Handle handle, uint32_t timeout);
573 extern void NVS_close(NVS_Handle handle);
594 extern int_fast16_t
NVS_control(NVS_Handle handle, uint_fast16_t cmd, uintptr_t arg);
626 extern int_fast16_t
NVS_erase(NVS_Handle handle,
size_t offset,
size_t size);
674 extern int_fast16_t
NVS_lock(NVS_Handle handle, uint32_t timeout);
719 extern int_fast16_t
NVS_read(NVS_Handle handle,
size_t offset,
void *buffer,
772 extern int_fast16_t
NVS_write(NVS_Handle handle,
size_t offset,
void *buffer,
773 size_t bufferSize, uint_fast16_t flags);
775 #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:560
struct NVS_Attrs NVS_Attrs
NVS attributes.
NVS attributes.
Definition: NVS.h:431
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:478
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:411
void(* NVS_GetAttrsFxn)(NVS_Handle handle, NVS_Attrs *attrs)
A function pointer to a driver specific implementation of NVS_getAttrs().
Definition: NVS.h:466
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:459
NVS_CloseFxn closeFxn
Definition: NVS.h:514
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 an NVS region.
struct NVS_Config_ * NVS_Handle
A handle that is returned from the NVS_open() call.
Definition: NVS.h:440
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 b...
void(* NVS_CloseFxn)(NVS_Handle handle)
A function pointer to a driver specific implementation of NVS_close().
Definition: NVS.h:446
NVS_GetAttrsFxn getAttrsFxn
Definition: NVS.h:523
void NVS_unlock(NVS_Handle handle)
Function to unlock the NVS driver.
size_t sectorSize
Definition: NVS.h:434
size_t regionSize
Definition: NVS.h:433
struct NVS_Config_ NVS_Config
NVS Global configuration.
NVS_ReadFxn readFxn
Definition: NVS.h:535
void * regionBase
Definition: NVS.h:432
NVS_LockFxn lockFxn
Definition: NVS.h:529
void(* NVS_InitFxn)(void)
A function pointer to a driver specific implementation of NVS_init().
Definition: NVS.h:472
NVS_WriteFxn writeFxn
Definition: NVS.h:541
void NVS_init(void)
Function to initialize the NVS module.
NVS Parameters.
Definition: NVS.h:410
NVS_ControlFxn controlFxn
Definition: NVS.h:517
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:484
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:491
NVS_EraseFxn eraseFxn
Definition: NVS.h:520
NVS_InitFxn initFxn
Definition: NVS.h:526
NVS_FxnTable const * fxnTablePtr
Definition: NVS.h:557
void NVS_close(NVS_Handle handle)
Function to close an NVS handle.
NVS_OpenFxn openFxn
Definition: NVS.h:532
void(* NVS_UnlockFxn)(NVS_Handle handle)
A function pointer to a driver specific implementation of NVS_unlock().
Definition: NVS.h:505
int_fast16_t NVS_lock(NVS_Handle handle, uint32_t timeout)
Function to lock the NVS driver.
NVS Global configuration.
Definition: NVS.h:555
int_fast16_t NVS_read(NVS_Handle handle, size_t offset, void *buffer, size_t bufferSize)
Read data from an NVS region.
void NVS_getAttrs(NVS_Handle handle, NVS_Attrs *attrs)
Function to get the NVS attributes.
void const * hwAttrs
Definition: NVS.h:563
The definition of an NVS function table that contains the required set of functions to control a spec...
Definition: NVS.h:512
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:499
NVS_UnlockFxn unlockFxn
Definition: NVS.h:538
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:452