X-Git-Url: http://developer.intra2net.com/git/?p=libftdi;a=blobdiff_plain;f=src%2Fftdi.c;h=47e69590aede3ad1cb47bf803553879b9d8a4379;hp=32b38179df164f597d9a74c7582adc978132545c;hb=1a6645bfa90c1a7b40f6c33decfdd992f7002ff8;hpb=8de26dde953c5bdd118090d6f6d04dcc1146a084 diff --git a/src/ftdi.c b/src/ftdi.c index 32b3817..47e6959 100644 --- a/src/ftdi.c +++ b/src/ftdi.c @@ -295,7 +295,7 @@ struct ftdi_version_info ftdi_get_library_version(void) Finds all ftdi devices with given VID:PID on the usb bus. Creates a new ftdi_device_list which needs to be deallocated by ftdi_list_free() after use. With VID:PID 0:0, search for the default devices - (0x403:0x6001, 0x403:0x6010, 0x403:0x6011, 0x403:0x6014) + (0x403:0x6001, 0x403:0x6010, 0x403:0x6011, 0x403:0x6014, 0x403:0x6015) \param ftdi pointer to ftdi_context \param devlist Pointer where to store list of found devices @@ -332,7 +332,8 @@ int ftdi_usb_find_all(struct ftdi_context *ftdi, struct ftdi_device_list **devli desc.idVendor == vendor && desc.idProduct == product) || (!(vendor || product) && (desc.idVendor == 0x403) && (desc.idProduct == 0x6001 || desc.idProduct == 0x6010 - || desc.idProduct == 0x6011 || desc.idProduct == 0x6014))) + || desc.idProduct == 0x6011 || desc.idProduct == 0x6014 + || desc.idProduct == 0x6015))) { *curdev = (struct ftdi_device_list*)malloc(sizeof(struct ftdi_device_list)); if (!*curdev) @@ -3121,6 +3122,21 @@ static unsigned char bit2type(unsigned char bits) } return 0; } +/* Decode 230X / 232R type chips invert bits + * Prints directly to stdout. +*/ +static void print_inverted_bits(int invert) +{ + char *r_bits[] = {"TXD","RXD","RTS","CTS","DTR","DSR","DCD","RI"}; + int i; + + fprintf(stdout,"Inverted bits:"); + for (i=0; i<8; i++) + if ((invert & (1<cbus_function[i]<= CBUSH_AWAKE) fprintf(stdout,"CBUS%d Function: %s\n", i, cbush_mux[eeprom->cbus_function[i]]); } - if(eeprom->invert ) - print_inverted_bits(eeprom->invert); + + if (eeprom->invert) + print_inverted_bits(eeprom->invert); } if (ftdi->type == TYPE_R) @@ -3528,7 +3545,7 @@ int ftdi_eeprom_decode(struct ftdi_context *ftdi, int verbose) char *cbus_BB[] = {"RXF","TXE","RD", "WR"}; if (eeprom->invert) - print_inverted_bits(eeprom->invert); + print_inverted_bits(eeprom->invert); for (i=0; i<5; i++) { @@ -4290,15 +4307,4 @@ char *ftdi_get_error_string (struct ftdi_context *ftdi) return ftdi->error_str; } -void print_inverted_bits(int invert) -{ - int i; - char *r_bits[] = {"TXD","RXD","RTS","CTS","DTR","DSR","DCD","RI"}; - fprintf(stdout,"Inverted bits:"); - for (i=0; i<8; i++) - if ((invert & (1<