Programming Info D2XXPG31.pdf
Programming Info D2XXPG31.pdf
Programming Info D2XXPG31.pdf
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
93 D2XX Programmer's Guide5.16 FT_W32_SetCommStateThis function sets the state of the device according to the contents of a device control block (DCB).BOOL FT_W32_SetCommState (FT_HANDLE ftHandle, LPFTDCB lpftDcb)ParametersftHandlelpftDcbHandle of the device.Pointer to an FTDCB structure.Return ValueIf the function is successful, the return value is nonzero.If the function is unsuccessful, the return value is zero.RemarksLinux does not support the W32 API.ExampleThis example shows how to use this function to change the baud rate.FT_HANDLE ftHandle; // setup by FT_W32_CreateFileFTDCB ftDCB;if (FT_W32_GetCommState(ftHandle,&ftDCB)) {// FT_W32_GetCommState ok, device state is in ftDCBftDCB.BaudRate = 921600;if (FT_W32_SetCommState(ftHandle,&ftDCB)); // FT_W32_SetCommState okelse; // FT_W32_SetCommState failed}else; // FT_W32_GetCommState failed© Future Technology Devices International Ltd. 2005