Re: getting started w/ iio driver

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

 



On Fri, 3 Nov 2017 04:12:44 +0100
"Enrico Weigelt, metux IT consult" <info@xxxxxxxxx> wrote:

> Hi folks,
> 
> i'm currently developing an iio driver for a custom adc and looking
> for the optimal approach
> The device is made up of 3x 24bit-SD-ADCs and a fpga (as
> buffer+bridge) connected via EIM. All ADCs operate at the same
> (configurable, up to 500khz) sampling rate and each have their own hw
> buffer. For each buffer there's a separate interrupt line.

I assume we are talking a hw fifo? I'm going to guess with a watershed
interrupt...
> 
> So, i'd need an irq handler, which fetches the data into a suitable
> buffer and push it into iio. is that what iio_triggered_buffer_setup()
> etc is for ? How does that relate to triggers ?

Triggers are used when you have a single interrupt for each sample
pass of a given ADC.  (a so called scan - of data captured at the same
time - or often based on an internal shared sequencer).

So typically when you have a flow involving a hardware buffer you skip
the trigger and have the interrupt controller push data directly to the
buffers from the interrupt handler thread.

If you have 3 different interrupts and the ADCs have separate buffers
then you can't guarantee to do reads from all on a single interrupt?
(they can be sampled such that a single end of scan interrupt makes no
sense?)

In that case, as far as IIO is concerned you have 3 separate ADC
systems which will need to each be a separate IIO device.

You will then need some mfd type device underneath to handle the shared
elements (such as the sampling frequency).

We do support direct use of hardware fifo's but it almost always makes
sense to buffer them through a software fifo as well.  

There is also infrastructure to match the fifo watershed with the
software one so that you only read from the hardware when you want
to read it from userspace.

Jonathan

> 
> thx
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux