- Main Page
- Data Structures
- Files
- Directories

- File List
- Globals

# xilisf_read.c File Reference

`#include "include/xilisf.h"`

## Functions
int | XIsf_Read (XIsf *InstancePtr, XIsf_ReadOperation Operation, void *OpParamPtr)

## Detailed Description

This file contains the library functions to read data from the Serial Flash devices. Refer xilisf.h for detailed description.

     MODIFICATION HISTORY:

     Ver   Who      Date     Changes
     ----- -------  -------- -----------------------------------------------
     1.00a ksu/sdm  03/03/08 First release
     2.01a sdm      01/04/10 Added Support for Winbond W25QXX/W25XX devices
     2.04a sdm      08/17/10 Updated to support Numonyx (N25QXX) and Spansion
    			  flash memories

## Function Documentation

int XIsf_Read | ( | XIsf * | InstancePtr,
|  | XIsf_ReadOperation | Operation,
|  | void * | OpParamPtr
| ) |

  | This API reads the data from the Serial Flash. Parameters:
  | InstancePtr | is a pointer to the XIsf instance.
  | Operation | is the type of the read operation to be performed on the Serial Flash. The different operations are XISF_READ: Normal Read XISF_FAST_READ: Fast Read XISF_PAGE_TO_BUF_TRANS: Page to Buffer Transfer XISF_BUFFER_READ: Buffer Read XISF_FAST_BUFFER_READ: Fast Buffer Read XISF_OTP_READ: One Time Programmable Area (OTP) Read XISF_DUAL_OP_FAST_READ: Dual Output Fast Read XISF_DUAL_IO_FAST_READ: Dual Input/Output Fast Read XISF_QUAD_OP_FAST_READ: Quad Output Fast Read XISF_QUAD_IO_FAST_READ: Quad Input/Output Fast Read
  | OpParamPtr | is the pointer to structure variable which contains operational parameter of specified Operation. This parameter type is dependant on the type of Operation to be performed.
Normal Read (XISF_READ), Fast Read (XISF_FAST_READ), One Time Programmable Area Read(XISF_OTP_READ), Dual Output Fast Read (XISF_CMD_DUAL_OP_FAST_READ), Dual Input/Output Fast Read (XISF_CMD_DUAL_IO_FAST_READ), Quad Output Fast Read (XISF_CMD_QUAD_OP_FAST_READ) and Quad Input/Output Fast Read (XISF_CMD_QUAD_IO_FAST_READ): The OpParamPtr must be of type struct XIsf_ReadParam. OpParamPtr->Address is start address in the Serial Flash. OpParamPtr->ReadPtr is a pointer to the memory where the data read from the Serial Flash is stored. OpParamPtr->NumBytes is number of bytes to read. OpParamPtr->NumDummyBytes is the number of dummy bytes to be transmitted for the Read command. This parameter is only used in case of Dual and Quad reads. Normal Read and Fast Read operations are supported for Atmel, Intel, STM, Winbond and Spansion Serial Flash. Dual and quad reads are supported for Winbond (W25QXX), Numonyx (N25QXX) and Spansion (S25FL129) quad flash. OTP Read operation is only supported in Intel Serial Flash. Page To Buffer Transfer (XISF_PAGE_TO_BUF_TRANS): The OpParamPtr must be of type struct XIsf_FlashToBufTransferParam . OpParamPtr->BufferNum specifies the internal SRAM Buffer of the Serial Flash. The valid values are XISF_PAGE_BUFFER1 or XISF_PAGE_BUFFER2. XISF_PAGE_BUFFER2 is not valid in the case of AT45DB011D Flash as it contains a single buffer. OpParamPtr->Address is start address in the Serial Flash. This operation is only supported in Atmel Serial Flash. Buffer Read (XISF_BUFFER_READ) and Fast Buffer Read (XISF_FAST_BUFFER_READ): The OpParamPtr must be of type struct XIsf_BufferReadParam. OpParamPtr->BufferNum specifies the internal SRAM Buffer of the Serial Flash. The valid values are XISF_PAGE_BUFFER1 or XISF_PAGE_BUFFER2. XISF_PAGE_BUFFER2 is not valid in case of AT45DB011D Flash as it contains a single buffer. OpParamPtr->ReadPtr is pointer to the memory where the data read from the SRAM buffer is to be stored. OpParamPtr->ByteOffset is byte offset in the SRAM buffer from where the first byte is read. OpParamPtr->NumBytes is the number of bytes to be read from the Buffer. These operations are supported only in Atmel Serial Flash. Returns: XST_SUCCESS if successful else XST_FAILURE. Note: Application must fill the structure elements of the third argument and pass its pointer by type casting it with void pointer. The valid data is available from the fourth location pointed to by the ReadPtr for Normal Read and Buffer Read operations. The valid data is available from the fifth location pointed to by the ReadPtr for Fast Read, Fast Buffer Read and OTP Read operations. The valid data is available from the (4 + NumDummyBytes)th location pointed to by ReadPtr for Dual/Quad Read operations.