Ben Bass  committed e7b00ab

documentation, test & example updates

  • Participants
  • Parent commits 5e98b85
  • Branches default

Comments (0)

Files changed (6)

File doc/index.rst

 Welcome to pylibftdi's documentation!
+pylibftdi is a simple library interacting with FTDI devices to provide
+serial and parallel IO from Python.
+The two main use cases it serves are:
+* the need to control or monitor external equipment, for which a FTDI
+  module may be a cheap and reliable starting point.
+* the need to interact with existing devices which are known to contain
+  FTDI chipsets for their USB interface.
+FTDI ( create devices (chipsets, modules,
+cables etc) to interface devices to the USB port of your computer.
+libftdi ( is an open source
+driver to communicate with these devices, and runs on top of libusb.
+It works on Windows, Linux, and Mac OS X, and likely other systems too.
+pylibftdi is a pure Python module which interfaces (via ctypes) to libftdi,
+exposing a simple file-like API to connected devices. It supports serial and
+parallel IO in a straight-forward way, and aims to be one of the simplest
+ways of interacting with the world outside your PC.
 .. toctree::
    :maxdepth: 2

File doc/introduction.rst

  * Add more examples: SPI devices, knight-rider effects, input devices, MIDI...
  * Perhaps add support for D2XX driver, though the name then becomes a
    slight liability ;)
-    * - support multiple backends; D2XX, libftdi, python-ftdi (if you really wanted?)...
- * General code quality improvements: solid unit tests, decent documentation.

File pylibftdi/examples/

 import time
+import sys
 from pylibftdi import BitBangDevice
             time.sleep(1.0 / (2 * rate))
             bb.port ^= 1
+def main():
+    if len(sys.argv) > 1:
+        rate = float(sys.argv[1])
+        flash_forever(rate)
+    else:
+        flash_forever(1)
 if __name__ == '__main__':
-    flash_forever(1)
+    main()

File tests/

 to be attached.
-from .test_common import (LoopDevice, CallCheckMixin, unittest)
+from tests.test_common import (LoopDevice, CallCheckMixin, unittest)
 from pylibftdi.bitbang import BitBangDevice
 from pylibftdi import FtdiError

File tests/

 to be attached.
-from .test_common import unittest
+from tests.test_common import unittest
 from pylibftdi.util import Bus

File tests/

 to be attached.
-from .test_common import (LoopDevice, Device, CallCheckMixin, unittest)
+from tests.test_common import (LoopDevice, Device, CallCheckMixin, unittest)
 # and now some test cases...