ftdi.h
Go to the documentation of this file.
/***************************************************************************
ftdi.h - description
-------------------
begin : Fri Apr 4 2003
copyright : (C) 2003 by Intra2net AG
email : opensource@intra2net.com
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License *
* version 2.1 as published by the Free Software Foundation; *
* *
***************************************************************************/
#ifndef __libftdi_h__
#define __libftdi_h__
#include <usb.h>
#define FTDI_DEFAULT_EEPROM_SIZE 128
enum ftdi_chip_type { TYPE_AM=0, TYPE_BM=1, TYPE_2232C=2, TYPE_R=3, TYPE_2232H=4, TYPE_4232H=5, TYPE_232H = 6 };
enum ftdi_parity_type { NONE=0, ODD=1, EVEN=2, MARK=3, SPACE=4 };
enum ftdi_stopbits_type { STOP_BIT_1=0, STOP_BIT_15=1, STOP_BIT_2=2 };
enum ftdi_bits_type { BITS_7=7, BITS_8=8 };
enum ftdi_break_type { BREAK_OFF=0, BREAK_ON=1 };
enum ftdi_mpsse_mode
{
BITMODE_RESET = 0x00,
BITMODE_BITBANG= 0x01,
BITMODE_MPSSE = 0x02,
BITMODE_SYNCBB = 0x04,
BITMODE_MCU = 0x08,
/* CPU-style fifo mode gets set via EEPROM */
BITMODE_OPTO = 0x10,
BITMODE_CBUS = 0x20,
BITMODE_SYNCFF = 0x40,
};
enum ftdi_interface
{
INTERFACE_ANY = 0,
INTERFACE_A = 1,
INTERFACE_B = 2,
INTERFACE_C = 3,
INTERFACE_D = 4
};
enum ftdi_module_detach_mode
{
AUTO_DETACH_SIO_MODULE = 0,
DONT_DETACH_SIO_MODULE = 1
};
/* Shifting commands IN MPSSE Mode*/
#define MPSSE_WRITE_NEG 0x01 /* Write TDI/DO on negative TCK/SK edge*/
#define MPSSE_BITMODE 0x02 /* Write bits, not bytes */
#define MPSSE_READ_NEG 0x04 /* Sample TDO/DI on negative TCK/SK edge */
#define MPSSE_LSB 0x08 /* LSB first */
#define MPSSE_DO_WRITE 0x10 /* Write TDI/DO */
#define MPSSE_DO_READ 0x20 /* Read TDO/DI */
#define MPSSE_WRITE_TMS 0x40 /* Write TMS/CS */
/* FTDI MPSSE commands */
#define SET_BITS_LOW 0x80
/*BYTE DATA*/
/*BYTE Direction*/
#define SET_BITS_HIGH 0x82
/*BYTE DATA*/
/*BYTE Direction*/
#define GET_BITS_LOW 0x81
#define GET_BITS_HIGH 0x83
#define LOOPBACK_START 0x84
#define LOOPBACK_END 0x85
#define TCK_DIVISOR 0x86
/* H Type specific commands */
#define DIS_DIV_5 0x8a
#define EN_DIV_5 0x8b
#define EN_3_PHASE 0x8c
#define DIS_3_PHASE 0x8d
#define CLK_BITS 0x8e
#define CLK_BYTES 0x8f
#define CLK_WAIT_HIGH 0x94
#define CLK_WAIT_LOW 0x95
#define EN_ADAPTIVE 0x96
#define DIS_ADAPTIVE 0x97
#define CLK_BYTES_OR_HIGH 0x9c
#define CLK_BYTES_OR_LOW 0x0d
/*FT232H specific commands */
#define DRIVE_OPEN_COLLECTOR 0x9e
/* Value Low */
/* Value HIGH */ /*rate is 12000000/((1+value)*2) */
#define DIV_VALUE(rate) (rate > 6000000)?0:((6000000/rate -1) > 0xffff)? 0xffff: (6000000/rate -1)
/* Commands in MPSSE and Host Emulation Mode */
#define SEND_IMMEDIATE 0x87
#define WAIT_ON_HIGH 0x88
#define WAIT_ON_LOW 0x89
/* Commands in Host Emulation Mode */
#define READ_SHORT 0x90
/* Address_Low */
#define READ_EXTENDED 0x91
/* Address High */
/* Address Low */
#define WRITE_SHORT 0x92
/* Address_Low */
#define WRITE_EXTENDED 0x93
/* Address High */
/* Address Low */
/* Definitions for flow control */
#define SIO_RESET 0 /* Reset the port */
#define SIO_MODEM_CTRL 1 /* Set the modem control register */
#define SIO_SET_FLOW_CTRL 2 /* Set flow control register */
#define SIO_SET_BAUD_RATE 3 /* Set baud rate */
#define SIO_SET_DATA 4 /* Set the data characteristics of the port */
#define FTDI_DEVICE_OUT_REQTYPE (USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_OUT)
#define FTDI_DEVICE_IN_REQTYPE (USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_ENDPOINT_IN)
/* Requests */
#define SIO_RESET_REQUEST SIO_RESET
#define SIO_SET_BAUDRATE_REQUEST SIO_SET_BAUD_RATE
#define SIO_SET_DATA_REQUEST SIO_SET_DATA
#define SIO_SET_FLOW_CTRL_REQUEST SIO_SET_FLOW_CTRL
#define SIO_SET_MODEM_CTRL_REQUEST SIO_MODEM_CTRL
#define SIO_POLL_MODEM_STATUS_REQUEST 0x05
#define SIO_SET_EVENT_CHAR_REQUEST 0x06
#define SIO_SET_ERROR_CHAR_REQUEST 0x07
#define SIO_SET_LATENCY_TIMER_REQUEST 0x09
#define SIO_GET_LATENCY_TIMER_REQUEST 0x0A
#define SIO_SET_BITMODE_REQUEST 0x0B
#define SIO_READ_PINS_REQUEST 0x0C
#define SIO_READ_EEPROM_REQUEST 0x90
#define SIO_WRITE_EEPROM_REQUEST 0x91
#define SIO_ERASE_EEPROM_REQUEST 0x92
#define SIO_RESET_SIO 0
#define SIO_RESET_PURGE_RX 1
#define SIO_RESET_PURGE_TX 2
#define SIO_DISABLE_FLOW_CTRL 0x0
#define SIO_RTS_CTS_HS (0x1 << 8)
#define SIO_DTR_DSR_HS (0x2 << 8)
#define SIO_XON_XOFF_HS (0x4 << 8)
#define SIO_SET_DTR_MASK 0x1
#define SIO_SET_DTR_HIGH ( 1 | ( SIO_SET_DTR_MASK << 8))
#define SIO_SET_DTR_LOW ( 0 | ( SIO_SET_DTR_MASK << 8))
#define SIO_SET_RTS_MASK 0x2
#define SIO_SET_RTS_HIGH ( 2 | ( SIO_SET_RTS_MASK << 8 ))
#define SIO_SET_RTS_LOW ( 0 | ( SIO_SET_RTS_MASK << 8 ))
#define SIO_RTS_CTS_HS (0x1 << 8)
/* marker for unused usb urb structures
(taken from libusb) */
#define FTDI_URB_USERCONTEXT_COOKIE ((void *)0x1)
#ifdef __GNUC__
#define DEPRECATED(func) func __attribute__ ((deprecated))
#elif defined(_MSC_VER)
#define DEPRECATED(func) __declspec(deprecated) func
#else
#pragma message("WARNING: You need to implement DEPRECATED for this compiler")
#define DEPRECATED(func) func
#endif
struct ftdi_context
{
/* USB specific */
struct usb_dev_handle *usb_dev;
int usb_read_timeout;
int usb_write_timeout;
/* FTDI specific */
enum ftdi_chip_type type;
int baudrate;
unsigned char bitbang_enabled;
unsigned char *readbuffer;
unsigned int readbuffer_offset;
unsigned int readbuffer_remaining;
unsigned int readbuffer_chunksize;
unsigned int writebuffer_chunksize;
unsigned int max_packet_size;
/* FTDI FT2232C requirecments */
int interface; /* 0 or 1 */
int index; /* 1 or 2 */
/* Endpoints */
int in_ep;
int out_ep; /* 1 or 2 */
unsigned char bitbang_mode;
int eeprom_size;
char *error_str;
char *async_usb_buffer;
unsigned int async_usb_buffer_size;
enum ftdi_module_detach_mode module_detach_mode;
};
struct ftdi_device_list
{
struct ftdi_device_list *next;
struct usb_device *dev;
};
#define CBUS_TXDEN 0
#define CBUS_PWREN 1
#define CBUS_RXLED 2
#define CBUS_TXLED 3
#define CBUS_TXRXLED 4
#define CBUS_SLEEP 5
#define CBUS_CLK48 6
#define CBUS_CLK24 7
#define CBUS_CLK12 8
#define CBUS_CLK6 9
#define CBUS_IOMODE 10
#define CBUS_BB_WR 11
#define CBUS_BB_RD 12
#define INVERT_TXD 0x01
#define INVERT_RXD 0x02
#define INVERT_RTS 0x04
#define INVERT_CTS 0x08
#define INVERT_DTR 0x10
#define INVERT_DSR 0x20
#define INVERT_DCD 0x40
#define INVERT_RI 0x80
#define HIGH_CURRENT_DRIVE 0x04
struct ftdi_eeprom
{
int vendor_id;
int product_id;
int self_powered;
int remote_wakeup;
int chip_type;
int in_is_isochronous;
int out_is_isochronous;
int suspend_pull_downs;
int use_serial;
int change_usb_version;
int usb_version;
int max_power;
char *manufacturer;
char *product;
char *serial;
/* Special function of FT232R devices (and possibly others as well) */
int cbus_function[5];
int high_current;
int invert;
int size;
};
#ifdef __cplusplus
extern "C"
{
#endif
int ftdi_init(struct ftdi_context *ftdi);
struct ftdi_context *ftdi_new(void);
int ftdi_set_interface(struct ftdi_context *ftdi, enum ftdi_interface interface);
void ftdi_deinit(struct ftdi_context *ftdi);
void ftdi_free(struct ftdi_context *ftdi);
void ftdi_set_usbdev (struct ftdi_context *ftdi, usb_dev_handle *usbdev);
int ftdi_usb_find_all(struct ftdi_context *ftdi, struct ftdi_device_list **devlist,
int vendor, int product);
void ftdi_list_free(struct ftdi_device_list **devlist);
void ftdi_list_free2(struct ftdi_device_list *devlist);
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_usb_open(struct ftdi_context *ftdi, int vendor, int product);
int ftdi_usb_open_desc(struct ftdi_context *ftdi, int vendor, int product,
const char* description, const char* serial);
int ftdi_usb_open_desc_index(struct ftdi_context *ftdi, int vendor, int product,
const char* description, const char* serial, unsigned int index);
int ftdi_usb_open_dev(struct ftdi_context *ftdi, struct usb_device *dev);
int ftdi_usb_open_string(struct ftdi_context *ftdi, const char* description);
int ftdi_usb_close(struct ftdi_context *ftdi);
int ftdi_usb_reset(struct ftdi_context *ftdi);
int ftdi_usb_purge_rx_buffer(struct ftdi_context *ftdi);
int ftdi_usb_purge_tx_buffer(struct ftdi_context *ftdi);
int ftdi_usb_purge_buffers(struct ftdi_context *ftdi);
int ftdi_set_baudrate(struct ftdi_context *ftdi, int baudrate);
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_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_read_data(struct ftdi_context *ftdi, unsigned char *buf, int size);
int ftdi_read_data_set_chunksize(struct ftdi_context *ftdi, unsigned int chunksize);
int ftdi_read_data_get_chunksize(struct ftdi_context *ftdi, unsigned int *chunksize);
int ftdi_write_data(struct ftdi_context *ftdi, unsigned char *buf, int size);
int ftdi_write_data_set_chunksize(struct ftdi_context *ftdi, unsigned int chunksize);
int ftdi_write_data_get_chunksize(struct ftdi_context *ftdi, unsigned int *chunksize);
int ftdi_write_data_async(struct ftdi_context *ftdi, unsigned char *buf, int size);
void ftdi_async_complete(struct ftdi_context *ftdi, int wait_for_more);
int DEPRECATED(ftdi_enable_bitbang(struct ftdi_context *ftdi, unsigned char bitmask));
int ftdi_disable_bitbang(struct ftdi_context *ftdi);
int ftdi_set_bitmode(struct ftdi_context *ftdi, unsigned char bitmask, unsigned char mode);
int ftdi_read_pins(struct ftdi_context *ftdi, unsigned char *pins);
int ftdi_set_latency_timer(struct ftdi_context *ftdi, unsigned char latency);
int ftdi_get_latency_timer(struct ftdi_context *ftdi, unsigned char *latency);
int ftdi_poll_modem_status(struct ftdi_context *ftdi, unsigned short *status);
/* flow control */
int ftdi_setflowctrl(struct ftdi_context *ftdi, int flowctrl);
int ftdi_setdtr_rts(struct ftdi_context *ftdi, int dtr, int rts);
int ftdi_setdtr(struct ftdi_context *ftdi, int state);
int ftdi_setrts(struct ftdi_context *ftdi, int state);
int ftdi_set_event_char(struct ftdi_context *ftdi, unsigned char eventch, unsigned char enable);
int ftdi_set_error_char(struct ftdi_context *ftdi, unsigned char errorch, unsigned char enable);
/* set eeprom size */
void ftdi_eeprom_setsize(struct ftdi_context *ftdi, struct ftdi_eeprom *eeprom, int size);
/* init and build eeprom from ftdi_eeprom structure */
void ftdi_eeprom_initdefaults(struct ftdi_eeprom *eeprom);
void ftdi_eeprom_free(struct ftdi_eeprom *eeprom);
int ftdi_eeprom_build(struct ftdi_eeprom *eeprom, unsigned char *output);
int ftdi_eeprom_decode(struct ftdi_eeprom *eeprom, unsigned char *output, int size);
/* "eeprom" needs to be valid 128 byte eeprom (generated by the eeprom generator)
the checksum of the eeprom is valided */
int ftdi_read_eeprom(struct ftdi_context *ftdi, unsigned char *eeprom);
int ftdi_read_chipid(struct ftdi_context *ftdi, unsigned int *chipid);
int ftdi_read_eeprom_getsize(struct ftdi_context *ftdi, unsigned char *eeprom, int maxsize);
int ftdi_write_eeprom(struct ftdi_context *ftdi, unsigned char *eeprom);
int ftdi_erase_eeprom(struct ftdi_context *ftdi);
int ftdi_read_eeprom_location (struct ftdi_context *ftdi, int eeprom_addr, unsigned short *eeprom_val);
int ftdi_write_eeprom_location(struct ftdi_context *ftdi, int eeprom_addr, unsigned short eeprom_val);
char *ftdi_get_error_string(struct ftdi_context *ftdi);
#ifdef __cplusplus
}
#endif
#endif /* __libftdi_h__ */
ftdi_enable_bitbang
int ftdi_enable_bitbang(struct ftdi_context *ftdi, unsigned char bitmask)
Definition: ftdi.c:1715
ftdi_chip_type
ftdi_chip_type
Definition: ftdi.h:25
TYPE_2232H
@ TYPE_2232H
Definition: ftdi.h:25
TYPE_BM
@ TYPE_BM
Definition: ftdi.h:25
TYPE_R
@ TYPE_R
Definition: ftdi.h:25
TYPE_2232C
@ TYPE_2232C
Definition: ftdi.h:25
TYPE_4232H
@ TYPE_4232H
Definition: ftdi.h:25
TYPE_AM
@ TYPE_AM
Definition: ftdi.h:25
TYPE_232H
@ TYPE_232H
Definition: ftdi.h:25
ftdi_set_line_property
int ftdi_set_line_property(struct ftdi_context *ftdi, enum ftdi_bits_type bits, enum ftdi_stopbits_type sbit, enum ftdi_parity_type parity)
Definition: ftdi.c:1148
ftdi_set_usbdev
void ftdi_set_usbdev(struct ftdi_context *ftdi, usb_dev_handle *usbdev)
Definition: ftdi.c:242
ftdi_eeprom_decode
int ftdi_eeprom_decode(struct ftdi_eeprom *eeprom, unsigned char *output, int size)
Definition: ftdi.c:2425
ftdi_usb_purge_tx_buffer
int ftdi_usb_purge_tx_buffer(struct ftdi_context *ftdi)
Definition: ftdi.c:889
ftdi_init
int ftdi_init(struct ftdi_context *ftdi)
Definition: ftdi.c:85
ftdi_mpsse_mode
ftdi_mpsse_mode
Definition: ftdi.h:37
BITMODE_MCU
@ BITMODE_MCU
Definition: ftdi.h:42
BITMODE_SYNCBB
@ BITMODE_SYNCBB
Definition: ftdi.h:41
BITMODE_CBUS
@ BITMODE_CBUS
Definition: ftdi.h:45
BITMODE_SYNCFF
@ BITMODE_SYNCFF
Definition: ftdi.h:46
BITMODE_RESET
@ BITMODE_RESET
Definition: ftdi.h:38
BITMODE_BITBANG
@ BITMODE_BITBANG
Definition: ftdi.h:39
BITMODE_OPTO
@ BITMODE_OPTO
Definition: ftdi.h:44
BITMODE_MPSSE
@ BITMODE_MPSSE
Definition: ftdi.h:40
ftdi_usb_purge_rx_buffer
int ftdi_usb_purge_rx_buffer(struct ftdi_context *ftdi)
Definition: ftdi.c:863
ftdi_erase_eeprom
int ftdi_erase_eeprom(struct ftdi_context *ftdi)
Definition: ftdi.c:2818
ftdi_usb_reset
int ftdi_usb_reset(struct ftdi_context *ftdi)
Definition: ftdi.c:837
ftdi_usb_find_all
int ftdi_usb_find_all(struct ftdi_context *ftdi, struct ftdi_device_list **devlist, int vendor, int product)
Definition: ftdi.c:265
ftdi_get_error_string
char * ftdi_get_error_string(struct ftdi_context *ftdi)
Definition: ftdi.c:2836
ftdi_write_eeprom
int ftdi_write_eeprom(struct ftdi_context *ftdi, unsigned char *eeprom)
Definition: ftdi.c:2778
ftdi_usb_purge_buffers
int ftdi_usb_purge_buffers(struct ftdi_context *ftdi)
Definition: ftdi.c:912
ftdi_eeprom_initdefaults
void ftdi_eeprom_initdefaults(struct ftdi_eeprom *eeprom)
Definition: ftdi.c:2117
ftdi_list_free
void ftdi_list_free(struct ftdi_device_list **devlist)
Definition: ftdi.c:308
ftdi_poll_modem_status
int ftdi_poll_modem_status(struct ftdi_context *ftdi, unsigned short *status)
Definition: ftdi.c:1902
ftdi_stopbits_type
ftdi_stopbits_type
Definition: ftdi.h:29
STOP_BIT_1
@ STOP_BIT_1
Definition: ftdi.h:29
STOP_BIT_2
@ STOP_BIT_2
Definition: ftdi.h:29
STOP_BIT_15
@ STOP_BIT_15
Definition: ftdi.h:29
ftdi_usb_open_desc_index
int ftdi_usb_open_desc_index(struct ftdi_context *ftdi, int vendor, int product, const char *description, const char *serial, unsigned int index)
Definition: ftdi.c:638
ftdi_free
void ftdi_free(struct ftdi_context *ftdi)
Definition: ftdi.c:230
ftdi_set_latency_timer
int ftdi_set_latency_timer(struct ftdi_context *ftdi, unsigned char latency)
Definition: ftdi.c:1821
ftdi_disable_bitbang
int ftdi_disable_bitbang(struct ftdi_context *ftdi)
Definition: ftdi.c:1744
ftdi_setdtr
int ftdi_setdtr(struct ftdi_context *ftdi, int state)
Definition: ftdi.c:1951
ftdi_set_line_property2
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)
Definition: ftdi.c:1167
ftdi_setrts
int ftdi_setrts(struct ftdi_context *ftdi, int state)
Definition: ftdi.c:1981
ftdi_write_data_get_chunksize
int ftdi_write_data_get_chunksize(struct ftdi_context *ftdi, unsigned int *chunksize)
Definition: ftdi.c:1513
ftdi_setdtr_rts
int ftdi_setdtr_rts(struct ftdi_context *ftdi, int dtr, int rts)
Definition: ftdi.c:2012
ftdi_write_eeprom_location
int ftdi_write_eeprom_location(struct ftdi_context *ftdi, int eeprom_addr, unsigned short eeprom_val)
Definition: ftdi.c:2755
ftdi_read_eeprom_location
int ftdi_read_eeprom_location(struct ftdi_context *ftdi, int eeprom_addr, unsigned short *eeprom_val)
Definition: ftdi.c:2619
ftdi_read_data_set_chunksize
int ftdi_read_data_set_chunksize(struct ftdi_context *ftdi, unsigned int chunksize)
Definition: ftdi.c:1663
ftdi_set_interface
int ftdi_set_interface(struct ftdi_context *ftdi, enum ftdi_interface interface)
Definition: ftdi.c:165
ftdi_eeprom_build
int ftdi_eeprom_build(struct ftdi_eeprom *eeprom, unsigned char *output)
Definition: ftdi.c:2192
ftdi_set_event_char
int ftdi_set_event_char(struct ftdi_context *ftdi, unsigned char eventch, unsigned char enable)
Definition: ftdi.c:2048
ftdi_deinit
void ftdi_deinit(struct ftdi_context *ftdi)
Definition: ftdi.c:205
ftdi_read_data
int ftdi_read_data(struct ftdi_context *ftdi, unsigned char *buf, int size)
Definition: ftdi.c:1538
ftdi_async_complete
void ftdi_async_complete(struct ftdi_context *ftdi, int wait_for_more)
Definition: ftdi.c:1365
ftdi_bits_type
ftdi_bits_type
Definition: ftdi.h:31
BITS_7
@ BITS_7
Definition: ftdi.h:31
BITS_8
@ BITS_8
Definition: ftdi.h:31
ftdi_set_bitmode
int ftdi_set_bitmode(struct ftdi_context *ftdi, unsigned char bitmask, unsigned char mode)
Definition: ftdi.c:1768
ftdi_write_data_set_chunksize
int ftdi_write_data_set_chunksize(struct ftdi_context *ftdi, unsigned int chunksize)
Definition: ftdi.c:1495
ftdi_usb_open_desc
int ftdi_usb_open_desc(struct ftdi_context *ftdi, int vendor, int product, const char *description, const char *serial)
Definition: ftdi.c:608
ftdi_usb_close
int ftdi_usb_close(struct ftdi_context *ftdi)
Definition: ftdi.c:942
ftdi_usb_open
int ftdi_usb_open(struct ftdi_context *ftdi, int vendor, int product)
Definition: ftdi.c:581
ftdi_interface
ftdi_interface
Definition: ftdi.h:51
INTERFACE_C
@ INTERFACE_C
Definition: ftdi.h:55
INTERFACE_D
@ INTERFACE_D
Definition: ftdi.h:56
INTERFACE_B
@ INTERFACE_B
Definition: ftdi.h:54
INTERFACE_ANY
@ INTERFACE_ANY
Definition: ftdi.h:52
INTERFACE_A
@ INTERFACE_A
Definition: ftdi.h:53
ftdi_usb_open_dev
int ftdi_usb_open_dev(struct ftdi_context *ftdi, struct usb_device *dev)
Definition: ftdi.c:457
ftdi_list_free2
void ftdi_list_free2(struct ftdi_device_list *devlist)
Definition: ftdi.c:327
ftdi_write_data
int ftdi_write_data(struct ftdi_context *ftdi, unsigned char *buf, int size)
Definition: ftdi.c:1237
ftdi_usb_open_string
int ftdi_usb_open_string(struct ftdi_context *ftdi, const char *description)
Definition: ftdi.c:739
ftdi_eeprom_free
void ftdi_eeprom_free(struct ftdi_eeprom *eeprom)
Definition: ftdi.c:2158
DEPRECATED
#define DEPRECATED(func)
Definition: ftdi.h:179
ftdi_parity_type
ftdi_parity_type
Definition: ftdi.h:27
EVEN
@ EVEN
Definition: ftdi.h:27
ODD
@ ODD
Definition: ftdi.h:27
MARK
@ MARK
Definition: ftdi.h:27
SPACE
@ SPACE
Definition: ftdi.h:27
NONE
@ NONE
Definition: ftdi.h:27
ftdi_read_data_get_chunksize
int ftdi_read_data_get_chunksize(struct ftdi_context *ftdi, unsigned int *chunksize)
Definition: ftdi.c:1692
ftdi_read_pins
int ftdi_read_pins(struct ftdi_context *ftdi, unsigned char *pins)
Definition: ftdi.c:1795
ftdi_read_chipid
int ftdi_read_chipid(struct ftdi_context *ftdi, unsigned int *chipid)
Definition: ftdi.c:2683
ftdi_usb_get_strings
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)
Definition: ftdi.c:358
ftdi_read_eeprom
int ftdi_read_eeprom(struct ftdi_context *ftdi, unsigned char *eeprom)
Definition: ftdi.c:2640
ftdi_setflowctrl
int ftdi_setflowctrl(struct ftdi_context *ftdi, int flowctrl)
Definition: ftdi.c:1928
ftdi_get_latency_timer
int ftdi_get_latency_timer(struct ftdi_context *ftdi, unsigned char *latency)
Definition: ftdi.c:1848
ftdi_module_detach_mode
ftdi_module_detach_mode
Definition: ftdi.h:61
AUTO_DETACH_SIO_MODULE
@ AUTO_DETACH_SIO_MODULE
Definition: ftdi.h:62
DONT_DETACH_SIO_MODULE
@ DONT_DETACH_SIO_MODULE
Definition: ftdi.h:63
ftdi_write_data_async
int ftdi_write_data_async(struct ftdi_context *ftdi, unsigned char *buf, int size)
Definition: ftdi.c:1457
ftdi_break_type
ftdi_break_type
Definition: ftdi.h:33
BREAK_OFF
@ BREAK_OFF
Definition: ftdi.h:33
BREAK_ON
@ BREAK_ON
Definition: ftdi.h:33
ftdi_set_baudrate
int ftdi_set_baudrate(struct ftdi_context *ftdi, int baudrate)
Definition: ftdi.c:1102
ftdi_set_error_char
int ftdi_set_error_char(struct ftdi_context *ftdi, unsigned char errorch, unsigned char enable)
Definition: ftdi.c:2077
ftdi_eeprom_setsize
void ftdi_eeprom_setsize(struct ftdi_context *ftdi, struct ftdi_eeprom *eeprom, int size)
Definition: ftdi.c:2103
ftdi_read_eeprom_getsize
int ftdi_read_eeprom_getsize(struct ftdi_context *ftdi, unsigned char *eeprom, int maxsize)
Definition: ftdi.c:2719
ftdi_new
struct ftdi_context * ftdi_new(void)
Definition: ftdi.c:137
ftdi_context
Main context structure for all libftdi functions.
Definition: ftdi.h:189
ftdi_context::bitbang_mode
unsigned char bitbang_mode
Definition: ftdi.h:229
ftdi_context::module_detach_mode
enum ftdi_module_detach_mode module_detach_mode
Definition: ftdi.h:243
ftdi_context::out_ep
int out_ep
Definition: ftdi.h:226
ftdi_context::writebuffer_chunksize
unsigned int writebuffer_chunksize
Definition: ftdi.h:214
ftdi_context::bitbang_enabled
unsigned char bitbang_enabled
Definition: ftdi.h:204
ftdi_context::usb_dev
struct usb_dev_handle * usb_dev
Definition: ftdi.h:192
ftdi_context::type
enum ftdi_chip_type type
Definition: ftdi.h:200
ftdi_context::async_usb_buffer_size
unsigned int async_usb_buffer_size
Definition: ftdi.h:240
ftdi_context::async_usb_buffer
char * async_usb_buffer
Definition: ftdi.h:238
ftdi_context::max_packet_size
unsigned int max_packet_size
Definition: ftdi.h:216
ftdi_context::readbuffer
unsigned char * readbuffer
Definition: ftdi.h:206
ftdi_context::readbuffer_chunksize
unsigned int readbuffer_chunksize
Definition: ftdi.h:212
ftdi_context::in_ep
int in_ep
Definition: ftdi.h:225
ftdi_context::index
int index
Definition: ftdi.h:222
ftdi_context::baudrate
int baudrate
Definition: ftdi.h:202
ftdi_context::readbuffer_remaining
unsigned int readbuffer_remaining
Definition: ftdi.h:210
ftdi_context::interface
int interface
Definition: ftdi.h:220
ftdi_context::readbuffer_offset
unsigned int readbuffer_offset
Definition: ftdi.h:208
ftdi_context::error_str
char * error_str
Definition: ftdi.h:235
ftdi_context::eeprom_size
int eeprom_size
Definition: ftdi.h:232
ftdi_context::usb_write_timeout
int usb_write_timeout
Definition: ftdi.h:196
ftdi_context::usb_read_timeout
int usb_read_timeout
Definition: ftdi.h:194
ftdi_device_list
list of usb devices created by ftdi_usb_find_all()
Definition: ftdi.h:250
ftdi_device_list::dev
struct usb_device * dev
Definition: ftdi.h:254
ftdi_device_list::next
struct ftdi_device_list * next
Definition: ftdi.h:252
ftdi_eeprom
FTDI eeprom structure.
Definition: ftdi.h:310
ftdi_eeprom::self_powered
int self_powered
Definition: ftdi.h:317
ftdi_eeprom::chip_type
int chip_type
Definition: ftdi.h:321
ftdi_eeprom::cbus_function
int cbus_function[5]
Definition: ftdi.h:348
ftdi_eeprom::change_usb_version
int change_usb_version
Definition: ftdi.h:333
ftdi_eeprom::invert
int invert
Definition: ftdi.h:352
ftdi_eeprom::in_is_isochronous
int in_is_isochronous
Definition: ftdi.h:324
ftdi_eeprom::size
int size
Definition: ftdi.h:356
ftdi_eeprom::suspend_pull_downs
int suspend_pull_downs
Definition: ftdi.h:328
ftdi_eeprom::usb_version
int usb_version
Definition: ftdi.h:335
ftdi_eeprom::max_power
int max_power
Definition: ftdi.h:337
ftdi_eeprom::remote_wakeup
int remote_wakeup
Definition: ftdi.h:319
ftdi_eeprom::product
char * product
Definition: ftdi.h:342
ftdi_eeprom::serial
char * serial
Definition: ftdi.h:344
ftdi_eeprom::product_id
int product_id
Definition: ftdi.h:314
ftdi_eeprom::out_is_isochronous
int out_is_isochronous
Definition: ftdi.h:326
ftdi_eeprom::use_serial
int use_serial
Definition: ftdi.h:331
ftdi_eeprom::manufacturer
char * manufacturer
Definition: ftdi.h:340
ftdi_eeprom::high_current
int high_current
Definition: ftdi.h:350
ftdi_eeprom::vendor_id
int vendor_id
Definition: ftdi.h:312
usb_dev_handle
Definition: ftdi.c:1271