From: Timo Boettcher Date: Fri, 27 Sep 2024 22:19:33 +0000 (+0200) Subject: libsigrok.h: Add SR_CONF_OVER_POWER_PROTECTION_* and SR_CONF_RESISTANCE X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=a86e0d57f479da9aa280e727757fad21ac321c08;p=libsigrok.git libsigrok.h: Add SR_CONF_OVER_POWER_PROTECTION_* and SR_CONF_RESISTANCE These are used for electronic loads like the Siglent SDL10x0. --- diff --git a/include/libsigrok/libsigrok.h b/include/libsigrok/libsigrok.h index 58251b3c..ca0ef91b 100644 --- a/include/libsigrok/libsigrok.h +++ b/include/libsigrok/libsigrok.h @@ -1226,6 +1226,36 @@ enum sr_configkey { /** Self test mode. */ SR_CONF_TEST_MODE, + /** + * Over-power protection (OPP) feature + * @arg type: boolean + * @arg get: @b true if currently enabled + * @arg set: enable/disable + */ + SR_CONF_OVER_POWER_PROTECTION_ENABLED, + + /** + * Over-power protection (OPP) active + * @arg type: boolean + * @arg get: @b true if device has activated OPP, i.e. the current power + * exceeds the over-power protection threshold. + */ + SR_CONF_OVER_POWER_PROTECTION_ACTIVE, + + /** + * Over-power protection (OPP) threshold + * @arg type: double (current) + * @arg get: get current threshold + * @arg set: set new threshold + */ + SR_CONF_OVER_POWER_PROTECTION_THRESHOLD, + + /** + * Current Resistance. + * @arg type: double + * @arg get: get measured resistance + */ + SR_CONF_RESISTANCE, /* Update sr_key_info_config[] (hwdriver.c) upon changes! */ }; diff --git a/src/hwdriver.c b/src/hwdriver.c index 7687c5f4..06505d4c 100644 --- a/src/hwdriver.c +++ b/src/hwdriver.c @@ -252,6 +252,15 @@ static struct sr_key_info sr_key_info_config[] = { {SR_CONF_TEST_MODE, SR_T_STRING, "test_mode", "Test mode", NULL}, + {SR_CONF_OVER_POWER_PROTECTION_ENABLED, SR_T_BOOL, "opp_enabled", + "Over-power protection enabled", NULL}, + {SR_CONF_OVER_POWER_PROTECTION_ACTIVE, SR_T_BOOL, "opp_active", + "Over-power protection active", NULL}, + {SR_CONF_OVER_POWER_PROTECTION_THRESHOLD, SR_T_FLOAT, "opp_threshold", + "Over-power protection threshold", NULL}, + + {SR_CONF_RESISTANCE, SR_T_FLOAT, "resistance", + "Resistance", NULL}, ALL_ZERO };