Home > General > Ftdi_error_return


Perhaps not a BM type chip?"); ftdi->bitbang_enabled = 0; @@ -1316,7 +1318,7 @@ usb_val = bitmask; // low byte: bitmask usb_val |= (mode << 8); - if (usb_control_msg(ftdi->usb_dev, 0x40, 0x0B, usb_val, References ftdi_usb_open_desc_index(). References ftdi_transfer_control::buf, ftdi_transfer_control::completed, ftdi_transfer_control::ftdi, ftdi_transfer_control::offset, ftdi_context::out_ep, ftdi_context::readbuffer, ftdi_context::readbuffer_chunksize, ftdi_context::readbuffer_offset, ftdi_context::readbuffer_remaining, ftdi_transfer_control::size, ftdi_transfer_control::transfer, ftdi_context::usb_dev, and ftdi_context::usb_read_timeout. Referenced by Ftdi::Context::Private::Private().

Perhaps not a 2232C type chip?"); ftdi->bitbang_mode = mode; @@ -1335,7 +1337,7 @@ */ int ftdi_read_pins(struct ftdi_context *ftdi, unsigned char *pins) { - if (usb_control_msg(ftdi->usb_dev, 0xC0, 0x0C, 0, ftdi->index, (char *)pins, int ftdi_set_eeprom_value ( struct ftdi_context * ftdi, enum ftdi_eeprom_value value_name, int value ) Set a value in the decoded EEPROM Structure No parameter checking is performed Parameters ftdipointer to ftdi_context value_nameEnum That, and if I can keep it clean by giving eachits own context, I run less risk of running into synchronization bugs, ifany remain. Parameters ftdipointer to ftdi_context vendorVendor ID productProduct ID Return values sameas ftdi_usb_open_desc() Definition at line 697 of file ftdi.c. http://developer.intra2net.com/git/?p=libftdi;a=patch;h=a5e1bd8cb666ea95a8e0854ab197fe1387912601

Only valid for 1-255"); usb_val = latency; - if (usb_control_msg(ftdi->usb_dev, 0x40, 0x09, usb_val, ftdi->index, NULL, 0, ftdi->usb_write_timeout) != 0) + if (usb_control_msg(ftdi->usb_dev, FTDI_DEVICE_OUT_REQTYPE, SIO_SET_LATENCY_TIMER_REQUEST, usb_val, ftdi->index, NULL, 0, ftdi->usb_write_timeout) != 0) Use NULL if not needed. Parameters ftdipointer to ftdi_context bufBuffer with the data sizeSize of the buffer Return values NULLSome error happens when submit transfer !NULLPointer to a ftdi_transfer_control Definition at line 1594 of file ftdi.c. int ftdi_read_eeprom_location ( struct ftdi_context * ftdi, int eeprom_addr, unsigned short * eeprom_val ) Read eeprom location Parameters ftdipointer to ftdi_context eeprom_addrAddress of eeprom location to be read eeprom_valPointer to store

With VID:PID 0:0, search for the default devices (0x403:0x6001, 0x403:0x6010, 0x403:0x6011, 0x403:0x6014, 0x403:0x6015) Parameters ftdipointer to ftdi_context devlistPointer where to store list of found devices vendorVendor ID to search for productProduct References ftdi_eeprom::buf, CBUS_BB_RD, CBUS_CLK6, ftdi_eeprom::cbus_function, CBUS_PWREN, CBUS_RXLED, CBUS_SLEEP, CBUS_TXDEN, CBUS_TXLED, ftdi_eeprom::channel_a_driver, ftdi_eeprom::channel_a_rs485enable, ftdi_eeprom::channel_a_type, ftdi_eeprom::channel_b_driver, ftdi_eeprom::channel_b_rs485enable, ftdi_eeprom::channel_b_type, ftdi_eeprom::channel_c_driver, ftdi_eeprom::channel_c_rs485enable, ftdi_eeprom::channel_d_driver, ftdi_eeprom::channel_d_rs485enable, CHANNEL_IS_RS485, ftdi_eeprom::chip, ftdi_eeprom::clock_polarity, ftdi_eeprom::data_order, DRIVE_16MA, DRIVER_VCP, DRIVER_VCPH, ftdi_context::eeprom, ftdi_eeprom::external_oscillator, ftdi_eeprom::flow_control, FT1284_CLK_IDLE_STATE, Referenced by Ftdi::Context::open(). References ftdi_device_list::dev, ftdi_error_return, ftdi_error_return_free_device_list, ftdi_device_list::next, and ftdi_context::usb_ctx.

int ftdi_usb_purge_rx_buffer ( struct ftdi_context * ftdi) Clears the read buffer on the chip and the internal read buffer. This free must happen after an libusb_open() andin all the error pathes, so I added a define for the error case and the return ofthe libusb_open() call must be remembered.ftdi_deinit(ftdi);+ libusb_exit(NULL);free(ftdi);I Referenced by Ftdi::Eeprom::write(). http://developer.intra2net.com/mailarchive/html/libftdi/2012/msg00251.html References ftdi_context::error_str.

Parameters ftdipointer to ftdi_context devlibusb usb_dev to use manufacturerStore manufacturer string here if not NULL mnf_lenBuffer size of manufacturer string descriptionStore product description string here if not NULL desc_lenBuffer size of References ftdi_eeprom::chip, ftdi_context::eeprom, FTDI_DEVICE_OUT_REQTYPE, ftdi_error_return, ftdi_read_eeprom_location(), MAGIC, SIO_ERASE_EEPROM_REQUEST, SIO_WRITE_EEPROM_REQUEST, ftdi_context::type, TYPE_230X, TYPE_R, ftdi_context::usb_dev, and ftdi_context::usb_write_timeout. Does not wait for completion of the transfer nor does it make sure that the transfer was successful. Parameters ftdipointer to ftdi_context vendorVendor ID productProduct ID descriptionDescription to search for.

References FTDI_DEVICE_OUT_REQTYPE, ftdi_error_return, ftdi_context::index, SIO_RESET_PURGE_TX, SIO_RESET_REQUEST, ftdi_context::usb_dev, and ftdi_context::usb_write_timeout. http://libftdi.sourcearchive.com/documentation/0.19-4/group__libftdi_ga3c5ccb0678b0e268b4081ea978e8eb78.html For FT-X devices use AN_201 FT-X MTP memory Configuration to decode. More... serialSerial to search for.

Parameters ftdipointer to ftdi_context descriptionNULL-terminated description-string, using this format: d: path of bus and device-node (e.g. "003/001") within usb device tree (usually at /proc/bus/usb/) i:: first device with given vendor and Parameters ftdipointer to ftdi_context chunksizePointer to store chunk size in Return values 0all fine -1ftdi context invalid Definition at line 1834 of file ftdi.c. References BREAK_OFF, and ftdi_set_line_property2(). Layout of the first byte: B0..B3 - must be 0 B4 Clear to send (CTS) 0 = inactive 1 = active B5 Data set ready (DTS) 0 = inactive 1 =

Parameters ftdipointer to ftdi_context Return values 0all fine -1FTDI reset failed -2USB device unavailable Definition at line 944 of file ftdi.c. Referenced by ftdi_free(). Referenced by ftdi_init(), and Ftdi::Context::set_interface(). Parameters ftdipointer to ftdi_context chunksizeChunk size Return values 0all fine -1ftdi context invalid Definition at line 1816 of file ftdi.c.

References ftdi_error_return, ftdi_context::in_ep, ftdi_context::index, ftdi_context::interface, INTERFACE_A, INTERFACE_ANY, INTERFACE_B, INTERFACE_C, INTERFACE_D, ftdi_context::out_ep, and ftdi_context::usb_dev. void ftdi_transfer_data_cancel ( struct ftdi_transfer_control * tc, struct timeval * to ) Cancel transfer and wait for completion. References FTDI_DEVICE_OUT_REQTYPE, ftdi_error_return, ftdi_context::index, SIO_SET_ERROR_CHAR_REQUEST, ftdi_context::usb_dev, and ftdi_context::usb_write_timeout.

Parameters ftdipointer to ftdi_context chunksizePointer to store chunk size in Return values 0all fine -1FTDI context invalid Definition at line 2020 of file ftdi.c.

Referenced by Ftdi::Eeprom::write_location(). Referenced by Ftdi::Context::set_usb_device(). References ftdi_eeprom::cbus_function, CBUSH_CLK7_5, and CBUSH_TRISTATE. Referenced by ftdi_usb_open().

Automatically reallocates the buffer. Referenced by Ftdi::Eeprom::chip_id(). Referenced by Ftdi::Context::flush(), and ftdi_usb_purge_buffers(). References FTDI_DEVICE_OUT_REQTYPE, ftdi_error_return, ftdi_context::index, SIO_SET_DTR_HIGH, SIO_SET_DTR_LOW, SIO_SET_MODEM_CTRL_REQUEST, ftdi_context::usb_dev, and ftdi_context::usb_write_timeout.

int ftdi_read_pins ( struct ftdi_context * ftdi, unsigned char * pins ) Directly read pin state, circumventing the read buffer. Parameters ftdipointer to ftdi_context bitsNumber of bits sbitNumber of stop bits parityParity mode Return values 0all fine -1Setting line property failed Definition at line 1345 of file ftdi.c. References ftdi_usb_close_internal(), ftdi_usb_open_dev(), and ftdi_context::usb_dev. References ftdi_error_return, ftdi_context::interface, and ftdi_context::usb_dev.

References FTDI_DEVICE_OUT_REQTYPE, ftdi_error_return, ftdi_context::index, SIO_SET_LATENCY_TIMER_REQUEST, ftdi_context::usb_dev, and ftdi_context::usb_write_timeout.