|
Renesas PTX1xxR IoT-Reader API Version 7.3.1
Renesas Software Stack for IoT-Reader Applications
|

Data Structures | |
| struct | ptxFileHandle |
| File Handle wrapper structure. More... | |
| struct | ptxNvmRecord |
| Nvm Record instance. It will be platform dependent. More... | |
| struct | ptxNvm |
| Main Nvm Component. More... | |
Macros | |
| #define | PTX_NVM_MAX_PATH_LEN 256U |
Typedefs | |
| typedef enum ptxNvm_FileMode | ptxNvm_FileMode_t |
| File access mode values used for file handling functions. | |
| typedef struct ptxFileHandle | ptxFileHandle_t |
| File Handle wrapper structure. | |
| typedef struct ptxNvmRecord | ptxNvmRecord_t |
| Nvm Record instance. It will be platform dependent. | |
| typedef 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. | |
| typedef 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. | |
| typedef 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. | |
| typedef ptxStatus_t(* | pptxNvm_IsRecordCreated_t) (struct ptxNvm *nvm, ptxNvmRecord_t *nvmRecord) |
| Function pointer as this module is going to be delegated. | |
| typedef struct ptxNvm | ptxNvm_t |
| Main Nvm Component. | |
Enumerations | |
| enum | ptxNvm_FileMode { ptxNvm_FileMode_None , ptxNvm_FileMode_Read , ptxNvm_FileMode_Write , ptxNvm_FileMode_Append , ptxNvm_FileMode_ReadUpdate , ptxNvm_FileMode_WriteUpdate , ptxNvm_FileMode_AppendUpdate } |
| File access mode values used for file handling functions. More... | |
Functions | |
| ptxStatus_t | ptxNvm_Init (ptxNvm_t *nvm, uint32_t swId) |
| Initialize the NVM. | |
| ptxStatus_t | ptxNvm_SetPath (ptxNvm_t *nvm, const char *nvmPath) |
| Set the path for the NVM. | |
| ptxStatus_t | ptxNvm_DeInit (ptxNvm_t *nvm) |
| De-Initialize the NVM. | |
| 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. | |
| 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. | |
| 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_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_IsRecordCreated (ptxNvm_t *nvm, ptxNvmRecord_t *nvmRecord) |
| It check if an nvm record already exists. | |
| 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. | |
| 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_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_FileClose (ptxNvm_t *nvm, ptxFileHandle_t *fileHandle) |
| Wrapper for fclose operation. Closes the file stream and breaks all connections to a file. | |
| #define PTX_NVM_MAX_PATH_LEN 256U |
Size of the buffer for the path of the file system.
| enum ptxNvm_FileMode |
File access mode values used for file handling functions.
| Enumerator | |
|---|---|
| ptxNvm_FileMode_Read | Open an existing file for input operations. |
| ptxNvm_FileMode_Write | Create an empty file for output operations. Overwrite (discard) an existing file. |
| ptxNvm_FileMode_Append | Open an existing file to append output to its end or create an empty file if no such file exists yet. |
| ptxNvm_FileMode_ReadUpdate | Open an existing file for input and output operations. |
| ptxNvm_FileMode_WriteUpdate | Like ptxNvm_FileMode_Write, but the file is open for output and input. |
| ptxNvm_FileMode_AppendUpdate | Like ptxNvm_FileMode_AppendUpdate, but the file is open for output and input. |
| 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.
| [in] | nvm | Pointer to an initialized NVM component structure. |
| [in] | buffer | Allocated buffer as content of new record. |
| [in] | bufferLen | Number of bytes to write. |
| [in] | nvmRecord | Pointer to handle of the nvmRecord in that wants to be written. |
| ptxStatus_t ptxNvm_DeInit | ( | ptxNvm_t * | nvm | ) |
De-Initialize the NVM.
| [in] | nvm | Pointer to a initialized NVM component structure. |
| 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.
| [in] | nvm | Pointer to an initialized NVM component structure. |
| [in] | fileHandle | Pointer to the opened file handle structure. |
| 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.
| [in] | nvm | Pointer to an initialized NVM component structure. |
| [in] | fileNameID | The name of the file to open. |
| [in] | fileMode | File access mode. |
| [in] | isBinary | Set to 1 if the file is in binary format. Otherwise 0. |
| [in] | fileHandle | Pointer to the opened file handle structure. |
| 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.
| [in] | nvm | Pointer to an initialized NVM component structure. |
| [in] | fileHandle | Pointer to the opened file handle structure. |
| [out] | dataBlock | Data buffer to receive data from file. |
| [in,out] | dataBlockSize | The number of data bytes to read. If the operation is successful, this parameter value does not change. If an error occurs, this parameter might be set to 0. If the end of a file is reached and not all data could be read out (as requested per this parameter value), the value of this parameter is set to the count of data that was actually read from a file stream. |
| 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.
| [in] | nvm | Pointer to an initialized NVM component structure. |
| [in] | fileHandle | Pointer to the opened file handle structure. |
| [out] | dataBlock | Data buffer holding the data to write. |
| [in] | dataBlockSize | The number of data bytes to write. |
| ptxStatus_t ptxNvm_Init | ( | ptxNvm_t * | nvm, |
| uint32_t | swId ) |
Initialize the NVM.
| [in] | nvm | Pointer to a non-initialized NVM component structure. |
| [in] | swId | swId used for matching between sw version and NVM version. |
| ptxStatus_t ptxNvm_IsRecordCreated | ( | ptxNvm_t * | nvm, |
| ptxNvmRecord_t * | nvmRecord ) |
It check if an nvm record already exists.
| [in] | nvm | Pointer to an initialized NVM component structure. |
| [in] | nvmRecord | Pointer to handle of the nvmRecord. |
| 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.
| [in] | nvm | Pointer to an initialized NVM component structure. |
| [in] | buffer | Allocated buffer where data is going to be filled in. |
| [in] | bufferLen | Number of bytes to read. |
| [in] | nvmRecord | Pointer to handle of the nvmRecord in that wants to be loaded. |
| ptxStatus_t ptxNvm_SetPath | ( | ptxNvm_t * | nvm, |
| const char * | nvmPath ) |
Set the path for the NVM.
| [in] | nvm | Pointer to an allocated NVM component structure. |
| [in] | nvmPath | Path where NVM is located (in case of File System). |
| 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.
| [in] | nvm | Pointer to an initialized NVM component structure. |
| [in] | buffer | Allocated buffer to write to NVM. |
| [in,out] | bufferLen | Number of bytes to write. |
| [in] | nvmRecord | Pointer to handle of the nvmRecord in that wants to be written. |
| 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.
Attention: Due to the flush-operation, this function works slower than ptxNvm_Write, therefore it should only be used in environments where timing is not critical (e.g. Realtime-Logging during debugging.
| [in] | nvm | Pointer to an initialized NVM component structure. |
| [in] | buffer | Allocated buffer to write to NVM. |
| [in,out] | bufferLen | Number of bytes to write. |
| [in] | nvmRecord | Pointer to handle of the nvmRecord in that wants to be written. |