]> sigrok.org Git - libsigrok.git/blobdiff - include/libsigrok/libsigrok.h
bindings: add u32/SR_T_UINT32 support for config keys
[libsigrok.git] / include / libsigrok / libsigrok.h
index 0b06cb7c7ec71e68a8dd3dd34eea70721651d41f..5300fbe1951e5027a9e587c38b52e1df19590edb 100644 (file)
@@ -80,6 +80,13 @@ enum sr_error_code {
        /* Update sr_strerror()/sr_strerror_name() (error.c) upon changes! */
 };
 
+/** Ternary return type for DMM/LCR/etc packet parser validity checks. */
+enum sr_valid_code {
+       SR_PACKET_INVALID = -1, /**< Certainly invalid. */
+       SR_PACKET_VALID = 0,    /**< Certainly valid. */
+       SR_PACKET_NEED_RX = +1, /**< Need more RX data. */
+};
+
 #define SR_MAX_CHANNELNAME_LEN 32
 
 /* Handy little macros */
@@ -146,6 +153,7 @@ enum sr_datatype {
        SR_T_DOUBLE_RANGE,
        SR_T_INT32,
        SR_T_MQ,
+       SR_T_UINT32,
 
        /* Update sr_variant_type_get() (hwdriver.c) upon changes! */
 };
@@ -294,7 +302,7 @@ enum sr_unit {
        SR_UNIT_VOLT_AMPERE,
        /** Real power [W]. */
        SR_UNIT_WATT,
-       /** Consumption [Wh]. */
+       /** Energy (consumption) in watt hour [Wh]. */
        SR_UNIT_WATT_HOUR,
        /** Wind speed in meters per second. */
        SR_UNIT_METER_SECOND,
@@ -328,6 +336,12 @@ enum sr_unit {
        SR_UNIT_TOLA,
        /** Pieces (number of items). */
        SR_UNIT_PIECE,
+       /** Energy in joule. */
+       SR_UNIT_JOULE,
+       /** Electric charge in coulomb. */
+       SR_UNIT_COULOMB,
+       /** Electric charge in ampere hour [Ah]. */
+       SR_UNIT_AMPERE_HOUR,
 
        /*
         * Update unit_strings[] (analog.c) and fancyprint() (output/analog.c)
@@ -710,6 +724,12 @@ enum sr_configkey {
        /** The device can measure power. */
        SR_CONF_POWERMETER,
 
+       /**
+        * The device can switch between multiple sources, e.g. a relay actuator
+        * or multiplexer.
+        */
+       SR_CONF_MULTIPLEXER,
+
        /* Update sr_key_info_config[] (hwdriver.c) upon changes! */
 
        /*--- Driver scan options -------------------------------------------*/
@@ -765,6 +785,26 @@ enum sr_configkey {
         */
        SR_CONF_FORCE_DETECT,
 
+       /**
+        * Override builtin probe names from user specs.
+        *
+        * Users may want to override the names which are assigned to
+        * probes during scan (these usually match the vendor's labels
+        * on the device). This avoids the interactive tedium of
+        * changing channel names after device creation and before
+        * protocol decoder attachment. Think of IEEE488 recorders or
+        * parallel computer bus loggers. The scan option eliminates
+        * the issue of looking up previously assigned names before
+        * renaming a channel (see sigrok-cli -C), which depends on
+        * the device as well as the application, and is undesirable.
+        * The scan option is limited to those drivers which implement
+        * support for it, but works identically across those drivers.
+        *
+        * The value is a string, either a comma separated list of
+        * probe names, or an alias for a typical set of names.
+        */
+       SR_CONF_PROBE_NAMES,
+
        /* Update sr_key_info_config[] (hwdriver.c) upon changes! */
 
        /*--- Device (or channel group) configuration -----------------------*/
@@ -1035,6 +1075,35 @@ enum sr_configkey {
        /** The number of digits (e.g. for a DMM). */
        SR_CONF_DIGITS,
 
+       /** Phase of a source signal. */
+       SR_CONF_PHASE,
+
+       /** Duty cycle of a source signal. */
+       SR_CONF_DUTY_CYCLE,
+
+       /**
+        * Current power.
+        * @arg type: double
+        * @arg get: get measured power
+        */
+       SR_CONF_POWER,
+
+       /**
+        * Power target.
+        * @arg type: double
+        * @arg get: get power target
+        * @arg set: change power target
+        */
+       SR_CONF_POWER_TARGET,
+
+       /**
+        * Resistance target.
+        * @arg type: double
+        * @arg get: get resistance target
+        * @arg set: change resistance target
+        */
+       SR_CONF_RESISTANCE_TARGET,
+
        /* Update sr_key_info_config[] (hwdriver.c) upon changes! */
 
        /*--- Special stuff -------------------------------------------------*/