FTC_STATUS
|
JTAG_Read
|
(FTC_HANDLE ftHandle, BOOL bInstructionTestData, DWORD dwNumBitsToRead, PReadDataByteBuffer pReadDataBuffer, LPDWORD lpdwNumBytesReturned, DWORD dwTapControllerState)
|
Parameters
ftHandle
|
Handle of the device.
|
bInstructionTestData
|
Selects the instruction register (TRUE) or the test register (FALSE) to write data to.
|
dwNumBitsToRead
|
Number of bits to be read from the external device. Valid range is 2 to 524280.
|
pReadDataBuffer
|
Pointer to buffer that returns the data read from an external device. Size of buffer should be set to 65535.
|
lpdwNumBytesReturned
|
Pointer to the actual number of bytes read from the external device.
|
dwTapControllerState
|
State that the Test Access Port (TAP) controller will be left in.
|
Return Value
FTC_SUCCESS if successful, otherwise the return value is one of the following FTC error codes:
FTC_INVALID_HANDLE
FTC_INVALID_NUMBER_BITS
FTC_NULL_READ_DATA_BUFFER_POINTER
FTC_INVALID_TAP_CONTROLLER_STATE
FTC_FAILED_TO_COMPLETE_COMMAND
FTC_IO_ERROR
Remarks
This function will read data from an external device to the FT2232C using the JTAG protocol. The data will be clocked at a rate specified by the clock divisor set by calling either the JTAG_InitDevice or JTAG_SetClock functions.
The read data byte buffer definition and valid TAP controller states are given in the Appendix.
Example
FTC_STATUS Status = FTC_SUCCESS;
FTC_HANDLE ftHandle;
ReadDataByteBuffer ReadDataBuffer;
DWORD dwNumBytesReturned = 0;
Status = JTAG_Read(ftHandle, true, 32, &ReadDataBuffer, &dwNumBytesReturned, RUN_TEST_IDLE_STATE);