]> sigrok.org Git - libsigrok.git/commitdiff
libsigrok.h: Add SR_CONF_OVER_POWER_PROTECTION_* and SR_CONF_RESISTANCE
authorTimo Boettcher <redacted>
Fri, 27 Sep 2024 22:19:33 +0000 (00:19 +0200)
committerSoeren Apel <redacted>
Mon, 7 Oct 2024 20:21:04 +0000 (22:21 +0200)
These are used for electronic loads like the Siglent SDL10x0.

include/libsigrok/libsigrok.h
src/hwdriver.c

index 58251b3c8088d7035950d70bd8c3c4340a30946c..ca0ef91b7624f6e57621234b8b691327ca21cfa5 100644 (file)
@@ -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! */
 };
 
index 7687c5f4b5fd1d2b0ab5a0c7f87141977b3ecbc3..06505d4c692259de89cc527817c97b6439c32222 100644 (file)
@@ -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
 };