ADS1256 SPI driver for Raspberry Pi

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,



I am currently working on a project for which I need to develop an SPI driver for the first time.
This work involves an ADS1256 ADC. This ADC will send its data via SPI to a Raspberry PI 2 running on ArchLinux. In order to drive the ADS1256 I will have two interrupt sources on two seperate GPIOs of the RPi. 
The gathered data from the ADC will then be displayed on a /dev to be processed later.


Since I need the best precision/speed I want to develop a kernel space SPI driver.


SPI drivers for RPi are located in this github: https://github.com/raspberrypi/linux/tree/rpi-3.18.y/drivers/spi.
When one wants to use SPI he usually inserts spidev and spi-bcm2708 modules so he can interact with them in user space.
>From what I understand, spi-bcm2708 is a controller driver and spidev a generic protocol driver that offers ioctl's.


Since I need to control and dialog with the ADC I guess I need to develop a protocol driver for the ADS1256 that will interact with a controller driver.


However I cannot determine how my driver interacts with this later: the spi-bcm2708 does not offer things like EXPORT_SYMBOL(). 
I know linux/{spi.c spi.h} offers an API but then I'd loose the benefits of using spi-bcm2708 (GPIO and registers setup etc).

So here is my problem: I am not sure wether my SPI driver must be a protocol or a controller driver, nor how it interacts with other Linux SPI components.

I have read things like https://www.kernel.org/doc/Documentation/spi/spi-summary, http://stackoverflow.com/questions/22632713/how-to-write-a-simple-device-driver-in-linux and tried to learn a bit from http://lxr.free-electrons.com/source/drivers/spi/spi-omap2-mcspi.c and of course a lot other sources.


Any help would be much appreciated !




Sincerely,

Vladimir TOUTAIN 

Mail: vladimir.toutain@xxxxxxxxxxxxxxxxxxxxxxxxx 

Promotion 2016 département IR 
Grenoble INP - Esisar
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux