Renesas PTX1xxR IoT-Reader API Version 7.3.1
Renesas Software Stack for IoT-Reader Applications
Data Structures | Macros | Typedefs | Enumerations | Functions
ptxNvm.h File Reference
#include "ptx_Status.h"
#include <stddef.h>
Include dependency graph for ptxNvm.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

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.
 

Detailed Description

SPDX-License-Identifier: BSD-3-Clause

Copyright (c) 2026, Renesas Electronics Corporation and/or its affiliates

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of Renesas nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY Renesas "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RENESAS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT

OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Project : PTX1K Module : TB/Integration/NVM File : ptxNvm.h

Description :