Re: [spi-devel-general] Accelerometer, Gyros and ADC's etc within the kernel.
- From: Jonathan Cameron <Jonathan.Cameron@xxxxxxxxx>
- Date: Thu, 29 May 2008 12:57:19 +0100
Indeed. This would have to handled using interrupts based on the
Ok, say the HW SPI is pushed down to some lower level driver. These
things send streaming data, and sometimes signals (free-fall detect) out
of band WRT the SPI comms.
generic gpio interface. (see the LIS3L02DQ driver on the SPI-devel
mailing list for an example of how this might work.)
I would like to see how a higher level API could encapsulate theSure. I'll get something put together and sent out asap. The general
generalization of a class of such devices.
Also, I'm not sure how one could generalize SPI communications at a high
level given its bi-directional nature.
I guess I need to see some header files showing what you are thinking
about.
form of this is going to look like a combination of the hwmon
interface via sysfs and something similar to the input subsystems
approach of using events sent over character devices. The interesting
bit is going to be working out how to provide fairly generic interface
to ring buffers, whether these reside in the kernel or on the device
itself.
This is of course true, but there still seem to be some advantages in
Keep in mind that one abstraction of these devices is they are simply
streaming A2D 16 bit data values over SPI (or I2C). The size of the
data set is a function of the sensor axes.
providing some common interfaces for these devices. Almost all
digital interfaced accelerometers share a number of common elements
not typically found in ADC's. These include bias and gain as well as
commonly found alarm signals.
Actually, on this point, it may well make sense to provide an
accelerometer driver that is designed to run on top of any generic ADC
driver, thus providing (based on a suitable board specific
configuration) userspace access to analog accelerometers connected in
this fashion. This is definitely one for some way down the line!
Also, If you are playing with accelerometer data, you likely need someDefinitely. Obviously the accuracy of this time stamp is going to be
real time support or at lest a reliable time stamping of the data to do
anything interesting.
limited by
the variable nature of when an interrupt handler picks it up, but knowledge
of the device specs can allow filtering of this timing data. This is
certainly something we would want to consider at a later date although it
may well be more sensible to leave this to userspace applications.
Another problem area is around SPI itself. There are variations ofIndeed. This is well handled by the SPI subsystem. I've spent far too much
device implementations around chip select polarity, clock biasing
(rising,falling, or midpoint) sampling from one SPI part to the next.
time with a scope recently fiddling with these parameters for badly
documented chips!
Agreed. With this sort of device two modes would be needed (and areVTI SCA3000 E05 3D accelerometer equiped with substantial ring buffer.ring buffered data can make RT applications harder...
SPI
device. Can operate either in buffered or direct mode. In buffered
mode, interrupts
can be used to indicate when the ring buffer is 3/4 full triggering a
download to
a larger ring buffer in the kernel if necessary.
(http://www.vti.fi/en/products-solutions/products/accelerometers/sca3000-accelerometers/)
supported by the hardware). The first gives direct data access and the
second uses the ring buffer. Which you use would obviously be dependent on
the application. Some applications want the most recent data on all
occasions, whilst some will be more interested in ensuring that all data is
captured.
The question here is concerned with standardising mainly the userspaceWould be nice if practical to allow the framework to include RS232I'm not sure what you are asking for, you started off with SPI driver
devices such
as those from www.xsens.com, www.isense.com and others.
for interfacing a handful of accelerometer devices. Now your talking
about the serial port.
interfaces (and hardware interfaces only when appropriate). Some of these
devices (the ST accel above for example) support multiple hardware
interfaces specs (I2C and SPI for that one). So in a similar way to it
making sense to group all TV adapters irrespective of how they are
interfaced to the computer, in order to ensure a consistent interface to
user space, it makes sense to share these interfaces amongst drivers
talking to these devices irrespective of what their hardware interface is.
I guess I need to see some header files to see where you are going with
this idea. To be useful you'll also need to handle rotation sensors and
communicate the temperature bias's up the stack too.
Definitely, although to get a reasonable number of devices integrated
quickly they may not all support access to everything we would like
initially.
Will do,
good luck keep me posted on where your going with this, it is
interesting to me.
--
Jonathan Cameron
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- References:
- Accelerometer, Gyros and ADC's etc within the kernel.
- From: Jonathan Cameron
- Re: Accelerometer, Gyros and ADC's etc within the kernel.
- From: mark gross
- Re: [spi-devel-general] Accelerometer, Gyros and ADC's etc within the kernel.
- From: Jonathan Cameron
- Re: [spi-devel-general] Accelerometer, Gyros and ADC's etc within the kernel.
- From: mark gross
- Accelerometer, Gyros and ADC's etc within the kernel.
- Prev by Date: Re: [PATCH] mmtimer: Push BKL down into the ioctl handler
- Next by Date: Re: Performance Characteristics of All Linux RAIDs (mdadm/bonnie++)
- Previous by thread: Re: [spi-devel-general] Accelerometer, Gyros and ADC's etc within the kernel.
- Next by thread: Re: Accelerometer, Gyros and ADC's etc within the kernel.
- Index(es):
Relevant Pages
|