TI-RTOS Drivers
tidrivers_msp43x_2_16_01_13
|
#include <stdint.h>
#include <stdbool.h>
Go to the source code of this file.
Data Structures | |
struct | NVSMSP432_CmdSetCopyBlockArgs |
NVSMSP432 command structure for setting copy block. More... | |
struct | NVSMSP432_HWAttrs |
NVSMSP432 attributes. More... | |
struct | NVSMSP432_Object |
Macros | |
#define | NVSMSP432_CMD_SET_COPYBLOCK NVS_CMD_RESERVED + 0 |
Command to set the copy block for an NVS block. More... | |
#define | NVSMSP432_STATUS_ECOPYBLOCK (NVS_STATUS_RESERVED - 1) |
Alignment error returned by NVSMSP432_control(). More... | |
Typedefs | |
typedef struct NVSMSP432_CmdSetCopyBlockArgs | NVSMSP432_CmdSetCopyBlockArgs |
NVSMSP432 command structure for setting copy block. More... | |
typedef struct NVSMSP432_HWAttrs | NVSMSP432_HWAttrs |
NVSMSP432 attributes. More... | |
typedef struct NVSMSP432_Object | NVSMSP432_Object |
Variables | |
const NVS_FxnTable | NVSMSP432_fxnTable |
#define NVSMSP432_CMD_SET_COPYBLOCK NVS_CMD_RESERVED + 0 |
Command to set the copy block for an NVS block.
Passing NVSMSP432_CMD_SET_COPYBLOCK to NVS_control(), along with a block of memory, is used to set the copy block for an NVSMSP432_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 NVSMSP432_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.
#define NVSMSP432_STATUS_ECOPYBLOCK (NVS_STATUS_RESERVED - 1) |
Alignment error returned by NVSMSP432_control().
This error is returned if the copy block passed to NVSMSP432_control() is not aligned on a 4-byte boundary, or is NULL.
typedef struct NVSMSP432_CmdSetCopyBlockArgs NVSMSP432_CmdSetCopyBlockArgs |
NVSMSP432 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.
typedef struct NVSMSP432_HWAttrs NVSMSP432_HWAttrs |
NVSMSP432 attributes.
The block is the address of a region in flash of size blockSize bytes.
For MSP432 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.
typedef struct NVSMSP432_Object NVSMSP432_Object |
const NVS_FxnTable NVSMSP432_fxnTable |