On Mon, Feb 09, 2015 at 06:31:13PM +0100, Bartosz Golaszewski wrote:
> Add new configuration option allowing to modify shunt resistance
> values for power-monitors.
> 
> Signed-off-by: Bartosz Golaszewski <bgolaszew...@baylibre.com>
> ---
>  include/libsigrok/libsigrok.h | 9 +++++++++
>  src/hwdriver.c                | 2 ++
>  2 files changed, 11 insertions(+)
> 
> diff --git a/include/libsigrok/libsigrok.h b/include/libsigrok/libsigrok.h
> index 65e9da8..ced0346 100644
> --- a/include/libsigrok/libsigrok.h
> +++ b/include/libsigrok/libsigrok.h
> @@ -903,6 +903,15 @@ enum sr_configkey {
>        */
>       SR_CONF_DATA_SOURCE,
>  
> +     /**
> +      * The device is a power-monitor supporting setting
> +      * shunt resistance values.
> +      *
> +      * It's a key-value option, where key is the name/number of the probe
> +      * and value is the desired shunt resistance.
> +      */
> +     SR_CONF_SHUNT_RESISTANCE,

This conf name seems highly specific, but I think it could be generalized.

IIUC, your device will read a voltage, and this config will indicate
the (inverse of the) factor to apply to convert it to a current.

This is very similar to oscilloscope probe configuration (1x, 10x...).
And some oscilloscopes allow to set random probe factor and unit, so
that you can plug a current clamp and have direct current reading
in Amps.

So I think it would be better to have a more generic conf name that
could be used with many kind of hardware.
Maybe something like SR_CONF_PROBE_FACTOR ?

Aurel

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to