DRV_SST26_Read Function

C

bool DRV_SST26_Read( const DRV_HANDLE handle, void *rx_data, uint32_t rx_data_length, uint32_t address );

Summary

Reads n bytes of data from the specified start address of flash memory.

Description

This function schedules a blocking operation for reading requested number of data bytes from the flash memory.

Precondition

The DRV_SST26_Open() routine must have been called for the specified SST26 driver instance.

Parameters

ParamDescription
handleA valid open-instance handle, returned from the driver's open routine
*rx_dataBuffer pointer into which the data read from the SST26 Flash memory will be placed.
rx_data_lengthTotal number of bytes to be read.
addressRead memory start address from where the data should be read.

Returns

true - if number of bytes requested are read from flash memory

false - if read command itself fails

Example

#define BUFFER_SIZE 1024
#define MEM_ADDRESS 0x0

DRV_HANDLE handle; // Returned from DRV_SST26_Open
uint8_t CACHE_ALIGN readBuffer[BUFFER_SIZE];

if (DRV_SST26_Read(handle, (void *)&readBuffer, BUFFER_SIZE, MEM_ADDRESS) == false)
{
    // Error handling here
}

// Wait for read to be completed
while(DRV_SST26_TransferStatusGet(handle) == DRV_SST26_TRANSFER_BUSY);

Remarks

None.