]> sigrok.org Git - libsigrok.git/blobdiff - src/libsigrok-internal.h
Input: Add reset() function
[libsigrok.git] / src / libsigrok-internal.h
index 0af77db6c33e4dc41cd898b996631a058395a72c..589d0a4d00eb1e3b1533e4ae4c1c2ab5d435dbfd 100644 (file)
@@ -401,6 +401,18 @@ struct sr_input_module {
         */
        int (*end) (struct sr_input *in);
 
+        /**
+         * Reset the input module's input handling structures.
+         *
+         * Causes the input module to reset its internal state so that we can
+         * re-send the input data from the beginning without having to
+         * re-create the entire input module.
+         *
+         * @retval SR_OK Success.
+         * @retval other Negative error code.
+         */
+       int (*reset) (struct sr_input *in);
+
        /**
         * This function is called after the caller is finished using
         * the input module, and can be used to free any internal
@@ -1258,4 +1270,23 @@ SR_PRIV gboolean sr_kern_packet_valid(const uint8_t *buf);
 SR_PRIV int sr_kern_parse(const uint8_t *buf, float *floatval,
                struct sr_datafeed_analog_old *analog, void *info);
 
+/*--- sw_limits.c -----------------------------------------------------------*/
+
+struct sr_sw_limits {
+       uint64_t limit_samples;
+       uint64_t limit_msec;
+       uint64_t samples_read;
+       uint64_t start_time;
+};
+
+SR_PRIV int sr_sw_limits_config_get(struct sr_sw_limits *limits, uint32_t key,
+       GVariant **data);
+SR_PRIV int sr_sw_limits_config_set(struct sr_sw_limits *limits, uint32_t key,
+       GVariant *data);
+SR_PRIV void sr_sw_limits_acquisition_start(struct sr_sw_limits *limits);
+SR_PRIV gboolean sr_sw_limits_check(struct sr_sw_limits *limits);
+SR_PRIV void sr_sw_limits_update_samples_read(struct sr_sw_limits *limits,
+       uint64_t samples_read);
+SR_PRIV void sr_sw_limits_init(struct sr_sw_limits *limits);
+
 #endif