I wrote a linux driver for SPI protocol so RaspberryPi could communicate with my device that's using serial data transfer (the device has clock input and data output). It almost works, the problem is that breaks between transfers are too much for my device to handle - it has very small data buffer that will overflow if data isn't being read fast enough. This might be a bad device design, but I'm more into software engineering than electronics so I have to deal with it somehow through clever programming.
Ideally, SPI communication between RPI and my device should be infinite, with maybe just a few microsecond breaks between large transfers. As of now, using linux driver I wrote, even a few millisecond breaks occur from time to time (I guess it's due to imperfect scheduling on CPU), which is not acceptable for the device. Of course I set up another aync SPI transfer as soon as one is done, so it's not a matter of my driver being too slow.
So can I either:
- make my driver's transfer completion procedure be more reliably scheduled so breaks between transfers are close to none, or
- set up SPI communication in some other way (ie. using DMA directly with SPI peripheral, which I heard is doable, but I don't know if this should be handled in user or kernel space, and how)