FTC_STATUS
|
SPI_ExecuteCmdSequence
|
(FTC_HANDLE ftHandle, PReadCmdSequenceDataByteBuffer pReadCmdSequenceDataBuffer, LPDWORD lpdwNumBytesReturned)
|
Parameters
ftHandle
|
Handle of the device.
|
pReadCmdSequenceBuffer
|
Pointer to buffer that returns the data read from an external device. Size of buffer should be set to 131071 bytes (128KB).
|
lpdwNumBytesReturned
|
Pointer to the actual number of bytes read from the external device. These bytes contain the total number of bits read as specified in the sequence of read and write/read commands.
|
Return Value
Returns FTC_SUCCESS if successful, otherwise the return value will be one of the following error codes:
FTC_INVALID_HANDLE
FTC_NO_COMMAND_SEQUENCE
FTC_NULL_READ_CMDS_DATA_BUFFER_POINTER
FTC_FAILED_TO_COMPLETE_COMMAND
FTC_IO_ERROR
Remarks
Do not invoke SPI_Write or SPI_Read functions while constructing a sequence of commands as this will clear the sequence of commands and associated data from the internal command buffer.
Calling this function will send the contents of the internal command buffer to the FT2232C in one go.
This function can be used with SPI_ClearDeviceCmdSequence, SPI_AddDeviceWriteCmd and SPI_AddDeviceReadCmd to buffer a long list of commands and data which can then be sent to the FT2232C in one go. This can provide faster data transfer rates in some applications.
Example
FTC_STATUS Status = FTC_SUCCESS;
FTC_HANDLE ftHandle;
ReadCmdSequenceDataByteBuffer ReadCmdSequenceDataBuffer;
DWORD dwNumBytesReturned = 0;
Status = SPI_ExecuteCmdSequence(ftHandle, &ReadCmdSequenceDataBuffer, &dwNumBytesReturned);