71#define PTX_NVM_MAX_PATH_LEN 256U
uint16_t ptxStatus_t
Status Type.
Definition ptx_Status.h:82
ptxStatus_t ptxNvm_FileClose(ptxNvm_t *nvm, ptxFileHandle_t *fileHandle)
Wrapper for fclose operation. Closes the file stream and breaks all connections to a file.
ptxStatus_t ptxNvm_SetPath(ptxNvm_t *nvm, const char *nvmPath)
Set the path for the NVM.
enum ptxNvm_FileMode ptxNvm_FileMode_t
File access mode values used for file handling functions.
struct ptxNvm ptxNvm_t
Main Nvm Component.
ptxStatus_t(* pptxNvm_IsRecordCreated_t)(struct ptxNvm *nvm, ptxNvmRecord_t *nvmRecord)
Function pointer as this module is going to be delegated.
Definition ptxNvm.h:129
ptxStatus_t(* pptxNvm_Read_t)(struct ptxNvm *nvm, uint8_t *buffer, size_t bufferLen, ptxNvmRecord_t *nvmRecord)
Function pointer as this module is going to be delegated.
Definition ptxNvm.h:114
ptxStatus_t ptxNvm_Init(ptxNvm_t *nvm, uint32_t swId)
Initialize the NVM.
ptxStatus_t ptxNvm_Write_And_Flush(ptxNvm_t *nvm, uint8_t *buffer, size_t bufferLen, ptxNvmRecord_t *nvmRecord)
Same as ptxNvm_Write but writes potentially OS-cached file content directly to the file.
ptxStatus_t ptxNvm_FileOpen(ptxNvm_t *nvm, const char *fileNameID, ptxNvm_FileMode_t fileMode, uint8_t isBinary, ptxFileHandle_t *fileHandle)
Wrapper for fopen operation. Opens the file with given parameters.
ptxNvm_FileMode
File access mode values used for file handling functions.
Definition ptxNvm.h:77
ptxStatus_t(* pptxNvm_CreateRecord_t)(struct ptxNvm *nvm, uint8_t *buffer, size_t bufferLen, ptxNvmRecord_t *nvmRecord)
Function pointer as this module is going to be delegated.
Definition ptxNvm.h:124
ptxStatus_t ptxNvm_IsRecordCreated(ptxNvm_t *nvm, ptxNvmRecord_t *nvmRecord)
It check if an nvm record already exists.
ptxStatus_t ptxNvm_FileWrite(ptxNvm_t *nvm, ptxFileHandle_t *fileHandle, uint8_t *dataBlock, size_t dataBlockSize)
Wrapper for fwrite operation. Writes data to a file.
ptxStatus_t ptxNvm_Read(ptxNvm_t *nvm, uint8_t *buffer, size_t bufferLen, ptxNvmRecord_t *nvmRecord)
It loads from NVM record to the provided buffer.
struct ptxFileHandle ptxFileHandle_t
File Handle wrapper structure.
#define PTX_NVM_MAX_PATH_LEN
Definition ptxNvm.h:71
struct ptxNvmRecord ptxNvmRecord_t
Nvm Record instance. It will be platform dependent.
ptxStatus_t(* pptxNvm_Write_t)(struct ptxNvm *nvm, uint8_t *buffer, size_t bufferLen, ptxNvmRecord_t *nvmRecord)
Function pointer as this module is going to be delegated.
Definition ptxNvm.h:119
ptxStatus_t ptxNvm_DeInit(ptxNvm_t *nvm)
De-Initialize the NVM.
ptxStatus_t ptxNvm_FileRead(ptxNvm_t *nvm, ptxFileHandle_t *fileHandle, uint8_t *dataBlock, size_t *dataBlockSize)
Wrapper for fread operation. Reads data from a file.
ptxStatus_t ptxNvm_CreateRecord(ptxNvm_t *nvm, uint8_t *buffer, size_t bufferLen, ptxNvmRecord_t *nvmRecord)
It creates a record if it does not exist. It the Record already exists no action is performed.
ptxStatus_t ptxNvm_Write(ptxNvm_t *nvm, uint8_t *buffer, size_t bufferLen, ptxNvmRecord_t *nvmRecord)
It writes to NVM record from the provided buffer.
@ ptxNvm_FileMode_ReadUpdate
Definition ptxNvm.h:82
@ ptxNvm_FileMode_Append
Definition ptxNvm.h:81
@ ptxNvm_FileMode_AppendUpdate
Definition ptxNvm.h:84
@ ptxNvm_FileMode_Write
Definition ptxNvm.h:80
@ ptxNvm_FileMode_WriteUpdate
Definition ptxNvm.h:83
@ ptxNvm_FileMode_Read
Definition ptxNvm.h:79
File Handle wrapper structure.
Definition ptxNvm.h:91
ptxNvm_FileMode_t Mode
Definition ptxNvm.h:93
void * F
Definition ptxNvm.h:92
Main Nvm Component.
Definition ptxNvm.h:140
pptxNvm_Read_t ReadFn
Definition ptxNvm.h:152
uint8_t IsPathProvided
Definition ptxNvm.h:147
char Path[PTX_NVM_MAX_PATH_LEN]
Definition ptxNvm.h:146
uint32_t SwId
Definition ptxNvm.h:145
pptxNvm_CreateRecord_t CreateRecordFn
Definition ptxNvm.h:154
pptxNvm_IsRecordCreated_t IsRecordCreatedFn
Definition ptxNvm.h:155
char * prefix
Definition ptxNvm.h:144
pptxNvm_Write_t WriteFn
Definition ptxNvm.h:153
Nvm Record instance. It will be platform dependent.
Definition ptxNvm.h:100
void * F
Definition ptxNvm.h:101
char * NvmName
Definition ptxNvm.h:102
size_t Length
Definition ptxNvm.h:103