X-Git-Url: http://developer.intra2net.com/git/?p=libftdi;a=blobdiff_plain;f=src%2Fftdi.h;h=42f4cc1b54797c9d19289f259710849a0b932883;hp=15067c73c48f1b54b15ddfb327db9b8380dd16ff;hb=de3da328335f1dd7e55bf251f900123d4e0a0785;hpb=74387f27647e7123e233d31d36daedc6b485650a diff --git a/src/ftdi.h b/src/ftdi.h index 15067c7..42f4cc1 100644 --- a/src/ftdi.h +++ b/src/ftdi.h @@ -2,7 +2,7 @@ ftdi.h - description ------------------- begin : Fri Apr 4 2003 - copyright : (C) 2003-2013 by Intra2net AG and the libftdi developers + copyright : (C) 2003-2014 by Intra2net AG and the libftdi developers email : opensource@intra2net.com ***************************************************************************/ @@ -20,6 +20,18 @@ #include #include +/* 'interface' might be defined as a macro on Windows, so we need to + * undefine it so as not to break the current libftdi API, because + * struct ftdi_context has an 'interface' member + * As this can be problematic if you include windows.h after ftdi.h + * in your sources, we force windows.h to be included first. */ +#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) +#include +#if defined(interface) +#undef interface +#endif +#endif + /** FTDI chip type */ enum ftdi_chip_type { @@ -106,7 +118,7 @@ enum ftdi_module_detach_mode #define EN_ADAPTIVE 0x96 #define DIS_ADAPTIVE 0x97 #define CLK_BYTES_OR_HIGH 0x9c -#define CLK_BYTES_OR_LOW 0x0d +#define CLK_BYTES_OR_LOW 0x9d /*FT232H specific commands */ #define DRIVE_OPEN_COLLECTOR 0x9e /* Value Low */ @@ -348,7 +360,7 @@ 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_SLEEP = 5, CBUSH_DRIVE_0 = 6, CBUSH_DRIVE1 = 7, CBUSH_IOMODE = 8, CBUSH_TXDEN = 9, 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, @@ -452,7 +464,7 @@ extern "C" void ftdi_free(struct ftdi_context *ftdi); void ftdi_set_usbdev (struct ftdi_context *ftdi, struct libusb_device_handle *usbdev); - struct ftdi_version_info ftdi_get_library_version(); + struct ftdi_version_info ftdi_get_library_version(void); int ftdi_usb_find_all(struct ftdi_context *ftdi, struct ftdi_device_list **devlist, int vendor, int product); @@ -490,7 +502,7 @@ extern "C" 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(struct ftdi_context *ftdi, const 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);