From: Alexandru Gagniuc Date: Sat, 5 Mar 2016 07:25:15 +0000 (-0800) Subject: hwdriver: Add configuration key for number of powerline cycles X-Git-Tag: libsigrok-0.5.0~533 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=fadb19ac9631b61c97b7ca6375a3afe134bbc695;p=libsigrok.git hwdriver: Add configuration key for number of powerline cycles High precision multimeters have a special setting, called "number of powerline cycles" (NPLC) which determines the integration time of the ADC in terms of the power line period. Some devices need their NPLC adjusted from the default value before they can measure at their full rated precision. --- diff --git a/include/libsigrok/libsigrok.h b/include/libsigrok/libsigrok.h index 3daf616d..31ee5dce 100644 --- a/include/libsigrok/libsigrok.h +++ b/include/libsigrok/libsigrok.h @@ -1015,6 +1015,9 @@ enum sr_configkey { /** The device supports setting a probe factor. */ SR_CONF_PROBE_FACTOR, + /** Number of powerline cycles for ADC integration time. */ + SR_CONF_ADC_POWERLINE_CYCLES, + /* Update sr_key_info_config[] (hwdriver.c) upon changes! */ /*--- Acquisition modes, sample limiting ----------------------------*/ diff --git a/src/hwdriver.c b/src/hwdriver.c index 81a86a79..b31242ad 100644 --- a/src/hwdriver.c +++ b/src/hwdriver.c @@ -189,6 +189,8 @@ static struct sr_key_info sr_key_info_config[] = { "Data source", NULL}, {SR_CONF_PROBE_FACTOR, SR_T_UINT64, "probe_factor", "Probe factor", NULL}, + {SR_CONF_ADC_POWERLINE_CYCLES, SR_T_FLOAT, "nplc", + "Number of ADC powerline cycles", NULL}, /* Acquisition modes, sample limiting */ {SR_CONF_LIMIT_MSEC, SR_T_UINT64, "limit_time",