From: Bartosz Golaszewski Date: Thu, 22 Jan 2015 09:22:58 +0000 (+0100) Subject: new config options: averaging X-Git-Tag: libsigrok-0.4.0~674 X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=commitdiff_plain;h=9ed444e6226c5d36b637708864361429f77f07a8 new config options: averaging Add new config options to libsigrok - 'averaging', which allows to enable averaging of samples and 'avg_samples' for setting the number of samples to be averaged over in each cycle. Signed-off-by: Bartosz Golaszewski --- diff --git a/include/libsigrok/libsigrok.h b/include/libsigrok/libsigrok.h index df1333a9..65e9da80 100644 --- a/include/libsigrok/libsigrok.h +++ b/include/libsigrok/libsigrok.h @@ -665,6 +665,15 @@ enum sr_configkey { /** The device supports setting trigger slope. */ SR_CONF_TRIGGER_SLOPE, + /** The device supports averaging. */ + SR_CONF_AVERAGING, + + /** + * The device supports setting number of samples to be + * averaged over. + */ + SR_CONF_AVG_SAMPLES, + /** Trigger source. */ SR_CONF_TRIGGER_SOURCE, diff --git a/src/hwdriver.c b/src/hwdriver.c index 95d8163f..239592d3 100644 --- a/src/hwdriver.c +++ b/src/hwdriver.c @@ -79,6 +79,10 @@ static struct sr_config_info sr_config_info_data[] = { "Run length encoding", NULL}, {SR_CONF_TRIGGER_SLOPE, SR_T_STRING, "triggerslope", "Trigger slope", NULL}, + {SR_CONF_AVERAGING, SR_T_BOOL, "averaging", + "Averaging", NULL}, + {SR_CONF_AVG_SAMPLES, SR_T_UINT64, "avg_samples", + "Number of samples to average over", NULL}, {SR_CONF_TRIGGER_SOURCE, SR_T_STRING, "triggersource", "Trigger source", NULL}, {SR_CONF_HORIZ_TRIGGERPOS, SR_T_FLOAT, "horiz_triggerpos",