Data Structures | Typedefs | Variables
NVSRAM.h File Reference

Detailed Description

RAM implementation of the NVS driver.

============================================================================

This NVS driver implementation makes use of RAM instead of FLASH memory. It can be used for developing code which relies the NVS driver without wearing down FLASH memory.

The NVS header file should be included in an application as follows:


#include <stdint.h>
#include <stdbool.h>
Include dependency graph for NVSRAM.h:

Go to the source code of this file.

Data Structures

struct  NVSRAM_HWAttrs
 NVSRAM Hardware Attributes. More...
 
struct  NVSRAM_Object
 

Typedefs

typedef struct NVSRAM_HWAttrs NVSRAM_HWAttrs
 NVSRAM Hardware Attributes. More...
 
typedef struct NVSRAM_Object NVSRAM_Object
 

Variables

const NVS_FxnTable NVSRAM_fxnTable
 

Typedef Documentation

§ NVSRAM_HWAttrs

NVSRAM Hardware Attributes.

The 'sectorSize' is the minimal amount of data to that is cleared on an erase operation. Devices which feature internal FLASH memory usually have a 4096 byte sector size (refer to device specific documentation). It is recommended that the 'sectorSize' used match the FLASH memory sector size.

The 'regionBase' field must point to the base address of the region to be managed. It is also required that the region be aligned on a sectorSize boundary (example below to demonstrate how to do this).

The 'regionSize' must be an integer multiple of the 'sectorSize'.

Defining and reserving RAM memory regions can be done entirely within the Board.c file.

The example below defines a char array, 'ramBuf' and uses compiler pragmas to place 'ramBuf' at an aligned address within RAM.

#define SECTORSIZE (4096)
static char ramBuf[SECTORSIZE * 4] __attribute__ ((aligned (4096)));
NVSRAM_HWAttrs NVSRAMHWAttrs[1] = {
{
.regionBase = (void *) ramBuf,
.regionSize = SECTORSIZE * 4,
.sectorSize = SECTORSIZE
}
};

§ NVSRAM_Object

typedef struct NVSRAM_Object NVSRAM_Object

Variable Documentation

§ NVSRAM_fxnTable

const NVS_FxnTable NVSRAM_fxnTable
© Copyright 1995-2018, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale