FTDI Community

Please login or register.

Login with username, password and session length.
Advanced Search  

News:

Welcome to the FTDI Community!

Please read our Welcome Note

Technical Support enquires
please contact the team
@ FTDI Support


New Bridgetek Community is now open

Please note that we have created the Bridgetek Community to discuss all Bridgetek products e.g. EVE, MCU.

Please follow this link and create a new user account to get started.

Bridgetek Community

Author Topic: FTDI D2XX - How to send control transfer message?  (Read 7635 times)

knut

  • Newbie
  • *
  • Posts: 3
    • View Profile
FTDI D2XX - How to send control transfer message?
« on: December 20, 2021, 12:04:48 PM »


I am using the FTD2XX library to communicate with a device, from a Windows PC.

I have been able to successfully connect to the device, and to receive a data stream from it.

However, I need to send control messages (URB_CONTROL) to the device.
I have tried to find out how to do this by reading the documentation, but I haven't found anything.
How can I do this?

Logged

FTDI Community

  • Administrator
  • Hero Member
  • *****
  • Posts: 891
    • View Profile
Re: FTDI D2XX - How to send control transfer message?
« Reply #1 on: December 20, 2021, 04:43:54 PM »

Hi
I need to check with colleagues but i believe that URB would be accessing the device without/rather than the FTDI driver. 
Have you looked at the D2xx programmers guide to see if there is a relevant function within D2xx?
https://ftdichip.com/wp-content/uploads/2020/08/D2XX_Programmers_GuideFT_000071.pdf

Regards
FTDI Community
Logged

knut

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: FTDI D2XX - How to send control transfer message?
« Reply #2 on: January 03, 2022, 08:16:21 AM »

Thank you for the quick answer. My response is slow due to the holidays.

After some more research, it looks like the messages correspond to certain operations (Reset, Set latency time, etc...).
I will have to read the D2xx programmers guide carefully again and see if I can find corresponding functions for each of the operations.
I'll post again if I resolve the issue.

Bonus question:
Is it possible to combine use of the D2xx and libusb? (i.e. is it possible to get a libusb-style handle to the device which has been connected to using FT_Open?)

« Last Edit: January 03, 2022, 08:50:07 AM by knut »
Logged

knut

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: FTDI D2XX - How to send control transfer message?
« Reply #3 on: January 06, 2022, 12:33:23 PM »

Update: It works now. :)


In case anyone finds this thread and is curious, there are the commands I ended up using in the initialization (after opening the device):

FT_ResetDevice(ftHandle)
FT_SetLatencyTimer(ftHandle, 16)
FT_W32_GetCommModemStatus (ftHandle, &modemStatus)
FT_SetDataCharacteristics(ftHandle, FT_BITS_8, FT_STOP_BITS_1, FT_PARITY_NONE)
FT_SetFlowControl(ftHandle, FT_FLOW_NONE, 0, 0)
FT_SetDtr(ftHandle)
FT_SetChars(ftHandle, 0, 0, 0, 0)


(Of course, there is also some code around these, including checking return values, etc. These are just the FT_ function calls.)

Logged