A Python module for interfacing with USB-ISS multifunction USB Communication Module
Project description
pyusbiss
A Python API module for interfacing with USB-ISS multifunction USB Communication Module.
From the USB-ISS’s webpage:
The USB-ISS Multifunction USB Communications Module provides a complete interface between your PC and the I2C bus, SPI bus, a Serial port and general purpose Analogue Input or Digital I/O. The module is powered from the USB. Operating voltage is selectable between 3.3v and 5v and can supply up to 80mA at 5v for external circuitry from a standard 100mA USB port.
Python 3 (2 TODO)
Requires pyserial
Free software: MIT license
Documentation: https://pyusbiss.readthedocs.io.
Features
Planned features
Configure USB-ISS to different operating modes; I2C, SPI, I/O and serial
For each mode, the API will mimic the popular APIs such as py-spidev for SPI by having same method and properties names. These names will be used in duck typing. This will ensure miminal adaption of applications wishing to use USB-ISS for prototyping and testing.
Query status of USB-ISS
Send bytes to and read from components via USB-ISS
Current implementation
The SPI mode is implemented with following methods and properties
Methods
xfer - send N bytes and read N bytes back.
Properties
mode - SPI modes. Please note that USB-ISS’s SPI modes don’t match up with official SPI modes. Use official SPI mode numbers and the API will configure the USB-ISS correctly.
Other modes are not implemented.
Installation
pip install pyusbiss
Usage
USBISS only
Connect to your USB-ISS and get information about your USB-ISS.
from usbiss.usbiss import USBISS port = 'COM4' # Windows port = '/dev/ttyACM0' # Linux cxn = USBISS(port) print(repr(cxn)))
SPI mode
Initiate USB-ISS with SPI mode and open a port.
from usbiss.spi import SPI spi = SPI(port) spi.mode = 1 spi.max_speed_hz = 500000 print(repr(spi._usbiss)) # SPI transaction response = spi.xfer([0x00, 0x00])
I2C mode
TODO
I/O mode
TODO
Serial mode
TODO
More Information
Applications
Alphasense OPC via dhhagan’s py-opc module using the SPI protocol.
Credits
The project was developed during a NERC’s placement at University of Leeds.
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
Inspired by Waggle’s alphasense.py, where most of USB-ISS functions were copied over.
History
0.1.0 (2016-09-02)
Initialised project
0.1.1 (2018-03-08)
functional usbiss control and spi control.
0.1.2 (2018-03-08)
Changed SPI mode scheme to official SPI scheme rather than USB-ISS scheme.
Clarifies project mission in README.rst
0.2.0 (2018-03-10)
Refactored the codebase so that each protocol can be controlled by its own class. This means a breaking change in the interface.
SPI and USBISS support only in this release with updated usage.
Added SPI tests.
Updated README.rst with new interface.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pyusbiss-0.2.0.tar.gz
.
File metadata
- Download URL: pyusbiss-0.2.0.tar.gz
- Upload date:
- Size: 12.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 73560cb116b485588bdb54a843ea2b2e03a7d7e508c72cb629ada8524a694415 |
|
MD5 | 24a8289823ec5a9c125f9abfcbe40f9c |
|
BLAKE2b-256 | 48ee4b8e74ab76ac5912baf78ba12cfcb140ebf4f7bf244f87e0fca8b5b5bd0e |
File details
Details for the file pyusbiss-0.2.0-py2.py3-none-any.whl
.
File metadata
- Download URL: pyusbiss-0.2.0-py2.py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28eadb3679ee8a1cb0afd9ff20b7f164578295fd14541763db79c6c6e828d4f2 |
|
MD5 | 0b1d642b14f4d19e44c4b4d0efeb2639 |
|
BLAKE2b-256 | 4a31c98b72c3f344dc7b0a29957ef29e21d4f968cfc6353a890dd5ce275f8a5d |