Python/FTDI-USB modulePyUSB is a python module that interfaces to Future Technology Devices (FTDI) D2XX drivers. FTDI USB chips are used in a variety of USB devices such as USB converters and dongles. Currently, PyUSB has been tested under MS Windows. PyUSB is distributed under the GNU Lesser General Public License (LGPL). It is maintained by Pablo Bleyer Kocik. Please email me if you have any questions or if you have found a bug. If you are looking for a way to use the D2XX driver with Java, you can try the jd2xx package. News
Download
DocumentationPlease use the source and FTDI's FTD2XX Programmers Guide. UsageThe PyUSB API follows similar guidelines as the D2XX driver, however the behavior has been modified where necessary to fit the Python programming style. Example# ---------- # import the PyUSB module import d2xx # list devices by description, returns tuple of attached devices description strings d = d2xx.listDevices(d2xx.OPEN_BY_DESCRIPTION) print d # list devices by serial, returns tuple of attached devices serial strings d = d2xx.listDevices() # implicit d2xx.OPEN_BY_SERIAL_NUMBER print d h = d2xx.open(0) print h # read eeprom print h.eeRead() # get queue status print h.getQueueStatus() # set RX/TX timeouts h.setTimeouts(1000,1000) # write bytes (serial mode) print h.write('Hello world!\r\n") # read bytes (serial mode) print h.read(5) # ---------- BugsNo Win32 API compatibility layer functions will be provided. It is better to open a device and pass the handle to the Python for Windows Extension functions. CopyrightsFTDI D2XXThe D2XX library is Copyright ©2001-2004 Future Technology Devices International Ltd. PyUSBThis library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. |
|
來(lái)自: xiaoqdu > 《開發(fā)資料》