PyFtdi aims at providing a user-space driver for modern FTDI devices, implemented in pure Python language.
Modern FTDI devices include:
- FT2232D (dual port, clock up to 6 MHz)
- FT2232H (dual port, clock up to 30 MHz)
- FT4232H (quad port, clock up to 30 MHz)
Other FTDI devices could also been supported (including FT232* devices), although these devices are not a primary goal for PyFtdi, and therefore have not been tested with PyFtdi.
It should support the following modes:
- UART/Serial USB converter, up to 12Mbps (depending on the FTDI device capability)
- SPI master
- JTAG master
- Bitbang/GPIO support (not a primary goal)
PyFtdi relies on PyUSB, which itself depends on one of the following native libraries:
- libusb-1.0 (recommended)
- libusb-0.1 (deprecated)
- openusb (not tested with pyftdi)
PyFtdi does not depend on any other native library, and only uses standard Python modules.
This project is still in an early alpha development stage.
However, PyFtdi is being forked from a closed-source software implementation that has been successfully used for over a year - including serial, spi and jtag protocols, based on top of the libftdi open source library.
libftdi is now being phased out from this closed-source project and replaced with PyFtdi, to ease maintenance and customization.
Meanwhile, PyFtdi is developed as an open-source solution.
- All FTDI device ports (UART, MPSSE) can be used simultaneously.
- Serial port, up to 12 Mbps. PyFtdi includes a pyserial emulation layer that offers transparent access to the FTDI serial ports through a pyserial- compliant API. serialext directory contains a minimal serial terminal that demonstrates the use of this extension, and a dispatcher that automatically selects the serial backend (pyserial, PyFtdi), depending on the serial port name.
- SPI master. PyFtdi includes several examples that demonstrate how to use the FTDI SPI master, with a pure-Python serial flash device driver for several common serial flash devices. These tests show an average 400 KB/s read out from the flash devices running with a 6MHz SPI clock on a Core2Duo Mac Book Pro.
PyFtdi is developed on Mac OS X platforms (including 64-bit kernels), and is validated on a regular basis on Linux hosts.