Hello Sigrok community,

this is to share some work we've done to enable IIO devices with Sigrok. 
In the current state, this is a generic driver 
(src/hardware/generic-iio) that will map the IIO scan_elements into 
sigrok channels.

it can be pulled from: https://github.com/BayLibre/libsigrok.git

There are two branches:

*generic-iio* (default branch) is an attempt to mapping multiple 
iio:devices into multiple sigrok devices.

*generic-iio-channelgrp* is a more conservative approach of using a 
channel group per iio:device.

This draft is functional but may be restricted to the channel types we 
support with our power monitoring device (multiple ina226 basically). 
Applying scales and resulting units seems ok. Sigrok-cli returns values 
consistent with iio_monitor and such.

The channel group version may need more polishing, and the overall code 
may require some optimization (or moderate refactoring), but I'm sharing 
this with you "as is" already.

A typical invocation for testing would be :

$> sigrok-cli --driver generic-iio:conn=$IP_OF_IIOD --samples 3

using the traditional 'conn' option to specify the ip@ of the capture 
device (iiod).


To get the thread going, here are some first discussion and review items 
based on feedback from Lars:

<quote>

- Lars:

looks good, thanks for sharing. I think long-term we probably need some 
device specific code in there to support non-standard attributes and do 
the mapping onto sigrok attributes. Not sure how to handle that yet, 
whether those should be separate sigrok drivers, with the generic driver 
being used

- Marc:

I like the idea of having a library, _and_ maybe keep an optional 
generic driver as an instance of the lib, for the simple use-cases.

</quote>

------------------------------------------------------------------------------
_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to