22#define FTDI_DEFAULT_EEPROM_SIZE 128
67#define MPSSE_WRITE_NEG 0x01
68#define MPSSE_BITMODE 0x02
69#define MPSSE_READ_NEG 0x04
71#define MPSSE_DO_WRITE 0x10
72#define MPSSE_DO_READ 0x20
73#define MPSSE_WRITE_TMS 0x40
76#define SET_BITS_LOW 0x80
79#define SET_BITS_HIGH 0x82
82#define GET_BITS_LOW 0x81
83#define GET_BITS_HIGH 0x83
84#define LOOPBACK_START 0x84
85#define LOOPBACK_END 0x85
86#define TCK_DIVISOR 0x86
89#define DIV_VALUE(rate) (rate > 6000000)?0:((6000000/rate -1) > 0xffff)? 0xffff: (6000000/rate -1)
92#define SEND_IMMEDIATE 0x87
93#define WAIT_ON_HIGH 0x88
94#define WAIT_ON_LOW 0x89
97#define READ_SHORT 0x90
99#define READ_EXTENDED 0x91
102#define WRITE_SHORT 0x92
104#define WRITE_EXTENDED 0x93
110#define SIO_MODEM_CTRL 1
111#define SIO_SET_FLOW_CTRL 2
112#define SIO_SET_BAUD_RATE 3
113#define SIO_SET_DATA 4
115#define FTDI_DEVICE_OUT_REQTYPE (USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_OUT)
116#define FTDI_DEVICE_IN_REQTYPE (USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_IN)
119#define SIO_RESET_REQUEST SIO_RESET
120#define SIO_SET_BAUDRATE_REQUEST SIO_SET_BAUD_RATE
121#define SIO_SET_DATA_REQUEST SIO_SET_DATA
122#define SIO_SET_FLOW_CTRL_REQUEST SIO_SET_FLOW_CTRL
123#define SIO_SET_MODEM_CTRL_REQUEST SIO_MODEM_CTRL
124#define SIO_POLL_MODEM_STATUS_REQUEST 0x05
125#define SIO_SET_EVENT_CHAR_REQUEST 0x06
126#define SIO_SET_ERROR_CHAR_REQUEST 0x07
127#define SIO_SET_LATENCY_TIMER_REQUEST 0x09
128#define SIO_GET_LATENCY_TIMER_REQUEST 0x0A
129#define SIO_SET_BITMODE_REQUEST 0x0B
130#define SIO_READ_PINS_REQUEST 0x0C
131#define SIO_READ_EEPROM_REQUEST 0x90
132#define SIO_WRITE_EEPROM_REQUEST 0x91
133#define SIO_ERASE_EEPROM_REQUEST 0x92
136#define SIO_RESET_SIO 0
137#define SIO_RESET_PURGE_RX 1
138#define SIO_RESET_PURGE_TX 2
140#define SIO_DISABLE_FLOW_CTRL 0x0
141#define SIO_RTS_CTS_HS (0x1 << 8)
142#define SIO_DTR_DSR_HS (0x2 << 8)
143#define SIO_XON_XOFF_HS (0x4 << 8)
145#define SIO_SET_DTR_MASK 0x1
146#define SIO_SET_DTR_HIGH ( 1 | ( SIO_SET_DTR_MASK << 8))
147#define SIO_SET_DTR_LOW ( 0 | ( SIO_SET_DTR_MASK << 8))
148#define SIO_SET_RTS_MASK 0x2
149#define SIO_SET_RTS_HIGH ( 2 | ( SIO_SET_RTS_MASK << 8 ))
150#define SIO_SET_RTS_LOW ( 0 | ( SIO_SET_RTS_MASK << 8 ))
152#define SIO_RTS_CTS_HS (0x1 << 8)
156#define FTDI_URB_USERCONTEXT_COOKIE ((void *)0x1)
159 #define DEPRECATED(func) func __attribute__ ((deprecated))
160#elif defined(_MSC_VER)
161 #define DEPRECATED(func) __declspec(deprecated) func
163 #pragma message("WARNING: You need to implement DEPRECATED for this compiler")
164 #define DEPRECATED(func) func
252#define CBUS_TXRXLED 4
264#define CBUS_IOMODE 10
272#define INVERT_TXD 0x01
274#define INVERT_RXD 0x02
276#define INVERT_RTS 0x04
278#define INVERT_CTS 0x08
280#define INVERT_DTR 0x10
282#define INVERT_DSR 0x20
284#define INVERT_DCD 0x40
286#define INVERT_RI 0x80
289#define HIGH_CURRENT_DRIVE 0x04
358 int vendor,
int product);
362 char * manufacturer,
int mnf_len,
363 char * description,
int desc_len,
364 char * serial,
int serial_len);
368 const char* description,
const char* serial);
370 const char* description,
const char* serial,
unsigned int index);
int ftdi_enable_bitbang(struct ftdi_context *ftdi, unsigned char bitmask)
int ftdi_set_line_property(struct ftdi_context *ftdi, enum ftdi_bits_type bits, enum ftdi_stopbits_type sbit, enum ftdi_parity_type parity)
void ftdi_set_usbdev(struct ftdi_context *ftdi, usb_dev_handle *usbdev)
int ftdi_eeprom_decode(struct ftdi_eeprom *eeprom, unsigned char *output, int size)
int ftdi_usb_purge_tx_buffer(struct ftdi_context *ftdi)
int ftdi_init(struct ftdi_context *ftdi)
int ftdi_usb_purge_rx_buffer(struct ftdi_context *ftdi)
int ftdi_erase_eeprom(struct ftdi_context *ftdi)
int ftdi_usb_reset(struct ftdi_context *ftdi)
int ftdi_usb_find_all(struct ftdi_context *ftdi, struct ftdi_device_list **devlist, int vendor, int product)
int ftdi_write_eeprom(struct ftdi_context *ftdi, unsigned char *eeprom)
char * ftdi_get_error_string(struct ftdi_context *ftdi)
int ftdi_usb_purge_buffers(struct ftdi_context *ftdi)
void ftdi_eeprom_initdefaults(struct ftdi_eeprom *eeprom)
void ftdi_list_free(struct ftdi_device_list **devlist)
int ftdi_poll_modem_status(struct ftdi_context *ftdi, unsigned short *status)
int ftdi_usb_open_desc_index(struct ftdi_context *ftdi, int vendor, int product, const char *description, const char *serial, unsigned int index)
void ftdi_free(struct ftdi_context *ftdi)
int ftdi_set_latency_timer(struct ftdi_context *ftdi, unsigned char latency)
int ftdi_disable_bitbang(struct ftdi_context *ftdi)
int ftdi_setdtr(struct ftdi_context *ftdi, int state)
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)
int ftdi_setrts(struct ftdi_context *ftdi, int state)
int ftdi_write_data_get_chunksize(struct ftdi_context *ftdi, unsigned int *chunksize)
int ftdi_setdtr_rts(struct ftdi_context *ftdi, int dtr, int rts)
int ftdi_write_eeprom_location(struct ftdi_context *ftdi, int eeprom_addr, unsigned short eeprom_val)
int ftdi_read_eeprom_location(struct ftdi_context *ftdi, int eeprom_addr, unsigned short *eeprom_val)
int ftdi_read_data_set_chunksize(struct ftdi_context *ftdi, unsigned int chunksize)
int ftdi_set_interface(struct ftdi_context *ftdi, enum ftdi_interface interface)
int ftdi_eeprom_build(struct ftdi_eeprom *eeprom, unsigned char *output)
int ftdi_set_event_char(struct ftdi_context *ftdi, unsigned char eventch, unsigned char enable)
void ftdi_deinit(struct ftdi_context *ftdi)
int ftdi_read_data(struct ftdi_context *ftdi, unsigned char *buf, int size)
void ftdi_async_complete(struct ftdi_context *ftdi, int wait_for_more)
int ftdi_set_bitmode(struct ftdi_context *ftdi, unsigned char bitmask, unsigned char mode)
int ftdi_write_data_set_chunksize(struct ftdi_context *ftdi, unsigned int chunksize)
int ftdi_usb_open_desc(struct ftdi_context *ftdi, int vendor, int product, const char *description, const char *serial)
int ftdi_usb_close(struct ftdi_context *ftdi)
int ftdi_usb_open(struct ftdi_context *ftdi, int vendor, int product)
int ftdi_usb_open_dev(struct ftdi_context *ftdi, struct usb_device *dev)
void ftdi_list_free2(struct ftdi_device_list *devlist)
int ftdi_write_data(struct ftdi_context *ftdi, unsigned char *buf, int size)
int ftdi_usb_open_string(struct ftdi_context *ftdi, const char *description)
void ftdi_eeprom_free(struct ftdi_eeprom *eeprom)
int ftdi_read_data_get_chunksize(struct ftdi_context *ftdi, unsigned int *chunksize)
struct ftdi_context * ftdi_new(void)
int ftdi_read_pins(struct ftdi_context *ftdi, unsigned char *pins)
int ftdi_read_chipid(struct ftdi_context *ftdi, unsigned int *chipid)
int ftdi_usb_get_strings(struct ftdi_context *ftdi, struct usb_device *dev, char *manufacturer, int mnf_len, char *description, int desc_len, char *serial, int serial_len)
int ftdi_read_eeprom(struct ftdi_context *ftdi, unsigned char *eeprom)
int ftdi_setflowctrl(struct ftdi_context *ftdi, int flowctrl)
int ftdi_get_latency_timer(struct ftdi_context *ftdi, unsigned char *latency)
int ftdi_write_data_async(struct ftdi_context *ftdi, unsigned char *buf, int size)
int ftdi_set_baudrate(struct ftdi_context *ftdi, int baudrate)
int ftdi_set_error_char(struct ftdi_context *ftdi, unsigned char errorch, unsigned char enable)
void ftdi_eeprom_setsize(struct ftdi_context *ftdi, struct ftdi_eeprom *eeprom, int size)
int ftdi_read_eeprom_getsize(struct ftdi_context *ftdi, unsigned char *eeprom, int maxsize)
Main context structure for all libftdi functions.
unsigned char bitbang_mode
enum ftdi_module_detach_mode module_detach_mode
unsigned int writebuffer_chunksize
unsigned char bitbang_enabled
struct usb_dev_handle * usb_dev
unsigned int async_usb_buffer_size
unsigned int max_packet_size
unsigned char * readbuffer
unsigned int readbuffer_chunksize
unsigned int readbuffer_remaining
unsigned int readbuffer_offset
list of usb devices created by ftdi_usb_find_all()
struct ftdi_device_list * next