![]() |
![]() |
TI-RTOS Drivers
tidrivers_full_2_20_01_10
|
![]() |
Macros | |
#define | NVSTiva_CMD_SET_COPYBLOCK NVS_CMD_RESERVED + 0 |
Command to set the copy block for an NVS block. More... | |
NVS_CMD_* macros are general command codes for NVS_control(). Not all NVS driver implementations support these command codes.
NVSTiva_CMD_* macros are command codes only defined in the NVSTiva.h driver implementation and need to:
#define NVSTiva_CMD_SET_COPYBLOCK NVS_CMD_RESERVED + 0 |
Command to set the copy block for an NVS block.
Passing NVSTiva_CMD_SET_COPYBLOCK to NVS_control(), along with a block of memory, is used to set the copy block for an NVSTiva_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 NVSTiva_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.