We have not yet written a guide to using our SPI libraries, but a number of people have spotted that our quick2wire-python-api library on github has SPI support and includes some example scripts.
Several have encountered the problem that the raspbian kernel sets ownership of the two spi channels to root, and that changing the ownership or group memebership only lasts to the nrext reboot.
We suggest the following approach to accessing SPI devices from user accounts:
sudo groupadd -f --system spi sudo adduser pi spi # assuming the pi account is the one that will access SPI
Now, as root, place a file called 90-spi.rules in your /etc/udev/rules.d/ directory with the following contents:
SUBSYSTEM=="spidev", GROUP="spi"
Then reboot.
On this and each subsequent reboot /dev/spidev0.0 and /dev/spidev0.1 will have group set to
spi
and mode set to
og+rw
.

Hi Romilly, I am trying to get a 50MHz SPI bus going for several dozen test stations for our 1080p pico projector. (You might enjoy looking at it on our website, including lasers, it is about the size of a book of paper matches). Most of the SPI is for output of a pattern, with maybe 0.1% of the time for input. I am excited that the raspberry pi runs at 700MHz clock, but still I think I might need assembly code to DMA my pattern out of the RAM.
Can you comment on my chances of success with this approach before I start?
I would think there would be a massive amount of interest in what is basically a logic pattern generator.
looks to me like the first code box is breaking wrong.
I see:
sudo groupadd -f –system
spi sudo adduser pi spi # assuming the pi account is the one that will access SPI
Which presumably should be:
sudo groupadd -f –system spi
sudo adduser pi spi # assuming the pi account is the one that will access SPI