Go to the documentation of this file.
30 #define _FTDI_DISABLE_DEPRECATED
58 struct libusb_device*
dev;
94 int Context::open(
int vendor,
int product,
const std::string& description,
const std::string& serial,
unsigned int index)
98 const char* c_description=NULL;
99 const char* c_serial=NULL;
206 d->dev = libusb_get_device(dev);
226 return d->ftdi->usb_read_timeout;
231 d->ftdi->usb_read_timeout = usb_read_timeout;
236 return d->ftdi->usb_write_timeout;
241 d->ftdi->usb_write_timeout = usb_write_timeout;
289 int dtr = 0, rts = 0;
323 unsigned short status = 0;
366 char ivendor[512], idesc[512], iserial[512];
374 d->description = idesc;
388 d->dev = libusb_get_device(d->ftdi->usb_dev);
401 d->open = (ret >= 0);
411 if(d->vendor.empty())
420 if(d->description.empty())
422 return d->description;
429 if(d->serial.empty())
464 d->context = parent->
context();
534 for (; devlist != 0; devlist = devlist->
next)
539 d->list.push_back(c);
554 return d->list.begin();
563 return d->list.end();
572 return d->list.begin();
581 return d->list.end();
590 return d->list.rbegin();
599 return d->list.rend();
608 return d->list.rbegin();
617 return d->list.rend();
627 return d->list.size();
636 return d->list.empty();
662 d->list.push_back(element);
671 d->list.push_front(element);
681 return d->list.erase(pos);
692 return d->list.erase(beg,
end);
699 return new List(dlist);
int ftdi_set_baudrate(struct ftdi_context *ftdi, int baudrate)
ListType::iterator iterator
Iterator type for the container.
void push_front(const Context &element)
int ftdi_usb_open_dev(struct ftdi_context *ftdi, libusb_device *dev)
int ftdi_usb_close(struct ftdi_context *ftdi)
int read_location(int eeprom_addr, unsigned short *eeprom_val)
int ftdi_tcoflush(struct ftdi_context *ftdi)
int read(unsigned char *eeprom)
void set_usb_read_timeout(int usb_read_timeout)
int ftdi_usb_purge_tx_buffer(struct ftdi_context *ftdi)
int set_error_char(unsigned char errorch, unsigned char enable)
int ftdi_usb_open_string(struct ftdi_context *ftdi, const char *description)
void push_back(const Context &element)
int ftdi_set_line_property2(struct ftdi_context *ftdi, enum ftdi_bits_type bits, enum ftdi_stopbits_type sbit, enum ftdi_parity_type parity, enum ftdi_break_type break_type)
struct ftdi_eeprom eeprom
Private(struct ftdi_device_list *_devlist)
int ftdi_setdtr(struct ftdi_context *ftdi, int state)
int set_read_chunk_size(unsigned int chunksize)
int get_strings(bool vendor=true, bool description=true, bool serial=true)
struct ftdi_context * ftdi
void set_context(struct ftdi_context *context)
struct ftdi_context * ftdi_new(void)
const std::string & description()
Device strings properties.
const char * error_string()
int ftdi_disable_bitbang(struct ftdi_context *ftdi)
int ftdi_write_eeprom(struct ftdi_context *ftdi)
int set_event_char(unsigned char eventch, unsigned char enable)
void set_usb_device(struct libusb_device_handle *dev)
FTDI device context. Represents single FTDI device context.
int ftdi_write_data_set_chunksize(struct ftdi_context *ftdi, unsigned int chunksize)
const std::string & vendor()
Device strings properties.
int ftdi_get_latency_timer(struct ftdi_context *ftdi, unsigned char *latency)
int ftdi_usb_purge_rx_buffer(struct ftdi_context *ftdi)
struct libusb_device * dev
struct ftdi_eeprom * eeprom
int ftdi_tcioflush(struct ftdi_context *ftdi)
int write_location(int eeprom_addr, unsigned short eeprom_val)
int set_line_property(enum ftdi_bits_type bits, enum ftdi_stopbits_type sbit, enum ftdi_parity_type parity)
int tcflush(int mask=Input|Output)
int ftdi_usb_purge_buffers(struct ftdi_context *ftdi)
const std::string & serial()
Device strings properties.
List(struct ftdi_device_list *devlist=0)
int ftdi_eeprom_build(struct ftdi_context *ftdi)
int read_pins(unsigned char *pins)
int ftdi_read_data_set_chunksize(struct ftdi_context *ftdi, unsigned int chunksize)
void ftdi_set_usbdev(struct ftdi_context *ftdi, libusb_device_handle *usb)
int set_baud_rate(int baudrate)
int ftdi_set_bitmode(struct ftdi_context *ftdi, unsigned char bitmask, unsigned char mode)
std::list< Context > ListType
List type storing "Context" objects.
int DEPRECATED() flush(int mask=Input|Output)
ListType::const_iterator const_iterator
Const iterator type for the container.
int set_write_chunk_size(unsigned int chunksize)
int ftdi_setrts(struct ftdi_context *ftdi, int state)
int ftdi_usb_get_strings(struct ftdi_context *ftdi, struct libusb_device *dev, char *manufacturer, int mnf_len, char *description, int desc_len, char *serial, int serial_len)
int read(unsigned char *buf, int size)
ListType::const_reverse_iterator const_reverse_iterator
Const reverse iterator type for the container.
int set_flow_control(int flowctrl)
std::list< Context > list
int ftdi_write_data(struct ftdi_context *ftdi, const unsigned char *buf, int size)
ListType::size_type size() const
int ftdi_read_eeprom(struct ftdi_context *ftdi)
int set_modem_control(int mask=Dtr|Rts)
int ftdi_write_data_get_chunksize(struct ftdi_context *ftdi, unsigned int *chunksize)
int chip_id(unsigned int *chipid)
int write(const unsigned char *buf, int size)
list of usb devices created by ftdi_usb_find_all()
int ftdi_set_latency_timer(struct ftdi_context *ftdi, unsigned char latency)
int ftdi_read_eeprom_location(struct ftdi_context *ftdi, int eeprom_addr, unsigned short *eeprom_val)
int ftdi_set_interface(struct ftdi_context *ftdi, enum ftdi_interface interface)
void ftdi_list_free(struct ftdi_device_list **devlist)
struct ftdi_context * context
int ftdi_erase_eeprom(struct ftdi_context *ftdi)
int ftdi_read_pins(struct ftdi_context *ftdi, unsigned char *pins)
struct ftdi_device_list * devlist
int open(struct libusb_device *dev=0)
const char * ftdi_get_error_string(struct ftdi_context *ftdi)
int init_defaults(char *manufacturer, char *product, char *serial)
int ftdi_setflowctrl(struct ftdi_context *ftdi, int flowctrl)
int ftdi_usb_open(struct ftdi_context *ftdi, int vendor, int product)
int ftdi_usb_open_desc_index(struct ftdi_context *ftdi, int vendor, int product, const char *description, const char *serial, unsigned int index)
static List * find_all(Context &context, int vendor, int product)
int set_interface(enum ftdi_interface interface)
struct libusb_device * dev
reverse_iterator rbegin()
int ftdi_usb_reset(struct ftdi_context *ftdi)
struct ftdi_device_list * next
Main context structure for all libftdi functions.
int ftdi_read_data(struct ftdi_context *ftdi, unsigned char *buf, int size)
int ftdi_set_event_char(struct ftdi_context *ftdi, unsigned char eventch, unsigned char enable)
struct ftdi_context * context()
int ftdi_set_error_char(struct ftdi_context *ftdi, unsigned char errorch, unsigned char enable)
void ftdi_free(struct ftdi_context *ftdi)
int set_bitmode(unsigned char bitmask, unsigned char mode)
int ftdi_setdtr_rts(struct ftdi_context *ftdi, int dtr, int rts)
int get_usb_read_timeout() const
int ftdi_read_data_get_chunksize(struct ftdi_context *ftdi, unsigned int *chunksize)
int ftdi_eeprom_initdefaults(struct ftdi_context *ftdi, char *manufacturer, char *product, char *serial)
int write(unsigned char *eeprom)
int get_usb_write_timeout() const
void set_usb_write_timeout(int usb_write_timeout)
ListType::reverse_iterator reverse_iterator
Reverse iterator type for the container.
iterator erase(iterator pos)
int ftdi_set_line_property(struct ftdi_context *ftdi, enum ftdi_bits_type bits, enum ftdi_stopbits_type sbit, enum ftdi_parity_type parity)
int ftdi_tciflush(struct ftdi_context *ftdi)
int get_strings_and_reopen(bool vendor=true, bool description=true, bool serial=true)
int ftdi_usb_find_all(struct ftdi_context *ftdi, struct ftdi_device_list **devlist, int vendor, int product)
int ftdi_write_eeprom_location(struct ftdi_context *ftdi, int eeprom_addr, unsigned short eeprom_val)
int set_latency(unsigned char latency)
int ftdi_read_chipid(struct ftdi_context *ftdi, unsigned int *chipid)
unsigned short poll_modem_status()
int build(unsigned char *output)
int ftdi_poll_modem_status(struct ftdi_context *ftdi, unsigned short *status)
© Intra2net AG 2024
| Legal | Contact