libftdi Archives

Subject: ftdi_convert_baudrate()

From: peter holly <ghollyp@xxxxxxxxx>
To: libftdi@xxxxxxxxxxxxxxxxxxxxxxx
Date: Thu, 18 Apr 2013 21:16:55 +0200
Hi,
I have tried libftdi with 2 port FT2232C chip. Only problem I found was that the ftdi_set_baudrate() function did not work with second port. The port allways operated on highest baudrate. Looking closer on ftdi_convert_baudrate() i found out that the ftdi->index is aplied only on high speed devices. I have modified the code like this and it works fine. Is that ok ?

if (ftdi->type == TYPE_2232H ||
        ftdi->type == TYPE_4232H ||
        ftdi->type == TYPE_232H )
    {
        *index = (unsigned short)(encoded_divisor >> 8);
    }
    else
    {
        *index = (unsigned short)(encoded_divisor >> 16);
    }
    *index &= 0xFF00;
    *index |= ftdi->index;

Best regards,
Peter Holly




libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx


Current Thread
  • ftdi_convert_baudrate(), peter holly <=