pylibftdi / pylibftdi /

Diff from to


-                 sync=True):
+                 sync=True,
+                 bitbang_mode=BITMODE_BITBANG,
+                 interface=None):
         # initialise the super-class, but don't open yet. We really want
         # two-part initialisation here - set up all the instance variables
         # here in the super class, then open it after having set more
         # of our own variables.
         super(BitBangDevice, self).__init__(device_id=device_id,
-                                            lazy_open=True)
+                                            lazy_open=True,
+                                            interface=interface)
         self.direction = direction
         self.sync = sync
+        self.bitbang_mode = bitbang_mode
         self._last_set_dir = None
         self._latch = 0
         if not lazy_open:
             raise FtdiError("invalid direction bitmask")
         self._direction = dir
         if not self.closed:
-            self.ftdi_fn.ftdi_set_bitmode(dir, BITMODE_BITBANG)
+            self.ftdi_fn.ftdi_set_bitmode(dir, self.bitbang_mode)
             self._last_set_dir = dir
     # port property - 8 bit read/write value
         if self.sync:
             pin_byte = c_ubyte()
-            res = self.fdll.ftdi_read_pins(self.ctx, byref(pin_byte))
+            res = self.ftdi_fn.ftdi_read_pins(byref(pin_byte))
             if res != 0:
                 raise FtdiError("Could not read device pins")
             result = pin_byte.value
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.