Copyright (c) 2010-2011 Ben Bass <email@example.com>
+ - Supports Python 2 and Python 3
+ - Supports parallel and serial devices
+ - Support for multiple devices
-See the file "LICENSE" for information terms & conditions
-for usage, and a DISCLAIMER OF ALL WARRANTIES.
-All trademarks referenced herein are property of their respective
+ - Currently only one port per device is used; I've not tested with dual
+ - The API might change prior to reaching a 1.0 release.
-libFTDI itself is developed by Intra2net AG. No association with
-Intra2net is claimed or implied, but I have found their library
-helpful and had fun with it...
+The primary interface is the ``Driver`` class in the pylibftdi package; this
+gives serial access on relevant FTDI devices (e.g. the UM232R), providing a
+file-like interface (read, write). Baudrate is controlled with the ``baudrate``
+If a Driver instance is created with ``mode='t'`` (text mode) then read() and
+write() can use the given ``encoding`` (defaulting to latin-1). This doesn't
+make a lot of difference on Python 2 (and can be omitted), but allows easier
+integration with passing unicode strings between devices in Python 3.
+ >>> from pylibftdi import Driver
+ >>> with Driver(mode='t') as drv:
+ >>> drv.baudrate = 115200
+ >>> drv.write('Hello World')
+The pylibftdi.BitBang wrapper provides access to the parallel IO mode of
+operation through the ``port`` and ``direction`` properties. These provide an
+8 bit IO port including all the relevant bit operations to make things simple.
+ >>> from pylibftdi import BitBang
+ >>> with BitBang() as bb:
+ >>> bb.direction = 0x0F # four LSB are output(1), four MSB are input(0)
+ >>> bb.port |= 2 # set bit 1
+ >>> bb.port &= 0xFE # clear bit 0
+There is support for a number of external devices and protocols, specifically
+for interfacing with HD44780 LCDs using the 4-bit interface.
This package is the result of various bits of work using FTDI's
devices, primarily for controlling external devices. Some of this
is documented on the codedstructure blog, codedstructure.blogspot.com
At least two other open-source Python FTDI wrappers exist, and each
of these may be best for some projects.
-ftd2xx - http://pypi.python.org/pypi/ftd2xx
- - ctypes binding to FTDI's own D2XX driver
-pyftdi - http://git.marcansoft.com/?p=pyftdi.git
- - a C extension libftdi binding
+ * ftd2xx_ - ctypes binding to FTDI's own D2XX driver
+ * pyftdi_ - a C extension libftdi binding
+.. _ftd2xx: http://pypi.python.org/pypi/ftd2xx
+.. _pyftdi: http://git.marcansoft.com/?p=pyftdi.git
pylibftdi exists in the gap between these two projects; ftd2xx uses
the (closed-source) D2XX driver, but provides a high-level Python
a high-level Pythonic interface. Various wrappers and utility
functions are also part of the distribution; following Python's
batteries included approach, there are various interesting devices
- * Add more examples: SPI devices, knight-rider effects, input devices...
- * Further support for serial usage (as opposed to BitBang)
+ * Add more examples: SPI devices, knight-rider effects, input devices, MIDI...
* Perhaps add support for D2XX driver, though the name then becomes a
+ * General code quality improvements: solid unit tests, decent documentation.
+Copyright (c) 2010-2011 Ben Bass <firstname.lastname@example.org>
+pylibftdi is released under the MIT licence; see the file "LICENSE.txt"
+All trademarks referenced herein are property of their respective
+libFTDI itself is developed by Intra2net AG. No association with
+Intra2net is claimed or implied, but I have found their library
+helpful and had fun with it...