From 0beb9686957ae9b04d4678bbdc2800938beffcf1 Mon Sep 17 00:00:00 2001 From: Thomas Jarosch Date: Tue, 7 Apr 2009 11:35:09 +0200 Subject: [PATCH] Added detection for FT2232H and FT4232H type chips --- README | 21 ++++++++++++++------- src/ftdi.c | 4 ++++ src/ftdi.h | 2 +- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/README b/README index dd195cb..4e1d0ea 100644 --- a/README +++ b/README @@ -1,9 +1,16 @@ -------------------------------------------------------------------- +-------------------------------------------------------------------- libftdi version 0.15 -------------------------------------------------------------------- +-------------------------------------------------------------------- -libftdi - A library (using libusb) to talk to FTDI's FT2232C, -FT232BM and FT245BM type chips including the popular bitbang mode. +libftdi - A library (using libusb) to talk to FTDI's UART/FIFO chips +including the popular bitbang mode. + +The following chips are supported: +- FT4232H / FT2232H +- FT232R / FT245R +- FT2232L / FT2232D / FT2232C +- FT232BM / FT245BM (and the BL/BQ variants) +- FT8U232AM / FT8U245AM The AUTHORS file contains a list of all the people that made libftdi possible what it is today. @@ -19,6 +26,6 @@ Changes You'll find the newest version of libftdi at: http://www.intra2net.com/en/developer/libftdi -------------------------------------------------------------------- -www.intra2net.com 2003-2008 Intra2net AG -------------------------------------------------------------------- +-------------------------------------------------------------------- +www.intra2net.com 2003-2009 Intra2net AG +-------------------------------------------------------------------- diff --git a/src/ftdi.c b/src/ftdi.c index c62ede7..a00e951 100644 --- a/src/ftdi.c +++ b/src/ftdi.c @@ -438,6 +438,10 @@ int ftdi_usb_open_dev(struct ftdi_context *ftdi, struct usb_device *dev) } else if (dev->descriptor.bcdDevice == 0x600) ftdi->type = TYPE_R; + else if (dev->descriptor.bcdDevice == 0x700) + ftdi->type = TYPE_2232H; + else if (dev->descriptor.bcdDevice == 0x800) + ftdi->type = TYPE_4232H; ftdi_error_return(0, "all fine"); } diff --git a/src/ftdi.h b/src/ftdi.h index 937d15d..e02c32b 100644 --- a/src/ftdi.h +++ b/src/ftdi.h @@ -22,7 +22,7 @@ #define FTDI_DEFAULT_EEPROM_SIZE 128 /** FTDI chip type */ -enum ftdi_chip_type { TYPE_AM=0, TYPE_BM=1, TYPE_2232C=2, TYPE_R=3 }; +enum ftdi_chip_type { TYPE_AM=0, TYPE_BM=1, TYPE_2232C=2, TYPE_R=3, TYPE_2232H=4, TYPE_4232H=5 }; /** Parity mode for ftdi_set_line_property() */ enum ftdi_parity_type { NONE=0, ODD=1, EVEN=2, MARK=3, SPACE=4 }; /** Number of stop bits for ftdi_set_line_property() */ -- 1.7.1