Linux driver for SPI

Started by BJFreeman, May 01, 2013, 07:57:17 PM

Previous topic - Next topic

BJFreeman

I am working towards using SPI in the linux environment, as NOOB.
there are many examples of I2C and Uart, but did not find any for SPI using SPI2.
in my quest I found this as a starting place.
http://www.cs.fsu.edu/~baker/devices/lxr/http/source/linux/include/linux/spi/
I am also following the Hardware implementation thread.

Fulltimer since 89

jeroends

To create a spidev device, the following topic could be usefull: https://www.olimex.com/forum/index.php?topic=835.0
The next thing to experiment with could be the spidevtest program: http://armbedded.eu/node/318
Keep in mind that the spi driver is'nt full duplex, so either you are receiving or you are sending. That's why there's being talked about zeroing out a buffer.
Change for example in the test spi code:


.rx_buf = (unsigned long)rx,to



.rx_buf = 0,

this will give you a working spi output.