This API reads the data from the Serial Flash.
Operations
- 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 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 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.
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 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.
Prototype
int XIsf_Read(XIsf *InstancePtr, XIsf_ReadOperation Operation, void *OpParamPtr);
Parameters
The following table lists the XIsf_Read
function arguments.
Type | Name | Description |
---|---|---|
XIsf * | InstancePtr | Pointer to the XIsf instance. |
XIsf_ReadOperation | Operation | Type of the read operation to be performed on the Serial Flash. The
different operations are
|
void * | OpParamPtr | Pointer to structure variable which contains operational parameter of
specified Operation. This parameter type is dependant on the type of
Operation to be performed. For more details, refer
Operations
. |