21.07.2015 Views

Programming Info D2XXPG31.pdf

Programming Info D2XXPG31.pdf

Programming Info D2XXPG31.pdf

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

69 D2XX Programmer's Guide4.4 FT_SetBitModeSet the value of the bit mode.FT_STATUS FT_SetBitMode (FT_HANDLE ftHandle, UCHAR ucMask, UCHAR ucMode)ParametersftHandleucMaskucModeHandle of the device.Required value for bit mode mask. This sets up which bits areinputs and outputs. A bit value of 0 sets the corresponding pinto an input, a bit value of 1 sets the corresponding pin to anoutput.In the case of CBUS Bit Bang, the upper nibble of this valuecontrols which pins are inputs and outputs, while the lowernibble controls which of the outputs are high and low.Mode value. Can be one of the following:0x0 = Reset0x1 = Asynchronous Bit Bang0x2 = MPSSE (FT2232C devices only)0x4 = Synchronous Bit Bang (FT232R, FT245R and FT2232Cdevices only)0x8 = MCU Host Bus Emulation Mode (FT2232C devices only)0x10 = Fast Opto-Isolated Serial Mode (FT2232C devices only)0x20 = CBUS Bit Bang Mode (FT232R devices only)Return ValueFT_OK if successful, otherwise the return value is an FT error code.RemarksFor a description of Bit Bang Mode for the FT232BM and FT245BM, see the application note"FT232BM/FT245BM Bit Bang Mode".For a description of available bit modes for the FT2232C, see the application note "Bit ModeFunctions for the FT2232C".For a description of the Bit Bang modes available for the FT232R and FT245R devices, see theapplication note "Bit Bang Modes for the FT232R and FT245R".Application notes are available for download from the Application Notes page in the Documentssection of the FTDI website.Note that to use CBUS Bit Bang for the FT232R, the CBUS must be configured for CBUS BitBang in the EEPROM.ExampleHANDLE ftHandle;FT_STATUS ftStatus;UCHAR Mask = 0xff;UCHAR Mode = 1; // Set asynchronous bit-bang modeftStatus = FT_Open(0, &ftHandle);© Future Technology Devices International Ltd. 2005

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!