This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!
Project Description

SPIlib is a thin wrapper to interact with SPI devices using the Linux “SPIdev” interface [1]

See the accelerometer example in the examples directory.

Usage

Usage is quite simple. First you have to build a Transfer:

from spi import spi_transfer, SPIDev
transfer, buf, _ = spi_transfer(chr(0x1b), readlen=0)

This prepares a transfer which sends one byte (first parameter) and reads none (second parameter). It returns binary data which is then passed to SPIDev (the transfer buffer, the write buffer and the read buffer, the last ignored in the example). It is possible to change the write and read buffer beetween transfers (without altering their lenght of course!).

To actually do the transfer use do_transfer:

myspidev = SPIDev('/dev/spidev0.0')
myspidev.do_transfers([transfer])

do_transfers takes a list of transfers to do in a single “session”, maintaining the device selected. For examples by using three transfers you can write one byte, read and write one at the same time, read one byte. Note that it is not possible to interact with data during a single “session” because of a limit of the Linux SPIDev interface (and thus of this interface)

[1]http://www.kernel.org/doc/Documentation/spi/spidev
Release History

Release History

0.1.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
SPIlib-0.1.0.tar.gz (3.2 kB) Copy SHA256 Checksum SHA256 Source Jul 2, 2012

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting