2020国产成人精品视频,性做久久久久久久久,亚洲国产成人久久综合一区,亚洲影院天堂中文av色

分享

python USB訪問模塊...

 xiaoqdu 2008-12-10

Python/FTDI-USB module

PyUSB 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

  • PyUSB 1.6 supports the new FTDI high speed devices.
  • PyUSB 1.5 eeProgram method now accepts a dict object as input instead of keyword arguments.

Download

Documentation

Please use the source and FTDI's FTD2XX Programmers Guide.

Usage

The 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)
# ----------

Bugs

No 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.

Copyrights

FTDI D2XX

The D2XX library is Copyright ©2001-2004 Future Technology Devices International Ltd.

PyUSB

This 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.

    本站是提供個人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊一鍵舉報。
    轉(zhuǎn)藏 分享 獻花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多