Hello,
I'm currently working on a kernel module which needs to communicate via SPI to an external microchip.
I used the cape manager to enable SPI. The device is accessible through /dev/spidev1.0.
But since it's a kernel module, I guess it's not recommended to access files via sys_open()?
Another approach I found would be adding a struct to arch/arm/mach-omap2/board-am335xevm.c and then use spi_register_driver() in my kernel module. But in my kernel sources (3.8.13) this file doesn't exist.
What would be the right way to use SPI in my kernel module?
--
Regards,
Nils
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
static struct spi_driver ad5064_spi_driver = {
.driver = {
.name = "ad5064",
.owner = THIS_MODULE,
},
.probe = ad5064_spi_probe,
.remove = ad5064_spi_remove,
.id_table = ad5064_spi_ids,
};
Thanks, John.
I Iooked at kernel/drivers/iio/dac/ad/5064.c
There's the following struct which is passed to spi_register_driver():static struct spi_driver ad5064_spi_driver = {
.driver = {
.name = "ad5064",
.owner = THIS_MODULE,
},
.probe = ad5064_spi_probe,
.remove = ad5064_spi_remove,
.id_table = ad5064_spi_ids,
};
I compiled the module and loaded it but the probe function never gets called. Why?
Artie Lekstutis
--
For more options, visit http://beagleboard.org/discuss
--- You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/k4LIScayF9M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.
OK, you have several options on how to implement this. First, look in drivers/iio or drivers/staging/iio for example drivers that use SPI. If you use the RT kernel, you will see latency of less than 1mS, but if this isn’t good enough, then I recommend using the PRU to program the McSPI. For examples of how to program the McSPI natively, look at Starterware for example code. If you look on Github, the Starterware examples have been ported to the PRU.
Regards,John
Hi John,
i try to drive the BBB McSPI with using the Pru.Maybe you can help me to find your tip:"If you look on Github, the Starterware examples have been ported to the PRU".Lot of thanks
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/dd56b1a5-b007-4e81-b812-389d268f6d85%40googlegroups.com.
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/71279324-365b-2455-8a4d-375086008404%40hoffmann-hochfrequenz.de.
Great!
Thank you very much.
Best wishes
Peter.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/2ED56849-19C4-4239-9C70-C9D654D68D5E%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/003801d465a2%246ea17790%244be466b0%24%40netcologne.de.
First, a lot of thanks for the pointer, that could really help.
What I really want to accomplish is to get at least a medium bandwidth interface
between the LAN and some real-time data aquisition units. The LAN
side is
patterned after my Agilent 89441A vector signal analyzer. You simply open
port 5025 on 192.169.178.111 and dump/read there
GPIB/IEEE488-like commands &
data streams. That side seems to work, although there is not yet much flesh
to it since the data collection side is still missing.
First I wanted to try the SPI interface, then the 16 bit multiplexed bus
to get an intelligent register interface to some FPGA.
For the SPI, I decided to attach a LT2500-32 ADC; that can do 1 Msample
at 24 bits. Add FFTW in the BBB and you have a respectable Fourier analyzer.
For the hardware, that's all that is needed:
<
https://www.flickr.com/photos/137684711@N07/45331444582/in/album-72157662535945536/
>
The Xilinx Coolrunner2 generates the sampling clock from the 100 MHz crystal osc. and collects
some left-over gates. $1.50 or so. The other small board is the ADC, its regulators and reference.
Home-etched and soldered. :-) It's completely open, in case someone wants it.
The SPI has soaked up much more time than I had planned. A new Debian image from
Robert and some other insights at least made that I don't get a bus error for each SPI access.
One gets thankful for small advances... At least I can now create and start PRU programs,
talk to them via the shared RAM and transfer huge data blocks to Linux virtual memory land
through ping-pong buffers. It's just that I can't make the SPI say a word. Verbatim. :-(
I also can finger the SPI pins when I re-assign them to the PRU
and use R30/R31.
I also have a Red Pitaya. I like it architecture-wise, except that I'll need a larger FPGA
to support fast ADCs with JESDI204B ports - and that it is based on that exotic Alpine Linux.
FPGAs are a home game for me, I've used them since there has been Xilinx.
best regards,
Gerhard
--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to the Google Groups "BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beagleboard...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/09d5304e-5642-0db2-7755-596ee4ccb1a4%40hoffmann-hochfrequenz.de.