Your browser does not allow scripts
Please click here to view a static table of contents without scripts
JTAG_AddWriteCmd
Return to Introduction  Previous page  Next page
Adds a write command and associated data to the internal command buffer. This enables a programmer to build up a sequence of commands i.e. write, read and write/read before executing the sequence of commands. The internal command buffer has a size of 131070 bytes (128 kB).

FTC_STATUS
JTAG_AddWriteCmd
(BOOL bInstructionTestData, DWORD dwNumBitsToWrite, PWriteDataByteBuffer pWriteDataBuffer, DWORD dwNumBytesToWrite, DWORD dwTapControllerState)




Parameters
bInstructionTestData
Selects the instruction register (TRUE) or the test register (FALSE) to write data to.
dwNumBitsToWrite
Number of bits to write to the external device. Valid range is 2 to 524280.
pWriteDataBuffer
Pointer to buffer that contains the data to be written to an external device.
dwNumBytesToWrite
Number of bytes in the write data buffer which contain all the specified bits to be written to the external device. Valid range is 1 to 65535 bytes.
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_NUMBER_BITS
   FTC_NULL_WRITE_DATA_BUFFER_POINTER
   FTC_INVALID_NUMBER_BYTES
   FTC_NUMBER_BYTES_TOO_SMALL
   FTC_INVALID_TAP_CONTROLLER_STATE
   FTC_COMMAND_SEQUENCE_BUFFER_FULL



Remarks
Do not invoke JTAG_Write, JTAG_READ or JTAG_WriteRead functions while constructing a sequence of commands as this will clear the sequence of commands and associated data from the internal command buffer.

This function should be only be used when one device is connected. For multiple devices, use
JTAG_AddDeviceWriteCmd.

Calling this function is equivalent to adding the commands and data from a
JTAG_Write call to the internal command buffer.

This function can be used with
JTAG_ClearCmdSequence, JTAG_AddReadCmd, JTAG_AddWriteReadCmd and JTAG_ExecuteCmdSequence 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;
WriteDataByteBuffer WriteDataBuffer;

// Add values to write buffer
WriteDataBuffer[0] = '\x00';
WriteDataBuffer[1] = '\x00';
WriteDataBuffer[2] = '\x00';
WriteDataBuffer[3] = '\x00';

// Add values to command sequence buffer
Status = JTAG_AddWriteCmd(true, 32, &WriteDataBuffer, 4, RUN_TEST_IDLE_STATE);