1 /***************************************************************************
5 copyright : (C) 2003 by Intra2net AG
6 email : info@intra2net.com
7 ***************************************************************************/
9 /***************************************************************************
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU Lesser General Public License *
13 * version 2.1 as published by the Free Software Foundation; *
15 ***************************************************************************/
24 struct usb_dev_handle *usb_dev;
29 unsigned char bitbang_enabled;
43 int in_is_isochronous;
44 int out_is_isochronous;
45 int suspend_pull_downs;
48 int change_usb_version;
61 int ftdi_init(struct ftdi_context *ftdi);
62 void ftdi_set_usbdev (struct ftdi_context *ftdi, usb_dev_handle *usbdev);
63 int ftdi_usb_open(struct ftdi_context *ftdi, int vendor, int product);
64 int ftdi_usb_close(struct ftdi_context *ftdi);
65 int ftdi_usb_reset(struct ftdi_context *ftdi);
67 int ftdi_set_baudrate(struct ftdi_context *ftdi, int baudrate);
68 int ftdi_write_data(struct ftdi_context *ftdi, unsigned char *buf, int size);
69 int ftdi_read_data(struct ftdi_context *ftdi, unsigned char *buf, int size);
71 int ftdi_enable_bitbang(struct ftdi_context *ftdi, unsigned char bitmask);
72 int ftdi_disable_bitbang(struct ftdi_context *ftdi);
73 int ftdi_read_pins(struct ftdi_context *ftdi, unsigned char *pins);
75 int ftdi_set_latency_timer(struct ftdi_context *ftdi, unsigned char latency);
76 int ftdi_get_latency_timer(struct ftdi_context *ftdi, unsigned char *latency);
78 // init and build eeprom from ftdi_eeprom structure
79 void ftdi_eeprom_initdefaults(struct ftdi_eeprom *eeprom);
80 int ftdi_eeprom_build(struct ftdi_eeprom *eeprom, unsigned char *output);
82 // "eeprom" needs to be valid 128 byte eeprom (generated by the eeprom generator)
83 // the checksum of the eeprom is valided
84 int ftdi_read_eeprom(struct ftdi_context *ftdi, unsigned char *eeprom);
85 int ftdi_write_eeprom(struct ftdi_context *ftdi, unsigned char *eeprom);
86 int ftdi_erase_eeprom(struct ftdi_context *ftdi);
92 #endif /* __libftdi_h__ */