Talking over SPI between the Raspberry-Pi and SRF
Here is the code for my quick SRF SPI python class.
This was just a quick class to implement the SRF's SPI protocol and give a couple of TX/RX buffers.
At the bottom of the script is a simple test routine that sends out a--HELLO---- , grabs what ever is already in the SRF's internal buffer then goes into AT command mode and queries the firmware version.
If you would like to give it a go here is how.
First up SPI firmware for the SRF is here on Github, grab the SerialPassThru-V0.68-24MHz-SPI.bin file and flash your XRF/SRF (yes this will work on an XRF), If you have an EVE the SRF will be preloaded with this SPI firmware.
I found the quickest way to get SPI working on Raspbian was using WiringPi great loader tool.
Install WirepinPi then run the following command
$ gpio load spi
This brings up the SPI drivers and give the user access.
The SRFSPI class I have done is in python3 and requires the Quick2Wire python libraries
Install the Quick2Wire libray from github
That should be all the setup done, to run the SRFSPI.py script type the following
$ python3 SRFSPI.py
Let me know how you get on
Please login first in order for you to submit comments