TI-RTOS Drivers  tidrivers_full_2_20_00_08
Data Structures | Macros | Typedefs | Variables
NVSCC26XX.h File Reference
#include <stdint.h>
#include <stdbool.h>
Include dependency graph for NVSCC26XX.h:

Go to the source code of this file.

Data Structures

struct  NVSCC26XX_CmdSetCopyBlockArgs
 NVSCC26XX command structure for setting copy block. More...
 
struct  NVSCC26XX_HWAttrs
 NVSCC26XX attributes. More...
 
struct  NVSCC26XX_Object
 

Macros

#define NVSCC26XX_CMD_SET_COPYBLOCK   NVS_CMD_RESERVED + 0
 Command to set the copy block for an NVS block. More...
 
#define NVSCC26XX_STATUS_ECOPYBLOCK   (NVS_STATUS_RESERVED - 1)
 Alignment error returned by NVSCC26XX_control(). More...
 

Typedefs

typedef struct NVSCC26XX_CmdSetCopyBlockArgs NVSCC26XX_CmdSetCopyBlockArgs
 NVSCC26XX command structure for setting copy block. More...
 
typedef struct NVSCC26XX_HWAttrs NVSCC26XX_HWAttrs
 NVSCC26XX attributes. More...
 
typedef struct NVSCC26XX_Object NVSCC26XX_Object
 

Variables

const NVS_FxnTable NVSCC26XX_fxnTable
 

Macro Definition Documentation

#define NVSCC26XX_CMD_SET_COPYBLOCK   NVS_CMD_RESERVED + 0

Command to set the copy block for an NVS block.

Passing NVSCC26XX_CMD_SET_COPYBLOCK to NVS_control(), along with a block of memory, is used to set the copy block for an NVSCC26XX_HWAttrs structure. The copy block is used as scratch when writing to a flash block. Since the block must be erased before writing to it, the data in the block that is outside of the region to be modified, must be preserved. It will be copied into the copy block, along with the buffer of data passed to NVS_write(). The block is then erased and the copy block copied back to the block. If the copy block is not known at compile time, for example, if it is allocated from heap memory, it can be set through NVS_control() using the command NVSCC26XX_CMD_SET_COPYBLOCK. The copy block is passed in the arg parameter of NVS_control(). The size of the copy block passed to NVS_control() must be at least as large as the block size, and it is up to the application to ensure this.

See also
NVSCC26XX_HWAttrs
#define NVSCC26XX_STATUS_ECOPYBLOCK   (NVS_STATUS_RESERVED - 1)

Alignment error returned by NVSCC26XX_control().

This error is returned if the copy block passed to NVSCC26XX_control() is not aligned on a 4-byte boundary, or is NULL.

See also
NVSCC26XX_HWAttrs

Typedef Documentation

NVSCC26XX command structure for setting copy block.

This structure is used to hold the copy block information that is passed to NVS_control(). If copyBlock is a buffer in RAM, isRam should be set to TRUE. If copyBlock is in Flash, set isRam to FALSE.

NVSCC26XX attributes.

The block is the address of a region in flash of size blockSize bytes.

For CC26XX devices, the smallest erase page size is 4KB, so in most cases, blockSize should be set to 4KB for this device. If the blockSize is less than the page size, care should be taken not to use the rest of the page. A write to the block will cause the entire page to be erased! A blockSize greater than the page size is not supported. The page size for the device can be obtained through NVS_getAttrs().

When the block is written to, a scratch region is needed to preserve the unmodified data in the block. This scratch region, referred to as copyBlock, can be a page in flash or a buffer in RAM. The application can set copyBlock in the HWAttrs directly, if it is known at compile time, or set copyBlock through NVS_control(), for example, if it is allocated on the heap. The copyBlock can be shared accross multiple NVS instances. It is up to the application to ensure that copyBlock is set before the first call to NVS_write(). Using a blockSize less than the page size decreases RAM or heap only if copyBlock is not in flash.

Variable Documentation

const NVS_FxnTable NVSCC26XX_fxnTable
Copyright 2016, Texas Instruments Incorporated