日韩黑丝制服一区视频播放|日韩欧美人妻丝袜视频在线观看|九九影院一级蜜桃|亚洲中文在线导航|青草草视频在线观看|婷婷五月色伊人网站|日本一区二区在线|国产AV一二三四区毛片|正在播放久草视频|亚洲色图精品一区

分享

python USB訪問(wèn)模塊...

 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.

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

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多