def __init__(self, device_id=None, mode="b",
self.fdll = self.driver.fdll
# buffer_size (if not 0) chunks the reads and writes
self.buffer_size = buffer_size
+ # interface can be set for devices which have multiple interface
+ # ports (e.g. FT4232, FT2232)
+ self.interface = interface
# lazy_open tells us not to open immediately.
+ if self.interface is not None:
+ self.fdll.ftdi_set_interface(byref(self.ctx), self.interface)
# Try to open the device. If this fails, reset things to how
# they were, but we can't use self.close as that assumes things
# have already been setup.