# This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.12
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.

"""Python interface to libftdi1"""


from sys import version_info as _swig_python_version_info
if _swig_python_version_info >= (2, 7, 0):
    def swig_import_helper():
        import importlib
        pkg = __name__.rpartition('.')[0]
        mname = '.'.join((pkg, '_ftdi1')).lstrip('.')
        try:
            return importlib.import_module(mname)
        except ImportError:
            return importlib.import_module('_ftdi1')
    _ftdi1 = swig_import_helper()
    del swig_import_helper
elif _swig_python_version_info >= (2, 6, 0):
    def swig_import_helper():
        from os.path import dirname
        import imp
        fp = None
        try:
            fp, pathname, description = imp.find_module('_ftdi1', [dirname(__file__)])
        except ImportError:
            import _ftdi1
            return _ftdi1
        try:
            _mod = imp.load_module('_ftdi1', fp, pathname, description)
        finally:
            if fp is not None:
                fp.close()
        return _mod
    _ftdi1 = swig_import_helper()
    del swig_import_helper
else:
    import _ftdi1
del _swig_python_version_info

try:
    _swig_property = property
except NameError:
    pass  # Python < 2.2 doesn't have 'property'.

try:
    import builtins as __builtin__
except ImportError:
    import __builtin__

def _swig_setattr_nondynamic(self, class_type, name, value, static=1):
    if (name == "thisown"):
        return self.this.own(value)
    if (name == "this"):
        if type(value).__name__ == 'SwigPyObject':
            self.__dict__[name] = value
            return
    method = class_type.__swig_setmethods__.get(name, None)
    if method:
        return method(self, value)
    if (not static):
        if _newclass:
            object.__setattr__(self, name, value)
        else:
            self.__dict__[name] = value
    else:
        raise AttributeError("You cannot add attributes to %s" % self)


def _swig_setattr(self, class_type, name, value):
    return _swig_setattr_nondynamic(self, class_type, name, value, 0)


def _swig_getattr(self, class_type, name):
    if (name == "thisown"):
        return self.this.own()
    method = class_type.__swig_getmethods__.get(name, None)
    if method:
        return method(self)
    raise AttributeError("'%s' object has no attribute '%s'" % (class_type.__name__, name))


def _swig_repr(self):
    try:
        strthis = "proxy of " + self.this.__repr__()
    except __builtin__.Exception:
        strthis = ""
    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)

try:
    _object = object
    _newclass = 1
except __builtin__.Exception:
    class _object:
        pass
    _newclass = 0


def usb_find_all(ftdi, vendor, product):
    """
    usb_find_all(context, vendor, product) -> (return_code, devlist)



    Finds all ftdi devices with given VID:PID on the usb bus. Creates a
    new ftdi_device_list which needs to be deallocated by ftdi_list_free()
    after use. With VID:PID 0:0, search for the default devices
    (0x403:0x6001, 0x403:0x6010, 0x403:0x6011, 0x403:0x6014, 0x403:0x6015)

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    devlist:  Pointer where to store list of found devices

    vendor:  Vendor ID to search for

    product:  Product ID to search for

    Returns:
    --------

    >0:  number of devices found

    -3:  out of memory

    -5:  libusb_get_device_list() failed

    -6:  libusb_get_device_descriptor() failed 
    """
    return _ftdi1.usb_find_all(ftdi, vendor, product)

def usb_get_strings(*args):
    """
    usb_get_strings(context, device) -> (return_code, manufacturer, description, serial)



    Return device ID strings from the usb device.

    The parameters manufacturer, description and serial may be NULL or
    pointer to buffers to store the fetched strings.

    Use this function only in combination with ftdi_usb_find_all() as it
    closes the internal "usb_dev" after use.

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    dev:  libusb usb_dev to use

    manufacturer:  Store manufacturer string here if not NULL

    mnf_len:  Buffer size of manufacturer string

    description:  Store product description string here if not NULL

    desc_len:  Buffer size of product description string

    serial:  Store serial string here if not NULL

    serial_len:  Buffer size of serial string

    Returns:
    --------

    0:  all fine

    -1:  wrong arguments

    -4:  unable to open device

    -7:  get product manufacturer failed

    -8:  get product description failed

    -9:  get serial number failed

    -11:  libusb_get_device_descriptor() failed 
    """
    return _ftdi1.usb_get_strings(*args)

def usb_get_strings2(*args):
    """
    usb_get_strings(context, device) -> (return_code, manufacturer, description, serial)



    Return device ID strings from the usb device.

    The parameters manufacturer, description and serial may be NULL or
    pointer to buffers to store the fetched strings.

    The old function ftdi_usb_get_strings() always closes the device. This
    version only closes the device if it was opened by it.

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    dev:  libusb usb_dev to use

    manufacturer:  Store manufacturer string here if not NULL

    mnf_len:  Buffer size of manufacturer string

    description:  Store product description string here if not NULL

    desc_len:  Buffer size of product description string

    serial:  Store serial string here if not NULL

    serial_len:  Buffer size of serial string

    Returns:
    --------

    0:  all fine

    -1:  wrong arguments

    -4:  unable to open device

    -7:  get product manufacturer failed

    -8:  get product description failed

    -9:  get serial number failed

    -11:  libusb_get_device_descriptor() failed 
    """
    return _ftdi1.usb_get_strings2(*args)

def eeprom_get_strings(*args):
    """
    usb_get_strings(context, device) -> (return_code, manufacturer, description, serial)



    Return device ID strings from the eeprom. Device needs to be
    connected.

    The parameters manufacturer, description and serial may be NULL or
    pointer to buffers to store the fetched strings.

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    manufacturer:  Store manufacturer string here if not NULL

    mnf_len:  Buffer size of manufacturer string

    product:  Store product description string here if not NULL

    prod_len:  Buffer size of product description string

    serial:  Store serial string here if not NULL

    serial_len:  Buffer size of serial string

    Returns:
    --------

    0:  all fine

    -1:  ftdi context invalid

    -2:  ftdi eeprom buffer invalid 
    """
    return _ftdi1.eeprom_get_strings(*args)

def read_data(ftdi, buf):
    """
    read_data(context) -> (return_code, buf)



    Reads data in chunks (see ftdi_read_data_set_chunksize()) from the
    chip.

    Automatically strips the two modem status bytes transfered during
    every read.

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    buf:  Buffer to store data in

    size:  Size of the buffer

    Returns:
    --------

    -666:  USB device unavailable

    <0:  error code from libusb_bulk_transfer()

    0:  no data was available

    >0:  number of bytes read 
    """
    return _ftdi1.read_data(ftdi, buf)

def write_data(ftdi, buf):
    """
    write_data(context, data) -> return_code



    Writes data in chunks (see ftdi_write_data_set_chunksize()) to the
    chip

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    buf:  Buffer with the data

    size:  Size of the buffer

    Returns:
    --------

    -666:  USB device unavailable

    <0:  error code from usb_bulk_write()

    >0:  number of bytes written 
    """
    return _ftdi1.write_data(ftdi, buf)

def read_data_get_chunksize(ftdi):
    """
    read_data_get_chunksize(context ftdi) -> int



    Get read buffer chunk size.

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    chunksize:  Pointer to store chunk size in

    Returns:
    --------

    0:  all fine

    -1:  FTDI context invalid 
    """
    return _ftdi1.read_data_get_chunksize(ftdi)

def write_data_get_chunksize(ftdi):
    """
    write_data_get_chunksize(context ftdi) -> int



    Get write buffer chunk size.

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    chunksize:  Pointer to store chunk size in

    Returns:
    --------

    0:  all fine

    -1:  ftdi context invalid 
    """
    return _ftdi1.write_data_get_chunksize(ftdi)

def read_pins(ftdi):
    """
    read_pins(context) -> (return_code, pins)



    Directly read pin state, circumventing the read buffer. Useful for
    bitbang mode.

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    pins:  Pointer to store pins into

    Returns:
    --------

    0:  all fine

    -1:  read pins failed

    -2:  USB device unavailable 
    """
    return _ftdi1.read_pins(ftdi)

def get_latency_timer(ftdi):
    """
    get_latency_timer(context ftdi) -> int



    Get latency timer

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    latency:  Pointer to store latency value in

    Returns:
    --------

    0:  all fine

    -1:  unable to get latency timer

    -2:  USB device unavailable 
    """
    return _ftdi1.get_latency_timer(ftdi)

def poll_modem_status(ftdi):
    """
    poll_modem_status(context ftdi) -> int



    Poll modem status information

    This function allows the retrieve the two status bytes of the device.
    The device sends these bytes also as a header for each read access
    where they are discarded by ftdi_read_data(). The chip generates the
    two stripped status bytes in the absence of data every 40 ms.

    Layout of the first byte: B0..B3 - must be 0

    B4 Clear to send (CTS) 0 = inactive 1 = active

    B5 Data set ready (DTS) 0 = inactive 1 = active

    B6 Ring indicator (RI) 0 = inactive 1 = active

    B7 Receive line signal detect (RLSD) 0 = inactive 1 = active

    Layout of the second byte: B0 Data ready (DR)

    B1 Overrun error (OE)

    B2 Parity error (PE)

    B3 Framing error (FE)

    B4 Break interrupt (BI)

    B5 Transmitter holding register (THRE)

    B6 Transmitter empty (TEMT)

    B7 Error in RCVR FIFO

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    status:  Pointer to store status information in. Must be two bytes.

    Returns:
    --------

    0:  all fine

    -1:  unable to retrieve status information

    -2:  USB device unavailable 
    """
    return _ftdi1.poll_modem_status(ftdi)

def get_eeprom_value(ftdi, value_name):
    """
    get_eeprom_value(context ftdi, enum ftdi_eeprom_value value_name) -> int



    Get a value from the decoded EEPROM structure

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    value_name:  Enum of the value to query

    value:  Pointer to store read value

    Returns:
    --------

    0:  all fine

    -1:  Value doesn't exist 
    """
    return _ftdi1.get_eeprom_value(ftdi, value_name)

def get_eeprom_buf(ftdi, buf):
    """
    get_eeprom_buf(context ftdi, unsigned char * buf) -> int



    Get the read-only buffer to the binary EEPROM content

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    buf:  buffer to receive EEPROM content

    size:  Size of receiving buffer

    Returns:
    --------

    0:  All fine

    -1:  struct ftdi_contxt or ftdi_eeprom missing

    -2:  Not enough room to store eeprom 
    """
    return _ftdi1.get_eeprom_buf(ftdi, buf)

def read_eeprom_location(ftdi, eeprom_addr):
    """
    read_eeprom_location(context, eeprom_addr) -> (return_code, eeprom_val)



    Read eeprom location

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    eeprom_addr:  Address of eeprom location to be read

    eeprom_val:  Pointer to store read eeprom location

    Returns:
    --------

    0:  all fine

    -1:  read failed

    -2:  USB device unavailable 
    """
    return _ftdi1.read_eeprom_location(ftdi, eeprom_addr)

def read_chipid(ftdi):
    """
    ftdi_read_chipid(context) -> (return_code, chipid)



    Read the FTDIChip-ID from R-type devices

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    chipid:  Pointer to store FTDIChip-ID

    Returns:
    --------

    0:  all fine

    -1:  read failed

    -2:  USB device unavailable 
    """
    return _ftdi1.read_chipid(ftdi)
TYPE_AM = _ftdi1.TYPE_AM
TYPE_BM = _ftdi1.TYPE_BM
TYPE_2232C = _ftdi1.TYPE_2232C
TYPE_R = _ftdi1.TYPE_R
TYPE_2232H = _ftdi1.TYPE_2232H
TYPE_4232H = _ftdi1.TYPE_4232H
TYPE_232H = _ftdi1.TYPE_232H
TYPE_230X = _ftdi1.TYPE_230X
NONE = _ftdi1.NONE
ODD = _ftdi1.ODD
EVEN = _ftdi1.EVEN
MARK = _ftdi1.MARK
SPACE = _ftdi1.SPACE
STOP_BIT_1 = _ftdi1.STOP_BIT_1
STOP_BIT_15 = _ftdi1.STOP_BIT_15
STOP_BIT_2 = _ftdi1.STOP_BIT_2
BITS_7 = _ftdi1.BITS_7
BITS_8 = _ftdi1.BITS_8
BREAK_OFF = _ftdi1.BREAK_OFF
BREAK_ON = _ftdi1.BREAK_ON
BITMODE_RESET = _ftdi1.BITMODE_RESET
BITMODE_BITBANG = _ftdi1.BITMODE_BITBANG
BITMODE_MPSSE = _ftdi1.BITMODE_MPSSE
BITMODE_SYNCBB = _ftdi1.BITMODE_SYNCBB
BITMODE_MCU = _ftdi1.BITMODE_MCU
BITMODE_OPTO = _ftdi1.BITMODE_OPTO
BITMODE_CBUS = _ftdi1.BITMODE_CBUS
BITMODE_SYNCFF = _ftdi1.BITMODE_SYNCFF
BITMODE_FT1284 = _ftdi1.BITMODE_FT1284
INTERFACE_ANY = _ftdi1.INTERFACE_ANY
INTERFACE_A = _ftdi1.INTERFACE_A
INTERFACE_B = _ftdi1.INTERFACE_B
INTERFACE_C = _ftdi1.INTERFACE_C
INTERFACE_D = _ftdi1.INTERFACE_D
AUTO_DETACH_SIO_MODULE = _ftdi1.AUTO_DETACH_SIO_MODULE
DONT_DETACH_SIO_MODULE = _ftdi1.DONT_DETACH_SIO_MODULE
MPSSE_WRITE_NEG = _ftdi1.MPSSE_WRITE_NEG
MPSSE_BITMODE = _ftdi1.MPSSE_BITMODE
MPSSE_READ_NEG = _ftdi1.MPSSE_READ_NEG
MPSSE_LSB = _ftdi1.MPSSE_LSB
MPSSE_DO_WRITE = _ftdi1.MPSSE_DO_WRITE
MPSSE_DO_READ = _ftdi1.MPSSE_DO_READ
MPSSE_WRITE_TMS = _ftdi1.MPSSE_WRITE_TMS
SET_BITS_LOW = _ftdi1.SET_BITS_LOW
SET_BITS_HIGH = _ftdi1.SET_BITS_HIGH
GET_BITS_LOW = _ftdi1.GET_BITS_LOW
GET_BITS_HIGH = _ftdi1.GET_BITS_HIGH
LOOPBACK_START = _ftdi1.LOOPBACK_START
LOOPBACK_END = _ftdi1.LOOPBACK_END
TCK_DIVISOR = _ftdi1.TCK_DIVISOR
DIS_DIV_5 = _ftdi1.DIS_DIV_5
EN_DIV_5 = _ftdi1.EN_DIV_5
EN_3_PHASE = _ftdi1.EN_3_PHASE
DIS_3_PHASE = _ftdi1.DIS_3_PHASE
CLK_BITS = _ftdi1.CLK_BITS
CLK_BYTES = _ftdi1.CLK_BYTES
CLK_WAIT_HIGH = _ftdi1.CLK_WAIT_HIGH
CLK_WAIT_LOW = _ftdi1.CLK_WAIT_LOW
EN_ADAPTIVE = _ftdi1.EN_ADAPTIVE
DIS_ADAPTIVE = _ftdi1.DIS_ADAPTIVE
CLK_BYTES_OR_HIGH = _ftdi1.CLK_BYTES_OR_HIGH
CLK_BYTES_OR_LOW = _ftdi1.CLK_BYTES_OR_LOW
DRIVE_OPEN_COLLECTOR = _ftdi1.DRIVE_OPEN_COLLECTOR
SEND_IMMEDIATE = _ftdi1.SEND_IMMEDIATE
WAIT_ON_HIGH = _ftdi1.WAIT_ON_HIGH
WAIT_ON_LOW = _ftdi1.WAIT_ON_LOW
READ_SHORT = _ftdi1.READ_SHORT
READ_EXTENDED = _ftdi1.READ_EXTENDED
WRITE_SHORT = _ftdi1.WRITE_SHORT
WRITE_EXTENDED = _ftdi1.WRITE_EXTENDED
SIO_RESET = _ftdi1.SIO_RESET
SIO_MODEM_CTRL = _ftdi1.SIO_MODEM_CTRL
SIO_SET_FLOW_CTRL = _ftdi1.SIO_SET_FLOW_CTRL
SIO_SET_BAUD_RATE = _ftdi1.SIO_SET_BAUD_RATE
SIO_SET_DATA = _ftdi1.SIO_SET_DATA
SIO_RESET_REQUEST = _ftdi1.SIO_RESET_REQUEST
SIO_SET_BAUDRATE_REQUEST = _ftdi1.SIO_SET_BAUDRATE_REQUEST
SIO_SET_DATA_REQUEST = _ftdi1.SIO_SET_DATA_REQUEST
SIO_SET_FLOW_CTRL_REQUEST = _ftdi1.SIO_SET_FLOW_CTRL_REQUEST
SIO_SET_MODEM_CTRL_REQUEST = _ftdi1.SIO_SET_MODEM_CTRL_REQUEST
SIO_POLL_MODEM_STATUS_REQUEST = _ftdi1.SIO_POLL_MODEM_STATUS_REQUEST
SIO_SET_EVENT_CHAR_REQUEST = _ftdi1.SIO_SET_EVENT_CHAR_REQUEST
SIO_SET_ERROR_CHAR_REQUEST = _ftdi1.SIO_SET_ERROR_CHAR_REQUEST
SIO_SET_LATENCY_TIMER_REQUEST = _ftdi1.SIO_SET_LATENCY_TIMER_REQUEST
SIO_GET_LATENCY_TIMER_REQUEST = _ftdi1.SIO_GET_LATENCY_TIMER_REQUEST
SIO_SET_BITMODE_REQUEST = _ftdi1.SIO_SET_BITMODE_REQUEST
SIO_READ_PINS_REQUEST = _ftdi1.SIO_READ_PINS_REQUEST
SIO_READ_EEPROM_REQUEST = _ftdi1.SIO_READ_EEPROM_REQUEST
SIO_WRITE_EEPROM_REQUEST = _ftdi1.SIO_WRITE_EEPROM_REQUEST
SIO_ERASE_EEPROM_REQUEST = _ftdi1.SIO_ERASE_EEPROM_REQUEST
SIO_RESET_SIO = _ftdi1.SIO_RESET_SIO
SIO_RESET_PURGE_RX = _ftdi1.SIO_RESET_PURGE_RX
SIO_RESET_PURGE_TX = _ftdi1.SIO_RESET_PURGE_TX
SIO_DISABLE_FLOW_CTRL = _ftdi1.SIO_DISABLE_FLOW_CTRL
SIO_RTS_CTS_HS = _ftdi1.SIO_RTS_CTS_HS
SIO_DTR_DSR_HS = _ftdi1.SIO_DTR_DSR_HS
SIO_XON_XOFF_HS = _ftdi1.SIO_XON_XOFF_HS
SIO_SET_DTR_MASK = _ftdi1.SIO_SET_DTR_MASK
SIO_SET_DTR_HIGH = _ftdi1.SIO_SET_DTR_HIGH
SIO_SET_DTR_LOW = _ftdi1.SIO_SET_DTR_LOW
SIO_SET_RTS_MASK = _ftdi1.SIO_SET_RTS_MASK
SIO_SET_RTS_HIGH = _ftdi1.SIO_SET_RTS_HIGH
SIO_SET_RTS_LOW = _ftdi1.SIO_SET_RTS_LOW
class transfer_control(_object):
    """Proxy of C ftdi_transfer_control struct."""

    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, transfer_control, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, transfer_control, name)
    __repr__ = _swig_repr
    __swig_setmethods__["completed"] = _ftdi1.transfer_control_completed_set
    __swig_getmethods__["completed"] = _ftdi1.transfer_control_completed_get
    if _newclass:
        completed = _swig_property(_ftdi1.transfer_control_completed_get, _ftdi1.transfer_control_completed_set)
    __swig_setmethods__["buf"] = _ftdi1.transfer_control_buf_set
    __swig_getmethods__["buf"] = _ftdi1.transfer_control_buf_get
    if _newclass:
        buf = _swig_property(_ftdi1.transfer_control_buf_get, _ftdi1.transfer_control_buf_set)
    __swig_setmethods__["size"] = _ftdi1.transfer_control_size_set
    __swig_getmethods__["size"] = _ftdi1.transfer_control_size_get
    if _newclass:
        size = _swig_property(_ftdi1.transfer_control_size_get, _ftdi1.transfer_control_size_set)
    __swig_setmethods__["offset"] = _ftdi1.transfer_control_offset_set
    __swig_getmethods__["offset"] = _ftdi1.transfer_control_offset_get
    if _newclass:
        offset = _swig_property(_ftdi1.transfer_control_offset_get, _ftdi1.transfer_control_offset_set)
    __swig_setmethods__["ftdi"] = _ftdi1.transfer_control_ftdi_set
    __swig_getmethods__["ftdi"] = _ftdi1.transfer_control_ftdi_get
    if _newclass:
        ftdi = _swig_property(_ftdi1.transfer_control_ftdi_get, _ftdi1.transfer_control_ftdi_set)
    __swig_setmethods__["transfer"] = _ftdi1.transfer_control_transfer_set
    __swig_getmethods__["transfer"] = _ftdi1.transfer_control_transfer_get
    if _newclass:
        transfer = _swig_property(_ftdi1.transfer_control_transfer_get, _ftdi1.transfer_control_transfer_set)

    def __init__(self):
        """__init__(ftdi_transfer_control self) -> transfer_control"""
        this = _ftdi1.new_transfer_control()
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _ftdi1.delete_transfer_control
    __del__ = lambda self: None
transfer_control_swigregister = _ftdi1.transfer_control_swigregister
transfer_control_swigregister(transfer_control)

class context(_object):
    """Proxy of C ftdi_context struct."""

    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, context, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, context, name)
    __repr__ = _swig_repr
    __swig_setmethods__["usb_ctx"] = _ftdi1.context_usb_ctx_set
    __swig_getmethods__["usb_ctx"] = _ftdi1.context_usb_ctx_get
    if _newclass:
        usb_ctx = _swig_property(_ftdi1.context_usb_ctx_get, _ftdi1.context_usb_ctx_set)
    __swig_setmethods__["usb_dev"] = _ftdi1.context_usb_dev_set
    __swig_getmethods__["usb_dev"] = _ftdi1.context_usb_dev_get
    if _newclass:
        usb_dev = _swig_property(_ftdi1.context_usb_dev_get, _ftdi1.context_usb_dev_set)
    __swig_setmethods__["usb_read_timeout"] = _ftdi1.context_usb_read_timeout_set
    __swig_getmethods__["usb_read_timeout"] = _ftdi1.context_usb_read_timeout_get
    if _newclass:
        usb_read_timeout = _swig_property(_ftdi1.context_usb_read_timeout_get, _ftdi1.context_usb_read_timeout_set)
    __swig_setmethods__["usb_write_timeout"] = _ftdi1.context_usb_write_timeout_set
    __swig_getmethods__["usb_write_timeout"] = _ftdi1.context_usb_write_timeout_get
    if _newclass:
        usb_write_timeout = _swig_property(_ftdi1.context_usb_write_timeout_get, _ftdi1.context_usb_write_timeout_set)
    __swig_setmethods__["type"] = _ftdi1.context_type_set
    __swig_getmethods__["type"] = _ftdi1.context_type_get
    if _newclass:
        type = _swig_property(_ftdi1.context_type_get, _ftdi1.context_type_set)
    __swig_setmethods__["baudrate"] = _ftdi1.context_baudrate_set
    __swig_getmethods__["baudrate"] = _ftdi1.context_baudrate_get
    if _newclass:
        baudrate = _swig_property(_ftdi1.context_baudrate_get, _ftdi1.context_baudrate_set)
    __swig_setmethods__["bitbang_enabled"] = _ftdi1.context_bitbang_enabled_set
    __swig_getmethods__["bitbang_enabled"] = _ftdi1.context_bitbang_enabled_get
    if _newclass:
        bitbang_enabled = _swig_property(_ftdi1.context_bitbang_enabled_get, _ftdi1.context_bitbang_enabled_set)
    __swig_setmethods__["readbuffer"] = _ftdi1.context_readbuffer_set
    __swig_getmethods__["readbuffer"] = _ftdi1.context_readbuffer_get
    if _newclass:
        readbuffer = _swig_property(_ftdi1.context_readbuffer_get, _ftdi1.context_readbuffer_set)
    __swig_setmethods__["readbuffer_offset"] = _ftdi1.context_readbuffer_offset_set
    __swig_getmethods__["readbuffer_offset"] = _ftdi1.context_readbuffer_offset_get
    if _newclass:
        readbuffer_offset = _swig_property(_ftdi1.context_readbuffer_offset_get, _ftdi1.context_readbuffer_offset_set)
    __swig_setmethods__["readbuffer_remaining"] = _ftdi1.context_readbuffer_remaining_set
    __swig_getmethods__["readbuffer_remaining"] = _ftdi1.context_readbuffer_remaining_get
    if _newclass:
        readbuffer_remaining = _swig_property(_ftdi1.context_readbuffer_remaining_get, _ftdi1.context_readbuffer_remaining_set)
    __swig_setmethods__["readbuffer_chunksize"] = _ftdi1.context_readbuffer_chunksize_set
    __swig_getmethods__["readbuffer_chunksize"] = _ftdi1.context_readbuffer_chunksize_get
    if _newclass:
        readbuffer_chunksize = _swig_property(_ftdi1.context_readbuffer_chunksize_get, _ftdi1.context_readbuffer_chunksize_set)
    __swig_setmethods__["writebuffer_chunksize"] = _ftdi1.context_writebuffer_chunksize_set
    __swig_getmethods__["writebuffer_chunksize"] = _ftdi1.context_writebuffer_chunksize_get
    if _newclass:
        writebuffer_chunksize = _swig_property(_ftdi1.context_writebuffer_chunksize_get, _ftdi1.context_writebuffer_chunksize_set)
    __swig_setmethods__["max_packet_size"] = _ftdi1.context_max_packet_size_set
    __swig_getmethods__["max_packet_size"] = _ftdi1.context_max_packet_size_get
    if _newclass:
        max_packet_size = _swig_property(_ftdi1.context_max_packet_size_get, _ftdi1.context_max_packet_size_set)
    __swig_setmethods__["interface"] = _ftdi1.context_interface_set
    __swig_getmethods__["interface"] = _ftdi1.context_interface_get
    if _newclass:
        interface = _swig_property(_ftdi1.context_interface_get, _ftdi1.context_interface_set)
    __swig_setmethods__["index"] = _ftdi1.context_index_set
    __swig_getmethods__["index"] = _ftdi1.context_index_get
    if _newclass:
        index = _swig_property(_ftdi1.context_index_get, _ftdi1.context_index_set)
    __swig_setmethods__["in_ep"] = _ftdi1.context_in_ep_set
    __swig_getmethods__["in_ep"] = _ftdi1.context_in_ep_get
    if _newclass:
        in_ep = _swig_property(_ftdi1.context_in_ep_get, _ftdi1.context_in_ep_set)
    __swig_setmethods__["out_ep"] = _ftdi1.context_out_ep_set
    __swig_getmethods__["out_ep"] = _ftdi1.context_out_ep_get
    if _newclass:
        out_ep = _swig_property(_ftdi1.context_out_ep_get, _ftdi1.context_out_ep_set)
    __swig_setmethods__["bitbang_mode"] = _ftdi1.context_bitbang_mode_set
    __swig_getmethods__["bitbang_mode"] = _ftdi1.context_bitbang_mode_get
    if _newclass:
        bitbang_mode = _swig_property(_ftdi1.context_bitbang_mode_get, _ftdi1.context_bitbang_mode_set)
    __swig_setmethods__["eeprom"] = _ftdi1.context_eeprom_set
    __swig_getmethods__["eeprom"] = _ftdi1.context_eeprom_get
    if _newclass:
        eeprom = _swig_property(_ftdi1.context_eeprom_get, _ftdi1.context_eeprom_set)
    __swig_setmethods__["error_str"] = _ftdi1.context_error_str_set
    __swig_getmethods__["error_str"] = _ftdi1.context_error_str_get
    if _newclass:
        error_str = _swig_property(_ftdi1.context_error_str_get, _ftdi1.context_error_str_set)
    __swig_setmethods__["module_detach_mode"] = _ftdi1.context_module_detach_mode_set
    __swig_getmethods__["module_detach_mode"] = _ftdi1.context_module_detach_mode_get
    if _newclass:
        module_detach_mode = _swig_property(_ftdi1.context_module_detach_mode_get, _ftdi1.context_module_detach_mode_set)

    def __init__(self):
        """__init__(ftdi_context self) -> context"""
        this = _ftdi1.new_context()
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _ftdi1.delete_context
    __del__ = lambda self: None
context_swigregister = _ftdi1.context_swigregister
context_swigregister(context)

VENDOR_ID = _ftdi1.VENDOR_ID
PRODUCT_ID = _ftdi1.PRODUCT_ID
SELF_POWERED = _ftdi1.SELF_POWERED
REMOTE_WAKEUP = _ftdi1.REMOTE_WAKEUP
IS_NOT_PNP = _ftdi1.IS_NOT_PNP
SUSPEND_DBUS7 = _ftdi1.SUSPEND_DBUS7
IN_IS_ISOCHRONOUS = _ftdi1.IN_IS_ISOCHRONOUS
OUT_IS_ISOCHRONOUS = _ftdi1.OUT_IS_ISOCHRONOUS
SUSPEND_PULL_DOWNS = _ftdi1.SUSPEND_PULL_DOWNS
USE_SERIAL = _ftdi1.USE_SERIAL
USB_VERSION = _ftdi1.USB_VERSION
USE_USB_VERSION = _ftdi1.USE_USB_VERSION
MAX_POWER = _ftdi1.MAX_POWER
CHANNEL_A_TYPE = _ftdi1.CHANNEL_A_TYPE
CHANNEL_B_TYPE = _ftdi1.CHANNEL_B_TYPE
CHANNEL_A_DRIVER = _ftdi1.CHANNEL_A_DRIVER
CHANNEL_B_DRIVER = _ftdi1.CHANNEL_B_DRIVER
CBUS_FUNCTION_0 = _ftdi1.CBUS_FUNCTION_0
CBUS_FUNCTION_1 = _ftdi1.CBUS_FUNCTION_1
CBUS_FUNCTION_2 = _ftdi1.CBUS_FUNCTION_2
CBUS_FUNCTION_3 = _ftdi1.CBUS_FUNCTION_3
CBUS_FUNCTION_4 = _ftdi1.CBUS_FUNCTION_4
CBUS_FUNCTION_5 = _ftdi1.CBUS_FUNCTION_5
CBUS_FUNCTION_6 = _ftdi1.CBUS_FUNCTION_6
CBUS_FUNCTION_7 = _ftdi1.CBUS_FUNCTION_7
CBUS_FUNCTION_8 = _ftdi1.CBUS_FUNCTION_8
CBUS_FUNCTION_9 = _ftdi1.CBUS_FUNCTION_9
HIGH_CURRENT = _ftdi1.HIGH_CURRENT
HIGH_CURRENT_A = _ftdi1.HIGH_CURRENT_A
HIGH_CURRENT_B = _ftdi1.HIGH_CURRENT_B
INVERT = _ftdi1.INVERT
GROUP0_DRIVE = _ftdi1.GROUP0_DRIVE
GROUP0_SCHMITT = _ftdi1.GROUP0_SCHMITT
GROUP0_SLEW = _ftdi1.GROUP0_SLEW
GROUP1_DRIVE = _ftdi1.GROUP1_DRIVE
GROUP1_SCHMITT = _ftdi1.GROUP1_SCHMITT
GROUP1_SLEW = _ftdi1.GROUP1_SLEW
GROUP2_DRIVE = _ftdi1.GROUP2_DRIVE
GROUP2_SCHMITT = _ftdi1.GROUP2_SCHMITT
GROUP2_SLEW = _ftdi1.GROUP2_SLEW
GROUP3_DRIVE = _ftdi1.GROUP3_DRIVE
GROUP3_SCHMITT = _ftdi1.GROUP3_SCHMITT
GROUP3_SLEW = _ftdi1.GROUP3_SLEW
CHIP_SIZE = _ftdi1.CHIP_SIZE
CHIP_TYPE = _ftdi1.CHIP_TYPE
POWER_SAVE = _ftdi1.POWER_SAVE
CLOCK_POLARITY = _ftdi1.CLOCK_POLARITY
DATA_ORDER = _ftdi1.DATA_ORDER
FLOW_CONTROL = _ftdi1.FLOW_CONTROL
CHANNEL_C_DRIVER = _ftdi1.CHANNEL_C_DRIVER
CHANNEL_D_DRIVER = _ftdi1.CHANNEL_D_DRIVER
CHANNEL_A_RS485 = _ftdi1.CHANNEL_A_RS485
CHANNEL_B_RS485 = _ftdi1.CHANNEL_B_RS485
CHANNEL_C_RS485 = _ftdi1.CHANNEL_C_RS485
CHANNEL_D_RS485 = _ftdi1.CHANNEL_D_RS485
RELEASE_NUMBER = _ftdi1.RELEASE_NUMBER
EXTERNAL_OSCILLATOR = _ftdi1.EXTERNAL_OSCILLATOR
USER_DATA_ADDR = _ftdi1.USER_DATA_ADDR
class device_list(_object):
    """Proxy of C ftdi_device_list struct."""

    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, device_list, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, device_list, name)
    __repr__ = _swig_repr
    __swig_setmethods__["next"] = _ftdi1.device_list_next_set
    __swig_getmethods__["next"] = _ftdi1.device_list_next_get
    if _newclass:
        next = _swig_property(_ftdi1.device_list_next_get, _ftdi1.device_list_next_set)
    __swig_setmethods__["dev"] = _ftdi1.device_list_dev_set
    __swig_getmethods__["dev"] = _ftdi1.device_list_dev_get
    if _newclass:
        dev = _swig_property(_ftdi1.device_list_dev_get, _ftdi1.device_list_dev_set)

    def __init__(self):
        """__init__(ftdi_device_list self) -> device_list"""
        this = _ftdi1.new_device_list()
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _ftdi1.delete_device_list
    __del__ = lambda self: None
device_list_swigregister = _ftdi1.device_list_swigregister
device_list_swigregister(device_list)

FT1284_CLK_IDLE_STATE = _ftdi1.FT1284_CLK_IDLE_STATE
FT1284_DATA_LSB = _ftdi1.FT1284_DATA_LSB
FT1284_FLOW_CONTROL = _ftdi1.FT1284_FLOW_CONTROL
POWER_SAVE_DISABLE_H = _ftdi1.POWER_SAVE_DISABLE_H
USE_SERIAL_NUM = _ftdi1.USE_SERIAL_NUM
CBUS_TXDEN = _ftdi1.CBUS_TXDEN
CBUS_PWREN = _ftdi1.CBUS_PWREN
CBUS_RXLED = _ftdi1.CBUS_RXLED
CBUS_TXLED = _ftdi1.CBUS_TXLED
CBUS_TXRXLED = _ftdi1.CBUS_TXRXLED
CBUS_SLEEP = _ftdi1.CBUS_SLEEP
CBUS_CLK48 = _ftdi1.CBUS_CLK48
CBUS_CLK24 = _ftdi1.CBUS_CLK24
CBUS_CLK12 = _ftdi1.CBUS_CLK12
CBUS_CLK6 = _ftdi1.CBUS_CLK6
CBUS_IOMODE = _ftdi1.CBUS_IOMODE
CBUS_BB_WR = _ftdi1.CBUS_BB_WR
CBUS_BB_RD = _ftdi1.CBUS_BB_RD
CBUSH_TRISTATE = _ftdi1.CBUSH_TRISTATE
CBUSH_TXLED = _ftdi1.CBUSH_TXLED
CBUSH_RXLED = _ftdi1.CBUSH_RXLED
CBUSH_TXRXLED = _ftdi1.CBUSH_TXRXLED
CBUSH_PWREN = _ftdi1.CBUSH_PWREN
CBUSH_SLEEP = _ftdi1.CBUSH_SLEEP
CBUSH_DRIVE_0 = _ftdi1.CBUSH_DRIVE_0
CBUSH_DRIVE1 = _ftdi1.CBUSH_DRIVE1
CBUSH_IOMODE = _ftdi1.CBUSH_IOMODE
CBUSH_TXDEN = _ftdi1.CBUSH_TXDEN
CBUSH_CLK30 = _ftdi1.CBUSH_CLK30
CBUSH_CLK15 = _ftdi1.CBUSH_CLK15
CBUSH_CLK7_5 = _ftdi1.CBUSH_CLK7_5
CBUSX_TRISTATE = _ftdi1.CBUSX_TRISTATE
CBUSX_TXLED = _ftdi1.CBUSX_TXLED
CBUSX_RXLED = _ftdi1.CBUSX_RXLED
CBUSX_TXRXLED = _ftdi1.CBUSX_TXRXLED
CBUSX_PWREN = _ftdi1.CBUSX_PWREN
CBUSX_SLEEP = _ftdi1.CBUSX_SLEEP
CBUSX_DRIVE_0 = _ftdi1.CBUSX_DRIVE_0
CBUSX_DRIVE1 = _ftdi1.CBUSX_DRIVE1
CBUSX_IOMODE = _ftdi1.CBUSX_IOMODE
CBUSX_TXDEN = _ftdi1.CBUSX_TXDEN
CBUSX_CLK24 = _ftdi1.CBUSX_CLK24
CBUSX_CLK12 = _ftdi1.CBUSX_CLK12
CBUSX_CLK6 = _ftdi1.CBUSX_CLK6
CBUSX_BAT_DETECT = _ftdi1.CBUSX_BAT_DETECT
CBUSX_BAT_DETECT_NEG = _ftdi1.CBUSX_BAT_DETECT_NEG
CBUSX_I2C_TXE = _ftdi1.CBUSX_I2C_TXE
CBUSX_I2C_RXF = _ftdi1.CBUSX_I2C_RXF
CBUSX_VBUS_SENSE = _ftdi1.CBUSX_VBUS_SENSE
CBUSX_BB_WR = _ftdi1.CBUSX_BB_WR
CBUSX_BB_RD = _ftdi1.CBUSX_BB_RD
CBUSX_TIME_STAMP = _ftdi1.CBUSX_TIME_STAMP
CBUSX_AWAKE = _ftdi1.CBUSX_AWAKE
INVERT_TXD = _ftdi1.INVERT_TXD
INVERT_RXD = _ftdi1.INVERT_RXD
INVERT_RTS = _ftdi1.INVERT_RTS
INVERT_CTS = _ftdi1.INVERT_CTS
INVERT_DTR = _ftdi1.INVERT_DTR
INVERT_DSR = _ftdi1.INVERT_DSR
INVERT_DCD = _ftdi1.INVERT_DCD
INVERT_RI = _ftdi1.INVERT_RI
CHANNEL_IS_UART = _ftdi1.CHANNEL_IS_UART
CHANNEL_IS_FIFO = _ftdi1.CHANNEL_IS_FIFO
CHANNEL_IS_OPTO = _ftdi1.CHANNEL_IS_OPTO
CHANNEL_IS_CPU = _ftdi1.CHANNEL_IS_CPU
CHANNEL_IS_FT1284 = _ftdi1.CHANNEL_IS_FT1284
CHANNEL_IS_RS485 = _ftdi1.CHANNEL_IS_RS485
DRIVE_4MA = _ftdi1.DRIVE_4MA
DRIVE_8MA = _ftdi1.DRIVE_8MA
DRIVE_12MA = _ftdi1.DRIVE_12MA
DRIVE_16MA = _ftdi1.DRIVE_16MA
SLOW_SLEW = _ftdi1.SLOW_SLEW
IS_SCHMITT = _ftdi1.IS_SCHMITT
DRIVER_VCP = _ftdi1.DRIVER_VCP
DRIVER_VCPH = _ftdi1.DRIVER_VCPH
USE_USB_VERSION_BIT = _ftdi1.USE_USB_VERSION_BIT
SUSPEND_DBUS7_BIT = _ftdi1.SUSPEND_DBUS7_BIT
HIGH_CURRENT_DRIVE = _ftdi1.HIGH_CURRENT_DRIVE
HIGH_CURRENT_DRIVE_R = _ftdi1.HIGH_CURRENT_DRIVE_R
class size_and_time(_object):
    """Proxy of C size_and_time struct."""

    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, size_and_time, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, size_and_time, name)
    __repr__ = _swig_repr
    __swig_setmethods__["totalBytes"] = _ftdi1.size_and_time_totalBytes_set
    __swig_getmethods__["totalBytes"] = _ftdi1.size_and_time_totalBytes_get
    if _newclass:
        totalBytes = _swig_property(_ftdi1.size_and_time_totalBytes_get, _ftdi1.size_and_time_totalBytes_set)
    __swig_setmethods__["time"] = _ftdi1.size_and_time_time_set
    __swig_getmethods__["time"] = _ftdi1.size_and_time_time_get
    if _newclass:
        time = _swig_property(_ftdi1.size_and_time_time_get, _ftdi1.size_and_time_time_set)

    def __init__(self):
        """__init__(size_and_time self) -> size_and_time"""
        this = _ftdi1.new_size_and_time()
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _ftdi1.delete_size_and_time
    __del__ = lambda self: None
size_and_time_swigregister = _ftdi1.size_and_time_swigregister
size_and_time_swigregister(size_and_time)

class FTDIProgressInfo(_object):
    """Proxy of C FTDIProgressInfo struct."""

    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, FTDIProgressInfo, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, FTDIProgressInfo, name)
    __repr__ = _swig_repr
    __swig_setmethods__["first"] = _ftdi1.FTDIProgressInfo_first_set
    __swig_getmethods__["first"] = _ftdi1.FTDIProgressInfo_first_get
    if _newclass:
        first = _swig_property(_ftdi1.FTDIProgressInfo_first_get, _ftdi1.FTDIProgressInfo_first_set)
    __swig_setmethods__["prev"] = _ftdi1.FTDIProgressInfo_prev_set
    __swig_getmethods__["prev"] = _ftdi1.FTDIProgressInfo_prev_get
    if _newclass:
        prev = _swig_property(_ftdi1.FTDIProgressInfo_prev_get, _ftdi1.FTDIProgressInfo_prev_set)
    __swig_setmethods__["current"] = _ftdi1.FTDIProgressInfo_current_set
    __swig_getmethods__["current"] = _ftdi1.FTDIProgressInfo_current_get
    if _newclass:
        current = _swig_property(_ftdi1.FTDIProgressInfo_current_get, _ftdi1.FTDIProgressInfo_current_set)
    __swig_setmethods__["totalTime"] = _ftdi1.FTDIProgressInfo_totalTime_set
    __swig_getmethods__["totalTime"] = _ftdi1.FTDIProgressInfo_totalTime_get
    if _newclass:
        totalTime = _swig_property(_ftdi1.FTDIProgressInfo_totalTime_get, _ftdi1.FTDIProgressInfo_totalTime_set)
    __swig_setmethods__["totalRate"] = _ftdi1.FTDIProgressInfo_totalRate_set
    __swig_getmethods__["totalRate"] = _ftdi1.FTDIProgressInfo_totalRate_get
    if _newclass:
        totalRate = _swig_property(_ftdi1.FTDIProgressInfo_totalRate_get, _ftdi1.FTDIProgressInfo_totalRate_set)
    __swig_setmethods__["currentRate"] = _ftdi1.FTDIProgressInfo_currentRate_set
    __swig_getmethods__["currentRate"] = _ftdi1.FTDIProgressInfo_currentRate_get
    if _newclass:
        currentRate = _swig_property(_ftdi1.FTDIProgressInfo_currentRate_get, _ftdi1.FTDIProgressInfo_currentRate_set)

    def __init__(self):
        """__init__(FTDIProgressInfo self) -> FTDIProgressInfo"""
        this = _ftdi1.new_FTDIProgressInfo()
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _ftdi1.delete_FTDIProgressInfo
    __del__ = lambda self: None
FTDIProgressInfo_swigregister = _ftdi1.FTDIProgressInfo_swigregister
FTDIProgressInfo_swigregister(FTDIProgressInfo)

class version_info(_object):
    """Proxy of C ftdi_version_info struct."""

    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, version_info, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, version_info, name)
    __repr__ = _swig_repr
    __swig_setmethods__["major"] = _ftdi1.version_info_major_set
    __swig_getmethods__["major"] = _ftdi1.version_info_major_get
    if _newclass:
        major = _swig_property(_ftdi1.version_info_major_get, _ftdi1.version_info_major_set)
    __swig_setmethods__["minor"] = _ftdi1.version_info_minor_set
    __swig_getmethods__["minor"] = _ftdi1.version_info_minor_get
    if _newclass:
        minor = _swig_property(_ftdi1.version_info_minor_get, _ftdi1.version_info_minor_set)
    __swig_setmethods__["micro"] = _ftdi1.version_info_micro_set
    __swig_getmethods__["micro"] = _ftdi1.version_info_micro_get
    if _newclass:
        micro = _swig_property(_ftdi1.version_info_micro_get, _ftdi1.version_info_micro_set)
    __swig_getmethods__["version_str"] = _ftdi1.version_info_version_str_get
    if _newclass:
        version_str = _swig_property(_ftdi1.version_info_version_str_get)
    __swig_getmethods__["snapshot_str"] = _ftdi1.version_info_snapshot_str_get
    if _newclass:
        snapshot_str = _swig_property(_ftdi1.version_info_snapshot_str_get)

    def __init__(self):
        """__init__(ftdi_version_info self) -> version_info"""
        this = _ftdi1.new_version_info()
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _ftdi1.delete_version_info
    __del__ = lambda self: None
version_info_swigregister = _ftdi1.version_info_swigregister
version_info_swigregister(version_info)


def init(ftdi):
    """
    init(context ftdi) -> int



    Initializes a ftdi_context.

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    Returns:
    --------

    0:  all fine

    -1:  couldn't allocate read buffer

    -2:  couldn't allocate struct buffer

    -3:  libusb_init() failed

    This should be called before all functions 
    """
    return _ftdi1.init(ftdi)

def new():
    """
    new() -> context



    Allocate and initialize a new ftdi_context

    a pointer to a new ftdi_context, or NULL on failure 
    """
    return _ftdi1.new()

def set_interface(ftdi, interface):
    """
    set_interface(context ftdi, enum ftdi_interface interface) -> int



    Open selected channels on a chip, otherwise use first channel.

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    interface:  Interface to use for FT2232C/2232H/4232H chips.

    Returns:
    --------

    0:  all fine

    -1:  unknown interface

    -2:  USB device unavailable

    -3:  Device already open, interface can't be set in that state 
    """
    return _ftdi1.set_interface(ftdi, interface)

def deinit(ftdi):
    """
    deinit(context ftdi)



    Deinitializes a ftdi_context.

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context 
    """
    return _ftdi1.deinit(ftdi)

def free(ftdi):
    """
    free(context ftdi)



    Deinitialize and free an ftdi_context.

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context 
    """
    return _ftdi1.free(ftdi)

def set_usbdev(ftdi, usbdev):
    """
    set_usbdev(context ftdi, struct libusb_device_handle * usbdev)



    Use an already open libusb device.

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    usb:  libusb libusb_device_handle to use 
    """
    return _ftdi1.set_usbdev(ftdi, usbdev)

def get_library_version():
    """
    get_library_version() -> version_info



    Get libftdi library version.

    ftdi_version_info Library version information 
    """
    return _ftdi1.get_library_version()

def list_free(devlist):
    """
    list_free(struct ftdi_device_list ** devlist)



    Frees a usb device list.

    Parameters:
    -----------

    devlist:  USB device list created by ftdi_usb_find_all() 
    """
    return _ftdi1.list_free(devlist)

def list_free2(devlist):
    """
    list_free2(device_list devlist)



    Frees a usb device list.

    Parameters:
    -----------

    devlist:  USB device list created by ftdi_usb_find_all() 
    """
    return _ftdi1.list_free2(devlist)

def eeprom_set_strings(ftdi, manufacturer, product, serial):
    """eeprom_set_strings(context ftdi, char * manufacturer, char * product, char * serial) -> int"""
    return _ftdi1.eeprom_set_strings(ftdi, manufacturer, product, serial)

def usb_open(ftdi, vendor, product):
    """
    usb_open(context ftdi, int vendor, int product) -> int



    Opens the first device with a given vendor and product ids.

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    vendor:  Vendor ID

    product:  Product ID

    Returns:
    --------

    same:  as ftdi_usb_open_desc() 
    """
    return _ftdi1.usb_open(ftdi, vendor, product)

def usb_open_desc(ftdi, vendor, product, description, serial):
    """
    usb_open_desc(context ftdi, int vendor, int product, char const * description, char const * serial) -> int



    Opens the first device with a given, vendor id, product id,
    description and serial.

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    vendor:  Vendor ID

    product:  Product ID

    description:  Description to search for. Use NULL if not needed.

    serial:  Serial to search for. Use NULL if not needed.

    Returns:
    --------

    0:  all fine

    -3:  usb device not found

    -4:  unable to open device

    -5:  unable to claim device

    -6:  reset failed

    -7:  set baudrate failed

    -8:  get product description failed

    -9:  get serial number failed

    -12:  libusb_get_device_list() failed

    -13:  libusb_get_device_descriptor() failed 
    """
    return _ftdi1.usb_open_desc(ftdi, vendor, product, description, serial)

def usb_open_desc_index(ftdi, vendor, product, description, serial, index):
    """
    usb_open_desc_index(context ftdi, int vendor, int product, char const * description, char const * serial, unsigned int index) -> int



    Opens the index-th device with a given, vendor id, product id,
    description and serial.

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    vendor:  Vendor ID

    product:  Product ID

    description:  Description to search for. Use NULL if not needed.

    serial:  Serial to search for. Use NULL if not needed.

    index:  Number of matching device to open if there are more than one,
    starts with 0.

    Returns:
    --------

    0:  all fine

    -1:  usb_find_busses() failed

    -2:  usb_find_devices() failed

    -3:  usb device not found

    -4:  unable to open device

    -5:  unable to claim device

    -6:  reset failed

    -7:  set baudrate failed

    -8:  get product description failed

    -9:  get serial number failed

    -10:  unable to close device

    -11:  ftdi context invalid

    -12:  libusb_get_device_list() failed 
    """
    return _ftdi1.usb_open_desc_index(ftdi, vendor, product, description, serial, index)

def usb_open_bus_addr(ftdi, bus, addr):
    """
    usb_open_bus_addr(context ftdi, uint8_t bus, uint8_t addr) -> int



    Opens the device at a given USB bus and device address.

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    bus:  Bus number

    addr:  Device address

    Returns:
    --------

    0:  all fine

    -1:  usb_find_busses() failed

    -2:  usb_find_devices() failed

    -3:  usb device not found

    -4:  unable to open device

    -5:  unable to claim device

    -6:  reset failed

    -7:  set baudrate failed

    -8:  get product description failed

    -9:  get serial number failed

    -10:  unable to close device

    -11:  ftdi context invalid

    -12:  libusb_get_device_list() failed 
    """
    return _ftdi1.usb_open_bus_addr(ftdi, bus, addr)

def usb_open_dev(ftdi, dev):
    """
    usb_open_dev(context ftdi, struct libusb_device * dev) -> int



    Opens a ftdi device given by an usb_device.

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    dev:  libusb usb_dev to use

    Returns:
    --------

    0:  all fine

    -3:  unable to config device

    -4:  unable to open device

    -5:  unable to claim device

    -6:  reset failed

    -7:  set baudrate failed

    -8:  ftdi context invalid

    -9:  libusb_get_device_descriptor() failed

    -10:  libusb_get_config_descriptor() failed

    -11:  libusb_detach_kernel_driver() failed

    -12:  libusb_get_configuration() failed 
    """
    return _ftdi1.usb_open_dev(ftdi, dev)

def usb_open_string(ftdi, description):
    """
    usb_open_string(context ftdi, char const * description) -> int



    Opens the ftdi-device described by a description-string. Intended to
    be used for parsing a device-description given as commandline
    argument.

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    description:  NULL-terminated description-string, using this format:
    d:<devicenode> path of bus and device-node (e.g. "003/001") within
    usb device tree (usually at /proc/bus/usb/)

    i:<vendor>:<product> first device with given vendor and product id,
    ids can be decimal, octal (preceded by "0") or hex (preceded by
    "0x")

    i:<vendor>:<product>:<index> as above with index being the number of
    the device (starting with 0) if there are more than one

    s:<vendor>:<product>:<serial> first device with given vendor id,
    product id and serial string

    The description format may be extended in later versions.

    Returns:
    --------

    0:  all fine

    -2:  libusb_get_device_list() failed

    -3:  usb device not found

    -4:  unable to open device

    -5:  unable to claim device

    -6:  reset failed

    -7:  set baudrate failed

    -8:  get product description failed

    -9:  get serial number failed

    -10:  unable to close device

    -11:  illegal description format

    -12:  ftdi context invalid 
    """
    return _ftdi1.usb_open_string(ftdi, description)

def usb_close(ftdi):
    """
    usb_close(context ftdi) -> int



    Closes the ftdi device. Call ftdi_deinit() if you're cleaning up.

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    Returns:
    --------

    0:  all fine

    -1:  usb_release failed

    -3:  ftdi context invalid 
    """
    return _ftdi1.usb_close(ftdi)

def usb_reset(ftdi):
    """
    usb_reset(context ftdi) -> int



    Resets the ftdi device.

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    Returns:
    --------

    0:  all fine

    -1:  FTDI reset failed

    -2:  USB device unavailable 
    """
    return _ftdi1.usb_reset(ftdi)

def usb_purge_rx_buffer(ftdi):
    """
    usb_purge_rx_buffer(context ftdi) -> int



    Clears the read buffer on the chip and the internal read buffer.

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    Returns:
    --------

    0:  all fine

    -1:  read buffer purge failed

    -2:  USB device unavailable 
    """
    return _ftdi1.usb_purge_rx_buffer(ftdi)

def usb_purge_tx_buffer(ftdi):
    """
    usb_purge_tx_buffer(context ftdi) -> int



    Clears the write buffer on the chip.

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    Returns:
    --------

    0:  all fine

    -1:  write buffer purge failed

    -2:  USB device unavailable 
    """
    return _ftdi1.usb_purge_tx_buffer(ftdi)

def usb_purge_buffers(ftdi):
    """
    usb_purge_buffers(context ftdi) -> int



    Clears the buffers on the chip and the internal read buffer.

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    Returns:
    --------

    0:  all fine

    -1:  read buffer purge failed

    -2:  write buffer purge failed

    -3:  USB device unavailable 
    """
    return _ftdi1.usb_purge_buffers(ftdi)

def set_baudrate(ftdi, baudrate):
    """
    set_baudrate(context ftdi, int baudrate) -> int



    Sets the chip baud rate

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    baudrate:  baud rate to set

    Returns:
    --------

    0:  all fine

    -1:  invalid baudrate

    -2:  setting baudrate failed

    -3:  USB device unavailable 
    """
    return _ftdi1.set_baudrate(ftdi, baudrate)

def set_line_property(ftdi, bits, sbit, parity):
    """
    set_line_property(context ftdi, enum ftdi_bits_type bits, enum ftdi_stopbits_type sbit, enum ftdi_parity_type parity) -> int



    Set (RS232) line characteristics. The break type can only be set via
    ftdi_set_line_property2() and defaults to "off".

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    bits:  Number of bits

    sbit:  Number of stop bits

    parity:  Parity mode

    Returns:
    --------

    0:  all fine

    -1:  Setting line property failed 
    """
    return _ftdi1.set_line_property(ftdi, bits, sbit, parity)

def set_line_property2(ftdi, bits, sbit, parity, break_type):
    """
    set_line_property2(context ftdi, enum ftdi_bits_type bits, enum ftdi_stopbits_type sbit, enum ftdi_parity_type parity, enum ftdi_break_type break_type) -> int



    Set (RS232) line characteristics

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    bits:  Number of bits

    sbit:  Number of stop bits

    parity:  Parity mode

    break_type:  Break type

    Returns:
    --------

    0:  all fine

    -1:  Setting line property failed

    -2:  USB device unavailable 
    """
    return _ftdi1.set_line_property2(ftdi, bits, sbit, parity, break_type)

def read_data_set_chunksize(ftdi, chunksize):
    """
    read_data_set_chunksize(context ftdi, unsigned int chunksize) -> int



    Configure read buffer chunk size. Default is 4096.

    Automatically reallocates the buffer.

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    chunksize:  Chunk size

    Returns:
    --------

    0:  all fine

    -1:  ftdi context invalid 
    """
    return _ftdi1.read_data_set_chunksize(ftdi, chunksize)

def write_data_set_chunksize(ftdi, chunksize):
    """
    write_data_set_chunksize(context ftdi, unsigned int chunksize) -> int



    Configure write buffer chunk size. Default is 4096.

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    chunksize:  Chunk size

    Returns:
    --------

    0:  all fine

    -1:  ftdi context invalid 
    """
    return _ftdi1.write_data_set_chunksize(ftdi, chunksize)

def readstream(ftdi, callback, userdata, packetsPerTransfer, numTransfers):
    """readstream(context ftdi, FTDIStreamCallback * callback, void * userdata, int packetsPerTransfer, int numTransfers) -> int"""
    return _ftdi1.readstream(ftdi, callback, userdata, packetsPerTransfer, numTransfers)

def write_data_submit(ftdi, buf, size):
    """
    write_data_submit(context ftdi, unsigned char * buf, int size) -> transfer_control



    Writes data to the chip. Does not wait for completion of the transfer
    nor does it make sure that the transfer was successful.

    Use libusb 1.0 asynchronous API.

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    buf:  Buffer with the data

    size:  Size of the buffer

    Returns:
    --------

    NULL:  Some error happens when submit transfer

    !NULL:  Pointer to a ftdi_transfer_control 
    """
    return _ftdi1.write_data_submit(ftdi, buf, size)

def read_data_submit(ftdi, buf, size):
    """
    read_data_submit(context ftdi, unsigned char * buf, int size) -> transfer_control



    Reads data from the chip. Does not wait for completion of the transfer
    nor does it make sure that the transfer was successful.

    Use libusb 1.0 asynchronous API.

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    buf:  Buffer with the data

    size:  Size of the buffer

    Returns:
    --------

    NULL:  Some error happens when submit transfer

    !NULL:  Pointer to a ftdi_transfer_control 
    """
    return _ftdi1.read_data_submit(ftdi, buf, size)

def transfer_data_done(tc):
    """
    transfer_data_done(transfer_control tc) -> int



    Wait for completion of the transfer.

    Use libusb 1.0 asynchronous API.

    Parameters:
    -----------

    tc:  pointer to ftdi_transfer_control

    Returns:
    --------

    <:  0: Some error happens

    >=:  0: Data size transferred

    tc->transfer could be NULL if "(size <= ftdi->readbuffer_remaining)"
    at ftdi_read_data_submit(). Therefore, we need to check it here. 
    """
    return _ftdi1.transfer_data_done(tc)

def transfer_data_cancel(tc, to):
    """
    transfer_data_cancel(transfer_control tc, struct timeval * to)



    Cancel transfer and wait for completion.

    Use libusb 1.0 asynchronous API.

    Parameters:
    -----------

    tc:  pointer to ftdi_transfer_control

    to:  pointer to timeout value or NULL for infinite 
    """
    return _ftdi1.transfer_data_cancel(tc, to)

def set_bitmode(ftdi, bitmask, mode):
    """
    set_bitmode(context ftdi, unsigned char bitmask, unsigned char mode) -> int



    Enable/disable bitbang modes.

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    bitmask:  Bitmask to configure lines. HIGH/ON value configures a line
    as output.

    mode:  Bitbang mode: use the values defined in ftdi_mpsse_mode

    Returns:
    --------

    0:  all fine

    -1:  can't enable bitbang mode

    -2:  USB device unavailable 
    """
    return _ftdi1.set_bitmode(ftdi, bitmask, mode)

def disable_bitbang(ftdi):
    """
    disable_bitbang(context ftdi) -> int



    Disable bitbang mode.

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    Returns:
    --------

    0:  all fine

    -1:  can't disable bitbang mode

    -2:  USB device unavailable 
    """
    return _ftdi1.disable_bitbang(ftdi)

def set_latency_timer(ftdi, latency):
    """
    set_latency_timer(context ftdi, unsigned char latency) -> int



    Set latency timer

    The FTDI chip keeps data in the internal buffer for a specific amount
    of time if the buffer is not full yet to decrease load on the usb bus.

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    latency:  Value between 1 and 255

    Returns:
    --------

    0:  all fine

    -1:  latency out of range

    -2:  unable to set latency timer

    -3:  USB device unavailable 
    """
    return _ftdi1.set_latency_timer(ftdi, latency)

def setflowctrl(ftdi, flowctrl):
    """
    setflowctrl(context ftdi, int flowctrl) -> int



    Set flowcontrol for ftdi chip

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    flowctrl:  flow control to use. should be SIO_DISABLE_FLOW_CTRL,
    SIO_RTS_CTS_HS, SIO_DTR_DSR_HS or SIO_XON_XOFF_HS

    Returns:
    --------

    0:  all fine

    -1:  set flow control failed

    -2:  USB device unavailable 
    """
    return _ftdi1.setflowctrl(ftdi, flowctrl)

def setdtr_rts(ftdi, dtr, rts):
    """
    setdtr_rts(context ftdi, int dtr, int rts) -> int



    Set dtr and rts line in one pass

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    dtr:  DTR state to set line to (1 or 0)

    rts:  RTS state to set line to (1 or 0)

    Returns:
    --------

    0:  all fine

    -1:  set dtr/rts failed

    -2:  USB device unavailable 
    """
    return _ftdi1.setdtr_rts(ftdi, dtr, rts)

def setdtr(ftdi, state):
    """
    setdtr(context ftdi, int state) -> int



    Set dtr line

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    state:  state to set line to (1 or 0)

    Returns:
    --------

    0:  all fine

    -1:  set dtr failed

    -2:  USB device unavailable 
    """
    return _ftdi1.setdtr(ftdi, state)

def setrts(ftdi, state):
    """
    setrts(context ftdi, int state) -> int



    Set rts line

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    state:  state to set line to (1 or 0)

    Returns:
    --------

    0:  all fine

    -1:  set rts failed

    -2:  USB device unavailable 
    """
    return _ftdi1.setrts(ftdi, state)

def set_event_char(ftdi, eventch, enable):
    """
    set_event_char(context ftdi, unsigned char eventch, unsigned char enable) -> int



    Set the special event character

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    eventch:  Event character

    enable:  0 to disable the event character, non-zero otherwise

    Returns:
    --------

    0:  all fine

    -1:  unable to set event character

    -2:  USB device unavailable 
    """
    return _ftdi1.set_event_char(ftdi, eventch, enable)

def set_error_char(ftdi, errorch, enable):
    """
    set_error_char(context ftdi, unsigned char errorch, unsigned char enable) -> int



    Set error character

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    errorch:  Error character

    enable:  0 to disable the error character, non-zero otherwise

    Returns:
    --------

    0:  all fine

    -1:  unable to set error character

    -2:  USB device unavailable 
    """
    return _ftdi1.set_error_char(ftdi, errorch, enable)

def eeprom_initdefaults(ftdi, manufacturer, product, serial):
    """
    eeprom_initdefaults(context ftdi, char * manufacturer, char * product, char * serial) -> int



    Init eeprom with default values for the connected device

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    manufacturer:  String to use as Manufacturer

    product:  String to use as Product description

    serial:  String to use as Serial number description

    Returns:
    --------

    0:  all fine

    -1:  No struct ftdi_context

    -2:  No struct ftdi_eeprom

    -3:  No connected device or device not yet opened 
    """
    return _ftdi1.eeprom_initdefaults(ftdi, manufacturer, product, serial)

def eeprom_build(ftdi):
    """
    eeprom_build(context ftdi) -> int



    Build binary buffer from ftdi_eeprom structure. Output is suitable for
    ftdi_write_eeprom().

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    Returns:
    --------

    >=0:  size of eeprom user area in bytes

    -1:  eeprom size (128 bytes) exceeded by custom strings

    -2:  Invalid eeprom or ftdi pointer

    -3:  Invalid cbus function setting (FIXME: Not in the code?)

    -4:  Chip doesn't support invert (FIXME: Not in the code?)

    -5:  Chip doesn't support high current drive (FIXME: Not in the code?)

    -6:  No connected EEPROM or EEPROM Type unknown 
    """
    return _ftdi1.eeprom_build(ftdi)

def eeprom_decode(ftdi, verbose):
    """
    eeprom_decode(context ftdi, int verbose) -> int



    Decode binary EEPROM image into an ftdi_eeprom structure.

    For FT-X devices use AN_201 FT-X MTP memory Configuration to decode.

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    verbose:  Decode EEPROM on stdout

    Returns:
    --------

    0:  all fine

    -1:  something went wrong

    FIXME: How to pass size? How to handle size field in ftdi_eeprom?
    FIXME: Strings are malloc'ed here and should be freed somewhere 
    """
    return _ftdi1.eeprom_decode(ftdi, verbose)

def set_eeprom_value(ftdi, value_name, value):
    """
    set_eeprom_value(context ftdi, enum ftdi_eeprom_value value_name, int value) -> int



    Set a value in the decoded EEPROM Structure No parameter checking is
    performed

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    value_name:  Enum of the value to set

    value:  to set

    Returns:
    --------

    0:  all fine

    -1:  Value doesn't exist

    -2:  Value not user settable 
    """
    return _ftdi1.set_eeprom_value(ftdi, value_name, value)

def set_eeprom_buf(ftdi, buf, size):
    """
    set_eeprom_buf(context ftdi, unsigned char const * buf, int size) -> int



    Set the EEPROM content from the user-supplied prefilled buffer

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    buf:  buffer to read EEPROM content

    size:  Size of buffer

    Returns:
    --------

    0:  All fine

    -1:  struct ftdi_context or ftdi_eeprom or buf missing 
    """
    return _ftdi1.set_eeprom_buf(ftdi, buf, size)

def set_eeprom_user_data(ftdi, buf, size):
    """
    set_eeprom_user_data(context ftdi, char const * buf, int size) -> int



    Set the EEPROM user data content from the user-supplied prefilled
    buffer

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    buf:  buffer to read EEPROM user data content

    size:  Size of buffer

    Returns:
    --------

    0:  All fine

    -1:  struct ftdi_context or ftdi_eeprom or buf missing 
    """
    return _ftdi1.set_eeprom_user_data(ftdi, buf, size)

def read_eeprom(ftdi):
    """
    read_eeprom(context) -> (return_code, eeprom)



    Read eeprom

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    Returns:
    --------

    0:  all fine

    -1:  read failed

    -2:  USB device unavailable 
    """
    return _ftdi1.read_eeprom(ftdi)

def write_eeprom(ftdi):
    """
    write_eeprom(context ftdi) -> int



    Write eeprom

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    Returns:
    --------

    0:  all fine

    -1:  read failed

    -2:  USB device unavailable

    -3:  EEPROM not initialized for the connected device; 
    """
    return _ftdi1.write_eeprom(ftdi)

def erase_eeprom(ftdi):
    """erase_eeprom(context ftdi) -> int"""
    return _ftdi1.erase_eeprom(ftdi)

def write_eeprom_location(ftdi, eeprom_addr, eeprom_val):
    """
    write_eeprom_location(context ftdi, int eeprom_addr, unsigned short eeprom_val) -> int



    Write eeprom location

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    eeprom_addr:  Address of eeprom location to be written

    eeprom_val:  Value to be written

    Returns:
    --------

    0:  all fine

    -1:  write failed

    -2:  USB device unavailable

    -3:  Invalid access to checksum protected area below 0x80

    -4:  Device can't access unprotected area

    -5:  Reading chip type failed 
    """
    return _ftdi1.write_eeprom_location(ftdi, eeprom_addr, eeprom_val)

def get_error_string(ftdi):
    """
    get_error_string(context ftdi) -> char const *



    Get string representation for last error code

    Parameters:
    -----------

    ftdi:  pointer to ftdi_context

    Returns:
    --------

    Pointer:  to error string 
    """
    return _ftdi1.get_error_string(ftdi)
FTDI_MAX_EEPROM_SIZE = _ftdi1.FTDI_MAX_EEPROM_SIZE
MAX_POWER_MILLIAMP_PER_UNIT = _ftdi1.MAX_POWER_MILLIAMP_PER_UNIT
class eeprom(_object):
    """Proxy of C ftdi_eeprom struct."""

    __swig_setmethods__ = {}
    __setattr__ = lambda self, name, value: _swig_setattr(self, eeprom, name, value)
    __swig_getmethods__ = {}
    __getattr__ = lambda self, name: _swig_getattr(self, eeprom, name)
    __repr__ = _swig_repr
    __swig_setmethods__["vendor_id"] = _ftdi1.eeprom_vendor_id_set
    __swig_getmethods__["vendor_id"] = _ftdi1.eeprom_vendor_id_get
    if _newclass:
        vendor_id = _swig_property(_ftdi1.eeprom_vendor_id_get, _ftdi1.eeprom_vendor_id_set)
    __swig_setmethods__["product_id"] = _ftdi1.eeprom_product_id_set
    __swig_getmethods__["product_id"] = _ftdi1.eeprom_product_id_get
    if _newclass:
        product_id = _swig_property(_ftdi1.eeprom_product_id_get, _ftdi1.eeprom_product_id_set)
    __swig_setmethods__["initialized_for_connected_device"] = _ftdi1.eeprom_initialized_for_connected_device_set
    __swig_getmethods__["initialized_for_connected_device"] = _ftdi1.eeprom_initialized_for_connected_device_get
    if _newclass:
        initialized_for_connected_device = _swig_property(_ftdi1.eeprom_initialized_for_connected_device_get, _ftdi1.eeprom_initialized_for_connected_device_set)
    __swig_setmethods__["self_powered"] = _ftdi1.eeprom_self_powered_set
    __swig_getmethods__["self_powered"] = _ftdi1.eeprom_self_powered_get
    if _newclass:
        self_powered = _swig_property(_ftdi1.eeprom_self_powered_get, _ftdi1.eeprom_self_powered_set)
    __swig_setmethods__["remote_wakeup"] = _ftdi1.eeprom_remote_wakeup_set
    __swig_getmethods__["remote_wakeup"] = _ftdi1.eeprom_remote_wakeup_get
    if _newclass:
        remote_wakeup = _swig_property(_ftdi1.eeprom_remote_wakeup_get, _ftdi1.eeprom_remote_wakeup_set)
    __swig_setmethods__["is_not_pnp"] = _ftdi1.eeprom_is_not_pnp_set
    __swig_getmethods__["is_not_pnp"] = _ftdi1.eeprom_is_not_pnp_get
    if _newclass:
        is_not_pnp = _swig_property(_ftdi1.eeprom_is_not_pnp_get, _ftdi1.eeprom_is_not_pnp_set)
    __swig_setmethods__["suspend_dbus7"] = _ftdi1.eeprom_suspend_dbus7_set
    __swig_getmethods__["suspend_dbus7"] = _ftdi1.eeprom_suspend_dbus7_get
    if _newclass:
        suspend_dbus7 = _swig_property(_ftdi1.eeprom_suspend_dbus7_get, _ftdi1.eeprom_suspend_dbus7_set)
    __swig_setmethods__["in_is_isochronous"] = _ftdi1.eeprom_in_is_isochronous_set
    __swig_getmethods__["in_is_isochronous"] = _ftdi1.eeprom_in_is_isochronous_get
    if _newclass:
        in_is_isochronous = _swig_property(_ftdi1.eeprom_in_is_isochronous_get, _ftdi1.eeprom_in_is_isochronous_set)
    __swig_setmethods__["out_is_isochronous"] = _ftdi1.eeprom_out_is_isochronous_set
    __swig_getmethods__["out_is_isochronous"] = _ftdi1.eeprom_out_is_isochronous_get
    if _newclass:
        out_is_isochronous = _swig_property(_ftdi1.eeprom_out_is_isochronous_get, _ftdi1.eeprom_out_is_isochronous_set)
    __swig_setmethods__["suspend_pull_downs"] = _ftdi1.eeprom_suspend_pull_downs_set
    __swig_getmethods__["suspend_pull_downs"] = _ftdi1.eeprom_suspend_pull_downs_get
    if _newclass:
        suspend_pull_downs = _swig_property(_ftdi1.eeprom_suspend_pull_downs_get, _ftdi1.eeprom_suspend_pull_downs_set)
    __swig_setmethods__["use_serial"] = _ftdi1.eeprom_use_serial_set
    __swig_getmethods__["use_serial"] = _ftdi1.eeprom_use_serial_get
    if _newclass:
        use_serial = _swig_property(_ftdi1.eeprom_use_serial_get, _ftdi1.eeprom_use_serial_set)
    __swig_setmethods__["usb_version"] = _ftdi1.eeprom_usb_version_set
    __swig_getmethods__["usb_version"] = _ftdi1.eeprom_usb_version_get
    if _newclass:
        usb_version = _swig_property(_ftdi1.eeprom_usb_version_get, _ftdi1.eeprom_usb_version_set)
    __swig_setmethods__["use_usb_version"] = _ftdi1.eeprom_use_usb_version_set
    __swig_getmethods__["use_usb_version"] = _ftdi1.eeprom_use_usb_version_get
    if _newclass:
        use_usb_version = _swig_property(_ftdi1.eeprom_use_usb_version_get, _ftdi1.eeprom_use_usb_version_set)
    __swig_setmethods__["max_power"] = _ftdi1.eeprom_max_power_set
    __swig_getmethods__["max_power"] = _ftdi1.eeprom_max_power_get
    if _newclass:
        max_power = _swig_property(_ftdi1.eeprom_max_power_get, _ftdi1.eeprom_max_power_set)
    __swig_setmethods__["manufacturer"] = _ftdi1.eeprom_manufacturer_set
    __swig_getmethods__["manufacturer"] = _ftdi1.eeprom_manufacturer_get
    if _newclass:
        manufacturer = _swig_property(_ftdi1.eeprom_manufacturer_get, _ftdi1.eeprom_manufacturer_set)
    __swig_setmethods__["product"] = _ftdi1.eeprom_product_set
    __swig_getmethods__["product"] = _ftdi1.eeprom_product_get
    if _newclass:
        product = _swig_property(_ftdi1.eeprom_product_get, _ftdi1.eeprom_product_set)
    __swig_setmethods__["serial"] = _ftdi1.eeprom_serial_set
    __swig_getmethods__["serial"] = _ftdi1.eeprom_serial_get
    if _newclass:
        serial = _swig_property(_ftdi1.eeprom_serial_get, _ftdi1.eeprom_serial_set)
    __swig_setmethods__["channel_a_type"] = _ftdi1.eeprom_channel_a_type_set
    __swig_getmethods__["channel_a_type"] = _ftdi1.eeprom_channel_a_type_get
    if _newclass:
        channel_a_type = _swig_property(_ftdi1.eeprom_channel_a_type_get, _ftdi1.eeprom_channel_a_type_set)
    __swig_setmethods__["channel_b_type"] = _ftdi1.eeprom_channel_b_type_set
    __swig_getmethods__["channel_b_type"] = _ftdi1.eeprom_channel_b_type_get
    if _newclass:
        channel_b_type = _swig_property(_ftdi1.eeprom_channel_b_type_get, _ftdi1.eeprom_channel_b_type_set)
    __swig_setmethods__["channel_a_driver"] = _ftdi1.eeprom_channel_a_driver_set
    __swig_getmethods__["channel_a_driver"] = _ftdi1.eeprom_channel_a_driver_get
    if _newclass:
        channel_a_driver = _swig_property(_ftdi1.eeprom_channel_a_driver_get, _ftdi1.eeprom_channel_a_driver_set)
    __swig_setmethods__["channel_b_driver"] = _ftdi1.eeprom_channel_b_driver_set
    __swig_getmethods__["channel_b_driver"] = _ftdi1.eeprom_channel_b_driver_get
    if _newclass:
        channel_b_driver = _swig_property(_ftdi1.eeprom_channel_b_driver_get, _ftdi1.eeprom_channel_b_driver_set)
    __swig_setmethods__["channel_c_driver"] = _ftdi1.eeprom_channel_c_driver_set
    __swig_getmethods__["channel_c_driver"] = _ftdi1.eeprom_channel_c_driver_get
    if _newclass:
        channel_c_driver = _swig_property(_ftdi1.eeprom_channel_c_driver_get, _ftdi1.eeprom_channel_c_driver_set)
    __swig_setmethods__["channel_d_driver"] = _ftdi1.eeprom_channel_d_driver_set
    __swig_getmethods__["channel_d_driver"] = _ftdi1.eeprom_channel_d_driver_get
    if _newclass:
        channel_d_driver = _swig_property(_ftdi1.eeprom_channel_d_driver_get, _ftdi1.eeprom_channel_d_driver_set)
    __swig_setmethods__["channel_a_rs485enable"] = _ftdi1.eeprom_channel_a_rs485enable_set
    __swig_getmethods__["channel_a_rs485enable"] = _ftdi1.eeprom_channel_a_rs485enable_get
    if _newclass:
        channel_a_rs485enable = _swig_property(_ftdi1.eeprom_channel_a_rs485enable_get, _ftdi1.eeprom_channel_a_rs485enable_set)
    __swig_setmethods__["channel_b_rs485enable"] = _ftdi1.eeprom_channel_b_rs485enable_set
    __swig_getmethods__["channel_b_rs485enable"] = _ftdi1.eeprom_channel_b_rs485enable_get
    if _newclass:
        channel_b_rs485enable = _swig_property(_ftdi1.eeprom_channel_b_rs485enable_get, _ftdi1.eeprom_channel_b_rs485enable_set)
    __swig_setmethods__["channel_c_rs485enable"] = _ftdi1.eeprom_channel_c_rs485enable_set
    __swig_getmethods__["channel_c_rs485enable"] = _ftdi1.eeprom_channel_c_rs485enable_get
    if _newclass:
        channel_c_rs485enable = _swig_property(_ftdi1.eeprom_channel_c_rs485enable_get, _ftdi1.eeprom_channel_c_rs485enable_set)
    __swig_setmethods__["channel_d_rs485enable"] = _ftdi1.eeprom_channel_d_rs485enable_set
    __swig_getmethods__["channel_d_rs485enable"] = _ftdi1.eeprom_channel_d_rs485enable_get
    if _newclass:
        channel_d_rs485enable = _swig_property(_ftdi1.eeprom_channel_d_rs485enable_get, _ftdi1.eeprom_channel_d_rs485enable_set)
    __swig_setmethods__["cbus_function"] = _ftdi1.eeprom_cbus_function_set
    __swig_getmethods__["cbus_function"] = _ftdi1.eeprom_cbus_function_get
    if _newclass:
        cbus_function = _swig_property(_ftdi1.eeprom_cbus_function_get, _ftdi1.eeprom_cbus_function_set)
    __swig_setmethods__["high_current"] = _ftdi1.eeprom_high_current_set
    __swig_getmethods__["high_current"] = _ftdi1.eeprom_high_current_get
    if _newclass:
        high_current = _swig_property(_ftdi1.eeprom_high_current_get, _ftdi1.eeprom_high_current_set)
    __swig_setmethods__["high_current_a"] = _ftdi1.eeprom_high_current_a_set
    __swig_getmethods__["high_current_a"] = _ftdi1.eeprom_high_current_a_get
    if _newclass:
        high_current_a = _swig_property(_ftdi1.eeprom_high_current_a_get, _ftdi1.eeprom_high_current_a_set)
    __swig_setmethods__["high_current_b"] = _ftdi1.eeprom_high_current_b_set
    __swig_getmethods__["high_current_b"] = _ftdi1.eeprom_high_current_b_get
    if _newclass:
        high_current_b = _swig_property(_ftdi1.eeprom_high_current_b_get, _ftdi1.eeprom_high_current_b_set)
    __swig_setmethods__["invert"] = _ftdi1.eeprom_invert_set
    __swig_getmethods__["invert"] = _ftdi1.eeprom_invert_get
    if _newclass:
        invert = _swig_property(_ftdi1.eeprom_invert_get, _ftdi1.eeprom_invert_set)
    __swig_setmethods__["external_oscillator"] = _ftdi1.eeprom_external_oscillator_set
    __swig_getmethods__["external_oscillator"] = _ftdi1.eeprom_external_oscillator_get
    if _newclass:
        external_oscillator = _swig_property(_ftdi1.eeprom_external_oscillator_get, _ftdi1.eeprom_external_oscillator_set)
    __swig_setmethods__["group0_drive"] = _ftdi1.eeprom_group0_drive_set
    __swig_getmethods__["group0_drive"] = _ftdi1.eeprom_group0_drive_get
    if _newclass:
        group0_drive = _swig_property(_ftdi1.eeprom_group0_drive_get, _ftdi1.eeprom_group0_drive_set)
    __swig_setmethods__["group0_schmitt"] = _ftdi1.eeprom_group0_schmitt_set
    __swig_getmethods__["group0_schmitt"] = _ftdi1.eeprom_group0_schmitt_get
    if _newclass:
        group0_schmitt = _swig_property(_ftdi1.eeprom_group0_schmitt_get, _ftdi1.eeprom_group0_schmitt_set)
    __swig_setmethods__["group0_slew"] = _ftdi1.eeprom_group0_slew_set
    __swig_getmethods__["group0_slew"] = _ftdi1.eeprom_group0_slew_get
    if _newclass:
        group0_slew = _swig_property(_ftdi1.eeprom_group0_slew_get, _ftdi1.eeprom_group0_slew_set)
    __swig_setmethods__["group1_drive"] = _ftdi1.eeprom_group1_drive_set
    __swig_getmethods__["group1_drive"] = _ftdi1.eeprom_group1_drive_get
    if _newclass:
        group1_drive = _swig_property(_ftdi1.eeprom_group1_drive_get, _ftdi1.eeprom_group1_drive_set)
    __swig_setmethods__["group1_schmitt"] = _ftdi1.eeprom_group1_schmitt_set
    __swig_getmethods__["group1_schmitt"] = _ftdi1.eeprom_group1_schmitt_get
    if _newclass:
        group1_schmitt = _swig_property(_ftdi1.eeprom_group1_schmitt_get, _ftdi1.eeprom_group1_schmitt_set)
    __swig_setmethods__["group1_slew"] = _ftdi1.eeprom_group1_slew_set
    __swig_getmethods__["group1_slew"] = _ftdi1.eeprom_group1_slew_get
    if _newclass:
        group1_slew = _swig_property(_ftdi1.eeprom_group1_slew_get, _ftdi1.eeprom_group1_slew_set)
    __swig_setmethods__["group2_drive"] = _ftdi1.eeprom_group2_drive_set
    __swig_getmethods__["group2_drive"] = _ftdi1.eeprom_group2_drive_get
    if _newclass:
        group2_drive = _swig_property(_ftdi1.eeprom_group2_drive_get, _ftdi1.eeprom_group2_drive_set)
    __swig_setmethods__["group2_schmitt"] = _ftdi1.eeprom_group2_schmitt_set
    __swig_getmethods__["group2_schmitt"] = _ftdi1.eeprom_group2_schmitt_get
    if _newclass:
        group2_schmitt = _swig_property(_ftdi1.eeprom_group2_schmitt_get, _ftdi1.eeprom_group2_schmitt_set)
    __swig_setmethods__["group2_slew"] = _ftdi1.eeprom_group2_slew_set
    __swig_getmethods__["group2_slew"] = _ftdi1.eeprom_group2_slew_get
    if _newclass:
        group2_slew = _swig_property(_ftdi1.eeprom_group2_slew_get, _ftdi1.eeprom_group2_slew_set)
    __swig_setmethods__["group3_drive"] = _ftdi1.eeprom_group3_drive_set
    __swig_getmethods__["group3_drive"] = _ftdi1.eeprom_group3_drive_get
    if _newclass:
        group3_drive = _swig_property(_ftdi1.eeprom_group3_drive_get, _ftdi1.eeprom_group3_drive_set)
    __swig_setmethods__["group3_schmitt"] = _ftdi1.eeprom_group3_schmitt_set
    __swig_getmethods__["group3_schmitt"] = _ftdi1.eeprom_group3_schmitt_get
    if _newclass:
        group3_schmitt = _swig_property(_ftdi1.eeprom_group3_schmitt_get, _ftdi1.eeprom_group3_schmitt_set)
    __swig_setmethods__["group3_slew"] = _ftdi1.eeprom_group3_slew_set
    __swig_getmethods__["group3_slew"] = _ftdi1.eeprom_group3_slew_get
    if _newclass:
        group3_slew = _swig_property(_ftdi1.eeprom_group3_slew_get, _ftdi1.eeprom_group3_slew_set)
    __swig_setmethods__["powersave"] = _ftdi1.eeprom_powersave_set
    __swig_getmethods__["powersave"] = _ftdi1.eeprom_powersave_get
    if _newclass:
        powersave = _swig_property(_ftdi1.eeprom_powersave_get, _ftdi1.eeprom_powersave_set)
    __swig_setmethods__["clock_polarity"] = _ftdi1.eeprom_clock_polarity_set
    __swig_getmethods__["clock_polarity"] = _ftdi1.eeprom_clock_polarity_get
    if _newclass:
        clock_polarity = _swig_property(_ftdi1.eeprom_clock_polarity_get, _ftdi1.eeprom_clock_polarity_set)
    __swig_setmethods__["data_order"] = _ftdi1.eeprom_data_order_set
    __swig_getmethods__["data_order"] = _ftdi1.eeprom_data_order_get
    if _newclass:
        data_order = _swig_property(_ftdi1.eeprom_data_order_get, _ftdi1.eeprom_data_order_set)
    __swig_setmethods__["flow_control"] = _ftdi1.eeprom_flow_control_set
    __swig_getmethods__["flow_control"] = _ftdi1.eeprom_flow_control_get
    if _newclass:
        flow_control = _swig_property(_ftdi1.eeprom_flow_control_get, _ftdi1.eeprom_flow_control_set)
    __swig_setmethods__["user_data_addr"] = _ftdi1.eeprom_user_data_addr_set
    __swig_getmethods__["user_data_addr"] = _ftdi1.eeprom_user_data_addr_get
    if _newclass:
        user_data_addr = _swig_property(_ftdi1.eeprom_user_data_addr_get, _ftdi1.eeprom_user_data_addr_set)
    __swig_setmethods__["user_data_size"] = _ftdi1.eeprom_user_data_size_set
    __swig_getmethods__["user_data_size"] = _ftdi1.eeprom_user_data_size_get
    if _newclass:
        user_data_size = _swig_property(_ftdi1.eeprom_user_data_size_get, _ftdi1.eeprom_user_data_size_set)
    __swig_setmethods__["user_data"] = _ftdi1.eeprom_user_data_set
    __swig_getmethods__["user_data"] = _ftdi1.eeprom_user_data_get
    if _newclass:
        user_data = _swig_property(_ftdi1.eeprom_user_data_get, _ftdi1.eeprom_user_data_set)
    __swig_setmethods__["size"] = _ftdi1.eeprom_size_set
    __swig_getmethods__["size"] = _ftdi1.eeprom_size_get
    if _newclass:
        size = _swig_property(_ftdi1.eeprom_size_get, _ftdi1.eeprom_size_set)
    __swig_setmethods__["chip"] = _ftdi1.eeprom_chip_set
    __swig_getmethods__["chip"] = _ftdi1.eeprom_chip_get
    if _newclass:
        chip = _swig_property(_ftdi1.eeprom_chip_get, _ftdi1.eeprom_chip_set)
    __swig_setmethods__["buf"] = _ftdi1.eeprom_buf_set
    __swig_getmethods__["buf"] = _ftdi1.eeprom_buf_get
    if _newclass:
        buf = _swig_property(_ftdi1.eeprom_buf_get, _ftdi1.eeprom_buf_set)
    __swig_setmethods__["release_number"] = _ftdi1.eeprom_release_number_set
    __swig_getmethods__["release_number"] = _ftdi1.eeprom_release_number_get
    if _newclass:
        release_number = _swig_property(_ftdi1.eeprom_release_number_get, _ftdi1.eeprom_release_number_set)

    def __init__(self):
        """__init__(ftdi_eeprom self) -> eeprom"""
        this = _ftdi1.new_eeprom()
        try:
            self.this.append(this)
        except __builtin__.Exception:
            self.this = this
    __swig_destroy__ = _ftdi1.delete_eeprom
    __del__ = lambda self: None
eeprom_swigregister = _ftdi1.eeprom_swigregister
eeprom_swigregister(eeprom)


__version__ = get_library_version().version_str

# This file is compatible with both classic and new-style classes.


