From cff7d8d60d1ae12aa38bc97c41506cc9067fe980 Mon Sep 17 00:00:00 2001 From: Bert Vermeulen Date: Sun, 27 Jul 2014 23:59:49 +0200 Subject: [PATCH] Add config key for amplitude. This is intended for setting (or getting) the amplitude of a source which doesn't really have an MQ associated with it, such as the demo driver's analog channels. --- include/libsigrok/libsigrok.h | 3 +++ src/hwdriver.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/include/libsigrok/libsigrok.h b/include/libsigrok/libsigrok.h index 8292483a..03eedc61 100644 --- a/include/libsigrok/libsigrok.h +++ b/include/libsigrok/libsigrok.h @@ -756,6 +756,9 @@ enum sr_configkey { /** Choice of clock edge for external clock ("r" or "f"). */ SR_CONF_CLOCK_EDGE, + /** Amplitude of a source without strictly-defined MQ. */ + SR_CONF_AMPLITUDE, + /*--- Special stuff -------------------------------------------------*/ /** Scan options supported by the driver. */ diff --git a/src/hwdriver.c b/src/hwdriver.c index 04d877ae..914fc337 100644 --- a/src/hwdriver.c +++ b/src/hwdriver.c @@ -124,6 +124,8 @@ static struct sr_config_info sr_config_info_data[] = { "Sample limit", NULL}, {SR_CONF_CLOCK_EDGE, SR_T_STRING, "clock_edge", "Clock edge", NULL}, + {SR_CONF_AMPLITUDE, SR_T_FLOAT, "amplitude", + "Amplitude", NULL}, {0, 0, NULL, NULL, NULL}, };