Go to the documentation of this file.
27 #ifdef _FTDI_DISABLE_DEPRECATED
28 #define _Ftdi_Pragma(_msg)
30 #define _Ftdi_Pragma(_msg) _Pragma(_msg)
38 #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
40 #if defined(interface)
100 #define MPSSE_WRITE_NEG 0x01
101 #define MPSSE_BITMODE 0x02
102 #define MPSSE_READ_NEG 0x04
103 #define MPSSE_LSB 0x08
104 #define MPSSE_DO_WRITE 0x10
105 #define MPSSE_DO_READ 0x20
106 #define MPSSE_WRITE_TMS 0x40
109 #define SET_BITS_LOW 0x80
112 #define SET_BITS_HIGH 0x82
115 #define GET_BITS_LOW 0x81
116 #define GET_BITS_HIGH 0x83
117 #define LOOPBACK_START 0x84
118 #define LOOPBACK_END 0x85
119 #define TCK_DIVISOR 0x86
121 #define DIS_DIV_5 0x8a
122 #define EN_DIV_5 0x8b
123 #define EN_3_PHASE 0x8c
124 #define DIS_3_PHASE 0x8d
125 #define CLK_BITS 0x8e
126 #define CLK_BYTES 0x8f
127 #define CLK_WAIT_HIGH 0x94
128 #define CLK_WAIT_LOW 0x95
129 #define EN_ADAPTIVE 0x96
130 #define DIS_ADAPTIVE 0x97
131 #define CLK_BYTES_OR_HIGH 0x9c
132 #define CLK_BYTES_OR_LOW 0x9d
134 #define DRIVE_OPEN_COLLECTOR 0x9e
137 #define DIV_VALUE(rate) (rate > 6000000)?0:((6000000/rate -1) > 0xffff)? 0xffff: (6000000/rate -1)
140 #define SEND_IMMEDIATE 0x87
141 #define WAIT_ON_HIGH 0x88
142 #define WAIT_ON_LOW 0x89
145 #define READ_SHORT 0x90
147 #define READ_EXTENDED 0x91
150 #define WRITE_SHORT 0x92
152 #define WRITE_EXTENDED 0x93
158 #define SIO_MODEM_CTRL 1
159 #define SIO_SET_FLOW_CTRL 2
160 #define SIO_SET_BAUD_RATE 3
161 #define SIO_SET_DATA 4
163 #define FTDI_DEVICE_OUT_REQTYPE (LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE | LIBUSB_ENDPOINT_OUT)
164 #define FTDI_DEVICE_IN_REQTYPE (LIBUSB_REQUEST_TYPE_VENDOR | LIBUSB_RECIPIENT_DEVICE | LIBUSB_ENDPOINT_IN)
167 #define SIO_RESET_REQUEST SIO_RESET
168 #define SIO_SET_BAUDRATE_REQUEST SIO_SET_BAUD_RATE
169 #define SIO_SET_DATA_REQUEST SIO_SET_DATA
170 #define SIO_SET_FLOW_CTRL_REQUEST SIO_SET_FLOW_CTRL
171 #define SIO_SET_MODEM_CTRL_REQUEST SIO_MODEM_CTRL
172 #define SIO_POLL_MODEM_STATUS_REQUEST 0x05
173 #define SIO_SET_EVENT_CHAR_REQUEST 0x06
174 #define SIO_SET_ERROR_CHAR_REQUEST 0x07
175 #define SIO_SET_LATENCY_TIMER_REQUEST 0x09
176 #define SIO_GET_LATENCY_TIMER_REQUEST 0x0A
177 #define SIO_SET_BITMODE_REQUEST 0x0B
178 #define SIO_READ_PINS_REQUEST 0x0C
179 #define SIO_READ_EEPROM_REQUEST 0x90
180 #define SIO_WRITE_EEPROM_REQUEST 0x91
181 #define SIO_ERASE_EEPROM_REQUEST 0x92
184 #define SIO_RESET_SIO 0
214 #define SIO_RESET_PURGE_RX _Ftdi_Pragma("GCC warning \"SIO_RESET_PURGE_RX\" deprecated: - use tciflush() method") 1
215 #define SIO_RESET_PURGE_TX _Ftdi_Pragma("GCC warning \"SIO_RESET_PURGE_RX\" deprecated: - use tcoflush() method") 2
217 #pragma message("WARNING: You need to implement deprecated #define for this compiler")
218 #define SIO_RESET_PURGE_RX 1
219 #define SIO_RESET_PURGE_TX 2
222 #define SIO_TCIFLUSH 2
223 #define SIO_TCOFLUSH 1
225 #define SIO_DISABLE_FLOW_CTRL 0x0
226 #define SIO_RTS_CTS_HS (0x1 << 8)
227 #define SIO_DTR_DSR_HS (0x2 << 8)
228 #define SIO_XON_XOFF_HS (0x4 << 8)
230 #define SIO_SET_DTR_MASK 0x1
231 #define SIO_SET_DTR_HIGH ( 1 | ( SIO_SET_DTR_MASK << 8))
232 #define SIO_SET_DTR_LOW ( 0 | ( SIO_SET_DTR_MASK << 8))
233 #define SIO_SET_RTS_MASK 0x2
234 #define SIO_SET_RTS_HIGH ( 2 | ( SIO_SET_RTS_MASK << 8 ))
235 #define SIO_SET_RTS_LOW ( 0 | ( SIO_SET_RTS_MASK << 8 ))
237 #define SIO_RTS_CTS_HS (0x1 << 8)
241 #define FTDI_URB_USERCONTEXT_COOKIE ((void *)0x1)
243 #ifdef _FTDI_DISABLE_DEPRECATED
244 #define DEPRECATED(func) func
247 #define DEPRECATED(func) __attribute__ ((deprecated)) func
248 #elif defined(_MSC_VER)
249 #define DEPRECATED(func) __declspec(deprecated) func
251 #pragma message("WARNING: You need to implement DEPRECATED for this compiler")
252 #define DEPRECATED(func) func
399 struct libusb_device *
dev;
401 #define FT1284_CLK_IDLE_STATE 0x01
402 #define FT1284_DATA_LSB 0x02
403 #define FT1284_FLOW_CONTROL 0x04
404 #define POWER_SAVE_DISABLE_H 0x80
406 #define USE_SERIAL_NUM 0x08
431 #define INVERT_TXD 0x01
433 #define INVERT_RXD 0x02
435 #define INVERT_RTS 0x04
437 #define INVERT_CTS 0x08
439 #define INVERT_DTR 0x10
441 #define INVERT_DSR 0x20
443 #define INVERT_DCD 0x40
445 #define INVERT_RI 0x80
448 #define CHANNEL_IS_UART 0x0
449 #define CHANNEL_IS_FIFO 0x1
450 #define CHANNEL_IS_OPTO 0x2
451 #define CHANNEL_IS_CPU 0x4
452 #define CHANNEL_IS_FT1284 0x8
454 #define CHANNEL_IS_RS485 0x10
464 #define DRIVER_VCP 0x08
465 #define DRIVER_VCPH 0x10
467 #define USE_USB_VERSION_BIT 0x10
469 #define SUSPEND_DBUS7_BIT 0x80
472 #define HIGH_CURRENT_DRIVE 0x10
473 #define HIGH_CURRENT_DRIVE_R 0x04
531 int vendor,
int product);
535 char *manufacturer,
int mnf_len,
536 char *description,
int desc_len,
537 char *serial,
int serial_len);
539 char *manufacturer,
int mnf_len,
540 char *description,
int desc_len,
541 char *serial,
int serial_len);
544 char *manufacturer,
int mnf_len,
545 char *product,
int prod_len,
546 char *serial,
int serial_len);
548 const char * product,
const char * serial);
552 const char* description,
const char* serial);
554 const char* description,
const char* serial,
unsigned int index);
584 void *userdata,
int packetsPerTransfer,
int numTransfers);
612 char * manufacturer,
char *product,
int ftdi_readstream(struct ftdi_context *ftdi, FTDIStreamCallback *callback, void *userdata, int packetsPerTransfer, int numTransfers)
int ftdi_set_eeprom_value(struct ftdi_context *ftdi, enum ftdi_eeprom_value value_name, int value)
unsigned char * readbuffer
struct ftdi_context * ftdi
struct ftdi_transfer_control * ftdi_read_data_submit(struct ftdi_context *ftdi, unsigned char *buf, int size)
enum ftdi_module_detach_mode module_detach_mode
int ftdi_get_eeprom_value(struct ftdi_context *ftdi, enum ftdi_eeprom_value value_name, int *value)
int ftdi_usb_close(struct ftdi_context *ftdi)
int ftdi_usb_purge_tx_buffer(struct ftdi_context *ftdi)
int ftdi_setdtr(struct ftdi_context *ftdi, int state)
int ftdi_eeprom_get_strings(struct ftdi_context *ftdi, char *manufacturer, int mnf_len, char *product, int prod_len, char *serial, int serial_len)
void ftdi_set_usbdev(struct ftdi_context *ftdi, struct libusb_device_handle *usbdev)
int ftdi_get_latency_timer(struct ftdi_context *ftdi, unsigned char *latency)
int ftdi_set_eeprom_buf(struct ftdi_context *ftdi, const unsigned char *buf, int size)
int ftdi_usb_get_strings2(struct ftdi_context *ftdi, struct libusb_device *dev, char *manufacturer, int mnf_len, char *description, int desc_len, char *serial, int serial_len)
int ftdi_poll_modem_status(struct ftdi_context *ftdi, unsigned short *status)
int ftdi_set_eeprom_user_data(struct ftdi_context *ftdi, const char *buf, int size)
unsigned int readbuffer_chunksize
unsigned char bitbang_mode
int ftdi_set_error_char(struct ftdi_context *ftdi, unsigned char errorch, unsigned char enable)
struct libusb_transfer * transfer
int ftdi_transfer_data_done(struct ftdi_transfer_control *tc)
void ftdi_deinit(struct ftdi_context *ftdi)
int ftdi_read_data_set_chunksize(struct ftdi_context *ftdi, unsigned int chunksize)
int ftdi_usb_purge_rx_buffer(struct ftdi_context *ftdi)
struct libusb_device * dev
struct ftdi_eeprom * eeprom
struct ftdi_version_info ftdi_get_library_version(void)
Get libftdi library version.
int ftdi_usb_purge_buffers(struct ftdi_context *ftdi)
unsigned char bitbang_enabled
int ftdi_set_bitmode(struct ftdi_context *ftdi, unsigned char bitmask, unsigned char mode)
int ftdi_write_eeprom_location(struct ftdi_context *ftdi, int eeprom_addr, unsigned short eeprom_val)
int ftdi_usb_open_dev(struct ftdi_context *ftdi, struct libusb_device *dev)
int ftdi_write_data_set_chunksize(struct ftdi_context *ftdi, unsigned int chunksize)
@ AUTO_DETACH_REATACH_SIO_MODULE
int ftdi_setflowctrl(struct ftdi_context *ftdi, int flowctrl)
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)
struct ftdi_context * ftdi_new(void)
unsigned int readbuffer_remaining
int ftdi_tcoflush(struct ftdi_context *ftdi)
int ftdi_erase_eeprom(struct ftdi_context *ftdi)
int ftdi_usb_open_bus_addr(struct ftdi_context *ftdi, uint8_t bus, uint8_t addr)
int ftdi_setrts(struct ftdi_context *ftdi, int state)
const char * ftdi_get_error_string(struct ftdi_context *ftdi)
int ftdi_get_eeprom_buf(struct ftdi_context *ftdi, unsigned char *buf, int size)
int ftdi_usb_open_string(struct ftdi_context *ftdi, const char *description)
void ftdi_list_free2(struct ftdi_device_list *devlist)
int ftdi_tcioflush(struct ftdi_context *ftdi)
int ftdi_set_event_char(struct ftdi_context *ftdi, unsigned char eventch, unsigned char enable)
int ftdi_eeprom_set_strings(struct ftdi_context *ftdi, const char *manufacturer, const char *product, const char *serial)
struct libusb_context * usb_ctx
int ftdi_read_eeprom_location(struct ftdi_context *ftdi, int eeprom_addr, unsigned short *eeprom_val)
int ftdi_read_chipid(struct ftdi_context *ftdi, unsigned int *chipid)
list of usb devices created by ftdi_usb_find_all()
int ftdi_eeprom_initdefaults(struct ftdi_context *ftdi, char *manufacturer, char *product, char *serial)
int() FTDIStreamCallback(uint8_t *buffer, int length, FTDIProgressInfo *progress, void *userdata)
int ftdi_read_eeprom(struct ftdi_context *ftdi)
int ftdi_read_data(struct ftdi_context *ftdi, unsigned char *buf, int size)
int ftdi_eeprom_build(struct ftdi_context *ftdi)
int ftdi_set_latency_timer(struct ftdi_context *ftdi, unsigned char latency)
void ftdi_list_free(struct ftdi_device_list **devlist)
int ftdi_read_pins(struct ftdi_context *ftdi, unsigned char *pins)
struct libusb_device_handle * usb_dev
int ftdi_read_data_get_chunksize(struct ftdi_context *ftdi, unsigned int *chunksize)
int ftdi_usb_open(struct ftdi_context *ftdi, int vendor, int product)
int ftdi_tciflush(struct ftdi_context *ftdi)
struct ftdi_device_list * next
Progress Info for streaming read.
Main context structure for all libftdi functions.
void ftdi_transfer_data_cancel(struct ftdi_transfer_control *tc, struct timeval *to)
const char * snapshot_str
int ftdi_set_baudrate(struct ftdi_context *ftdi, int baudrate)
int ftdi_write_data_get_chunksize(struct ftdi_context *ftdi, unsigned int *chunksize)
struct ftdi_transfer_control * ftdi_write_data_submit(struct ftdi_context *ftdi, unsigned char *buf, int size)
unsigned int writebuffer_chunksize
int ftdi_disable_bitbang(struct ftdi_context *ftdi)
int ftdi_setflowctrl_xonxoff(struct ftdi_context *ftdi, unsigned char xon, unsigned char xoff)
int ftdi_write_eeprom(struct ftdi_context *ftdi)
int ftdi_set_interface(struct ftdi_context *ftdi, enum ftdi_interface interface)
void ftdi_free(struct ftdi_context *ftdi)
int ftdi_init(struct ftdi_context *ftdi)
int ftdi_setdtr_rts(struct ftdi_context *ftdi, int dtr, int rts)
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)
unsigned int readbuffer_offset
int ftdi_eeprom_decode(struct ftdi_context *ftdi, int verbose)
int ftdi_usb_find_all(struct ftdi_context *ftdi, struct ftdi_device_list **devlist, int vendor, int product)
int ftdi_write_data(struct ftdi_context *ftdi, const unsigned char *buf, int size)
int ftdi_usb_reset(struct ftdi_context *ftdi)
unsigned int max_packet_size
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)
© Intra2net AG 2024
| Legal | Contact