Your browser does not allow scripts
Please click here to view a static table of contents without scripts
JTAG_SetGPIOs
Return to Introduction  Previous page  Next page
Controls the use of the 8 general purpose input/output pins of the FT2232C device.

FTC_STATUS
JTAG_SetGPIOs
(FTC_HANDLE ftHandle, BOOL bControlLowInputOutputPins, PFTC_INPUT_OUTPUT_PINS pLowInputOutputPinsData, BOOL bControlHighInputOutputPins, PFTC_INPUT_OUTPUT_PINS pHighInputOutputPinsData)




Parameters
ftHandle
Handle of the device.
bControlLowInputOutputPins
Enables or disables the lower 4 GPIO pins.
pLowInputOutputPinsData
Pointer to a structure that contains the data that is used to control the lower 4 GPIO pins of the FT2232C device.
bControlHighInputOutputPins
Enables or disables the upper 4 GPIO pins.
pHighInputOutputPinsData
Pointer to a structure that contains the data that is used to control the upper 4 GPIO pins of the FT2232C device.




Return Value
FTC_SUCCESS if successful, otherwise the return value is one of the following FTC error codes:

   FTC_INVALID_HANDLE
   FTC_NULL_INPUT_OUTPUT_BUFFER_POINTER
   FTC_
FAILED_TO_COMPLETE_COMMAND
   FTC_IO_ERROR



Remarks
This function provides complete control over the state of the 8 general purpose input/output (GPIO) pins. They can be configured to be inputs, low outputs or high outputs. The state of the pins can be read using the JTAG_GetGPIOs function.

The definition of the FTC_INPUT_OUTPUT_PINS structure is given in the
Appendix.



Example

FTC_STATUS Status = FTC_SUCCESS;
FTC_HANDLE ftHandle;
FTC_INPUT_OUTPUT_PINS LowInputOutputPinsData;
FTC_INPUT_OUTPUT_PINS HighInputOutputPinsData;

// Set low byte pins as output
LowInputOutputPinsData.bPin1InputOutputState = true;
LowInputOutputPinsData.bPin2InputOutputState = true;
LowInputOutputPinsData.bPin3InputOutputState = true;
LowInputOutputPinsData.bPin4InputOutputState = true;
      
// Set low byte bins as high
LowInputOutputPinsData.bPin1LowHighState = true;
LowInputOutputPinsData.bPin2LowHighState = true;
LowInputOutputPinsData.bPin3LowHighState = true;
LowInputOutputPinsData.bPin4LowHighState = true;

// Set high pins as output
HighInputOutputPinsData.bPin1InputOutputState = true;
HighInputOutputPinsData.bPin2InputOutputState = true;
HighInputOutputPinsData.bPin3InputOutputState = true;
HighInputOutputPinsData.bPin4InputOutputState = true;
      
// Set high pins as low
HighInputOutputPinsData.bPin1LowHighState = false;
HighInputOutputPinsData.bPin2LowHighState = false;
HighInputOutputPinsData.bPin3LowHighState = false;
HighInputOutputPinsData.bPin4LowHighState = false;

Status = JTAG_SetGPIOs(ftHandle, true, &LowInputOutputPinsData, true, &HighInputOutputPinsData);