From: Daniel Anselmi Date: Sat, 12 Oct 2024 21:20:27 +0000 (+0200) Subject: libsigrok.h: Add config keys SR_CONF_GATE_TIME and SR_CONF_FREQUENCY_COUNTER X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=0ca4897d45fb6a19cbcd2d90082dbe171b500779;p=libsigrok.git libsigrok.h: Add config keys SR_CONF_GATE_TIME and SR_CONF_FREQUENCY_COUNTER --- diff --git a/include/libsigrok/libsigrok.h b/include/libsigrok/libsigrok.h index ca0ef91b..d3957edc 100644 --- a/include/libsigrok/libsigrok.h +++ b/include/libsigrok/libsigrok.h @@ -760,6 +760,11 @@ enum sr_configkey { */ SR_CONF_DELAY_GENERATOR, + /** + * The device can act as a frequency counter. + */ + SR_CONF_FREQUENCY_COUNTER, + /* Update sr_key_info_config[] (hwdriver.c) upon changes! */ /*--- Driver scan options -------------------------------------------*/ @@ -1256,6 +1261,12 @@ enum sr_configkey { * @arg get: get measured resistance */ SR_CONF_RESISTANCE, + + /** + * Gate time. + */ + SR_CONF_GATE_TIME, + /* Update sr_key_info_config[] (hwdriver.c) upon changes! */ }; diff --git a/src/hwdriver.c b/src/hwdriver.c index 06505d4c..44355127 100644 --- a/src/hwdriver.c +++ b/src/hwdriver.c @@ -65,6 +65,7 @@ static struct sr_key_info sr_key_info_config[] = { {SR_CONF_POWERMETER, SR_T_STRING, NULL, "Power meter", NULL}, {SR_CONF_MULTIPLEXER, SR_T_STRING, NULL, "Multiplexer", NULL}, {SR_CONF_DELAY_GENERATOR, SR_T_STRING, NULL, "Delay generator", NULL}, + {SR_CONF_FREQUENCY_COUNTER, SR_T_STRING, NULL, "Frequency counter", NULL}, /* Driver scan options */ {SR_CONF_CONN, SR_T_STRING, "conn", @@ -261,6 +262,9 @@ static struct sr_key_info sr_key_info_config[] = { {SR_CONF_RESISTANCE, SR_T_FLOAT, "resistance", "Resistance", NULL}, + + {SR_CONF_GATE_TIME, SR_T_RATIONAL_PERIOD, "gate_time", + "Gate time", NULL}, ALL_ZERO };