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

Go to the source code of this file.

Data Structures

struct  NVSCC3200_CmdSetCopyBlockArgs
 NVSCC3200 command structure for setting copy block. More...
 
struct  NVSCC3200_HWAttrs
 NVSCC3200 attributes. More...
 
struct  NVSCC3200_Object
 

Macros

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

Typedefs

typedef struct NVSCC3200_CmdSetCopyBlockArgs NVSCC3200_CmdSetCopyBlockArgs
 NVSCC3200 command structure for setting copy block. More...
 
typedef struct NVSCC3200_HWAttrs NVSCC3200_HWAttrs
 NVSCC3200 attributes. More...
 
typedef struct NVSCC3200_Object NVSCC3200_Object
 

Variables

const NVS_FxnTable NVSCC3200_fxnTable
 

Macro Definition Documentation

#define NVSCC3200_CMD_SET_COPYBLOCK   NVS_CMD_RESERVED + 0

Command to set the copy block for an NVS block.

Passing NVSCC3200_CMD_SET_COPYBLOCK to NVS_control(), along with a block of memory, is used to set the copy block for an NVSCC3200_HWAttrs structure. The copy block is a RAM buffer used as scratch when writing to non-volatile storage.

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 NVSCC3200_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 flash page size, and it is up to the application to ensure this.

See also
NVSCC3200_HWAttrs
#define NVSCC3200_STATUS_ECOPYBLOCK   (NVS_STATUS_RESERVED - 1)

Alignment error returned by NVSCC3200_control().

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

See also
NVSCC3200_HWAttrs

Typedef Documentation

NVSCC3200 command structure for setting copy block.

This structure is used to hold the copy block information that is passed to NVS_control().

NVSCC3200 attributes.

For CC3200 devices, there is no need to provide the flash block address, since this is managed by the SimpleLink libraries. The SimpleLink libraries use the notion of "files" to manage flash blocks. We use the id field of the NVSCC3200_HWAttrs to construct a file name that will correspond to a flash block.

When a file is written to, a scratch region is needed to preserve the unmodified data in the file. This scratch region, referred to as copyBlock, should be 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(). The copyBlock should be large enough to hold the maximum file size of 4 Kbytes. When writing data to a file, the contents of the file are first copied to the copyBlock. The copyBlock is then updated with the new data, and then written back to the file.

Variable Documentation

const NVS_FxnTable NVSCC3200_fxnTable
Copyright 2016, Texas Instruments Incorporated