SpiDev Documentation
Description .............................................................................................................................................. 1
SPI installation ......................................................................................................................................... 1
How to run python scripts ....................................................................................................................... 2
Examples .................................................................................................................................................. 3
Simple output ...................................................................................................................................... 3
Helpful scripts ...................................................................................................................................... 3
Reverse bits ..................................................................................................................................... 3
Print bytes ....................................................................................................................................... 3
Member ................................................................................................................................................... 3
bits_per_word ..................................................................................................................................... 3
close ..................................................................................................................................................... 3
cshigh ................................................................................................................................................... 4
loop ...................................................................................................................................................... 4
lsbfirst .................................................................................................................................................. 4
max_speed_hz ..................................................................................................................................... 4
mode.................................................................................................................................................... 4
open ..................................................................................................................................................... 4
readbytes ............................................................................................................................................. 4
threewire ............................................................................................................................................. 4
writebytes ............................................................................................................................................ 4
xfer ....................................................................................................................................................... 4
xfer2..................................................................................................................................................... 4
Description
This module defines an object type that allows SPI transactions on hosts running the Linux
kernel. The host kernel must have SPI support and SPI device interface support. All of these
can be either built-in to the kernel, or loaded from modules
Because the SPI device interface is opened R/W, users of this module usually must have root
permissions.
This tutorial is written for the use with a Raspberry Pi (Raspbian Wheezy distribution), but it
should match for several others, too.
SPI installation
First things first, it’s always the best to keep your Raspberry Pi up to date, otherwise some
things here may not work. Open a new console and execute the following commands: