X-Git-Url: http://developer.intra2net.com/git/?p=libftdi;a=blobdiff_plain;f=src%2Fftdi.h;h=8f03679d54cf7cd79d3ce495246e3dd382ea40b3;hp=fc60ec1da4d568c91c14330370f80ba6f7b5a4bd;hb=2f80efc24176c903d82cea1f084453fd3df9b992;hpb=2d790e377ad5f1c61b38436aa3d5a201c9184028 diff --git a/src/ftdi.h b/src/ftdi.h index fc60ec1..8f03679 100644 --- a/src/ftdi.h +++ b/src/ftdi.h @@ -2,7 +2,7 @@ ftdi.h - description ------------------- begin : Fri Apr 4 2003 - copyright : (C) 2003-2011 by Intra2net AG and the libftdi developers + copyright : (C) 2003-2013 by Intra2net AG and the libftdi developers email : opensource@intra2net.com ***************************************************************************/ @@ -17,10 +17,20 @@ #ifndef __libftdi_h__ #define __libftdi_h__ -#include +#include +#include /** FTDI chip type */ -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_chip_type { + TYPE_AM=0, + TYPE_BM=1, + TYPE_2232C=2, + TYPE_R=3, + TYPE_2232H=4, + TYPE_4232H=5, + TYPE_232H=6, + TYPE_230X=7, +}; /** Parity mode for ftdi_set_line_property() */ enum ftdi_parity_type { NONE=0, ODD=1, EVEN=2, MARK=3, SPACE=4 }; /** Number of stop bits for ftdi_set_line_property() */ @@ -301,7 +311,14 @@ enum ftdi_eeprom_value POWER_SAVE = 45, CLOCK_POLARITY = 46, DATA_ORDER = 47, - FLOW_CONTROL = 48 + FLOW_CONTROL = 48, + CHANNEL_C_DRIVER = 49, + CHANNEL_D_DRIVER = 50, + CHANNEL_A_RS485 = 51, + CHANNEL_B_RS485 = 52, + CHANNEL_C_RS485 = 53, + CHANNEL_D_RS485 = 54, + RELEASE_NUMBER = 55, }; /** @@ -328,7 +345,9 @@ enum ftdi_cbus_func {/* FIXME: Recheck value, especially the last */ enum ftdi_cbush_func {/* FIXME: Recheck value, especially the last */ CBUSH_TRISTATE = 0, CBUSH_RXLED = 1, CBUSH_TXLED = 2, CBUSH_TXRXLED = 3, CBUSH_PWREN = 4, CBUSH_SLEEP = 5, CBUSH_DRIVE_0 = 6, CBUSG_DRIVE1 = 7, CBUSH_IOMODE = 8, CBUSH_TXDEN = 9, - CBUSH_CLK30 = 0xa, CBUSH_CLK15 = 0xb, CBUSH_CLK7_5 = 0xc}; + CBUSH_CLK30 = 10, CBUSH_CLK15 = 11, CBUSH_CLK7_5 = 12, CBUSH_BAT_DETECT = 13, + CBUSH_BAT_DETECT_NEG = 14, CBUSH_I2C_TXE = 15, CBUSH_I2C_RXF = 16, CBUSH_VBUS_SENSE = 17, + CBUSH_BB_WR = 18, CBUSH_BB_RD = 19, CBUSH_TIME_STAMP = 20, CBUSH_AWAKE = 21,}; /** Invert TXD# */ #define INVERT_TXD 0x01 @@ -354,6 +373,8 @@ enum ftdi_cbush_func {/* FIXME: Recheck value, especially the last */ #define CHANNEL_IS_CPU 0x4 #define CHANNEL_IS_FT1284 0x8 +#define CHANNEL_IS_RS485 0x10 + #define DRIVE_4MA 0 #define DRIVE_8MA 1 #define DRIVE_12MA 2 @@ -436,6 +457,8 @@ extern "C" char * manufacturer, int mnf_len, char * description, int desc_len, char * serial, int serial_len); + int ftdi_eeprom_set_strings(struct ftdi_context *ftdi, char * manufacturer, + char * product, char * serial); 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, @@ -466,10 +489,9 @@ extern "C" 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_readstream(struct ftdi_context *ftdi, FTDIStreamCallback *callback, + int ftdi_readstream(struct ftdi_context *ftdi, FTDIStreamCallback *callback, void *userdata, int packetsPerTransfer, int numTransfers); - 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); + struct ftdi_transfer_control *ftdi_write_data_submit(struct ftdi_context *ftdi, unsigned char *buf, int size); struct ftdi_transfer_control *ftdi_read_data_submit(struct ftdi_context *ftdi, unsigned char *buf, int size); int ftdi_transfer_data_done(struct ftdi_transfer_control *tc);