Data Fields
NVSSPI25X_HWAttrs Struct Reference

NVSSPI25X attributes. More...

#include <NVSSPI25X.h>

Collaboration diagram for NVSSPI25X_HWAttrs:
Collaboration graph
[legend]

Data Fields

size_t regionBaseOffset
 
size_t regionSize
 
size_t sectorSize
 
uint8_t * verifyBuf
 
size_t verifyBufSize
 
SPI_HandlespiHandle
 
uint16_t spiIndex
 
uint32_t spiBitRate
 
uint16_t spiCsnGpioIndex
 SPI Flash Chip Select GPIO index. More...
 
uint32_t statusPollDelayUs
 External Flash Status Poll Delay. More...
 

Detailed Description

NVSSPI25X attributes.

The 'regionBaseOffset' is the offset, in bytes, from the base of the SPI flash, of the flash region to be managed.

The 'regionSize' must be an integer multiple of the flash sector size.

The 'sectorSize' is SPI flash device specific. This parameter should correspond to the number of bytes erased when the 'SPIFLASH_SUBSECTOR_ERASE' (0x20) command is issued to the device.

The 'verifyBuf' and 'verifyBufSize' parameters are used by the NVS_write() command when either 'NVS_WRITE_PRE_VERIFY' or 'NVS_WRITE_POST_VERIFY' functions are requested in the 'flags' argument. The 'verifyBuf' is used to successively read back portions of the flash to compare with the data being written to it.

//
// Only one region write operation is performed at a time
// so a single verifyBuf can be shared by all the regions.
//
uint8_t verifyBuf[256];
NVSSPI25X_HWAttrs nvsSPIHWAttrs[2] = {
//
// region 0 is 1 flash sector in length.
//
{
.regionSize = 4096,
.sectorSize = 4096,
.verifyBuf = verifyBuf;
.verifyBufSize = 256;
.spiHandle = NULL,
.spiIndex = 0,
.spiBitRate = 40000000,
.spiCsnGpioIndex = 12,
},
//
// region 1 is 3 flash sectors in length.
//
{
.regionBaseOffset = 4096,
.regionSize = 4096 * 3,
.sectorSize = 4096,
.verifyBuf = verifyBuf; // use shared verifyBuf
.verifyBufSize = 256;
.spiHandle = NULL,
.spiIndex = 0,
.spiBitRate = 40000000,
.spiCsnGpioIndex = 12,
}
};

Field Documentation

§ regionBaseOffset

size_t NVSSPI25X_HWAttrs::regionBaseOffset

Offset from base of SPI flash

§ regionSize

size_t NVSSPI25X_HWAttrs::regionSize

The size of the region in bytes

§ sectorSize

size_t NVSSPI25X_HWAttrs::sectorSize

Erase sector size

§ verifyBuf

uint8_t* NVSSPI25X_HWAttrs::verifyBuf

Write Pre/Post verify buffer

§ verifyBufSize

size_t NVSSPI25X_HWAttrs::verifyBufSize

Write Pre/Post verify buffer size

§ spiHandle

SPI_Handle* NVSSPI25X_HWAttrs::spiHandle

ptr to SPI handle if provided by user.

§ spiIndex

uint16_t NVSSPI25X_HWAttrs::spiIndex

SPI instance index from Board file

§ spiBitRate

uint32_t NVSSPI25X_HWAttrs::spiBitRate

SPI bit rate in Hz

§ spiCsnGpioIndex

uint16_t NVSSPI25X_HWAttrs::spiCsnGpioIndex

SPI Flash Chip Select GPIO index.

This field should be set to either an index within the GPIO driver's GPIO_Config table, or to NVSSPI25X_SPI_MANAGES_CS. see SPI Flash Chip Select Management for more details.

§ statusPollDelayUs

uint32_t NVSSPI25X_HWAttrs::statusPollDelayUs

External Flash Status Poll Delay.

This field determines how many microseconds the driver waits after querying the external flash status. Increasing this value can help mitigate CPU starvation if the external flash is busy for long periods of time, but may also result in increased latency.


The documentation for this struct was generated from the following file:
© Copyright 1995-2019, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale