libftdi: (gerd) add ftdi_write_data_async(), needed to work around high latency of...
[libftdi] / src / ftdi.h
index 126c85a..d8b4001 100644 (file)
@@ -20,7 +20,7 @@
 #include <usb.h>
 
 /// FTDI chip type
-enum ftdi_chip_type { TYPE_AM=0, TYPE_BM=1, TYPE_2232C=2 };
+enum ftdi_chip_type { TYPE_AM=0, TYPE_BM=1, TYPE_2232C=2, TYPE_R=3 };
 /// 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()
@@ -35,7 +35,9 @@ enum ftdi_mpsse_mode {
     BITMODE_MPSSE  = 0x02,
     BITMODE_SYNCBB = 0x04,
     BITMODE_MCU    = 0x08,
-    BITMODE_OPTO   = 0x10
+    // CPU-style fifo mode gets set via EEPROM
+    BITMODE_OPTO   = 0x10,
+    BITMODE_CBUS   = 0x20
 };
 
 /// Port interface for FT2232C
@@ -246,6 +248,7 @@ extern "C" {
     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_async(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);
 
@@ -264,6 +267,7 @@ extern "C" {
     // "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_write_eeprom(struct ftdi_context *ftdi, unsigned char *eeprom);
     int ftdi_erase_eeprom(struct ftdi_context *ftdi);