]> sigrok.org Git - libsigrok.git/blobdiff - src/libsigrok-internal.h
Input: Add reset() function
[libsigrok.git] / src / libsigrok-internal.h
index 0cf52884a93c6e3082b9f537630e7569c8236b8c..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
@@ -849,16 +861,20 @@ typedef void (*std_dev_clear_callback)(void *priv);
 
 SR_PRIV int std_init(struct sr_context *sr_ctx, struct sr_dev_driver *di,
                const char *prefix);
+SR_PRIV int std_cleanup(const struct sr_dev_driver *di);
 #ifdef HAVE_LIBSERIALPORT
 SR_PRIV int std_serial_dev_open(struct sr_dev_inst *sdi);
 SR_PRIV int std_serial_dev_acquisition_stop(struct sr_dev_inst *sdi,
-               void *cb_data, dev_close_callback dev_close_fn,
+               dev_close_callback dev_close_fn,
                struct sr_serial_dev_inst *serial, const char *prefix);
 #endif
 SR_PRIV int std_session_send_df_header(const struct sr_dev_inst *sdi,
                const char *prefix);
+SR_PRIV int std_session_send_df_end(const struct sr_dev_inst *sdi,
+               const char *prefix);
 SR_PRIV int std_dev_clear(const struct sr_dev_driver *driver,
                std_dev_clear_callback clear_private);
+SR_PRIV GSList *std_dev_list(const struct sr_dev_driver *di);
 SR_PRIV int std_serial_dev_close(struct sr_dev_inst *sdi);
 
 /*--- resource.c ------------------------------------------------------------*/
@@ -1226,10 +1242,8 @@ SR_PRIV int es51919_serial_config_set(uint32_t key, GVariant *data,
 SR_PRIV int es51919_serial_config_list(uint32_t key, GVariant **data,
                                       const struct sr_dev_inst *sdi,
                                       const struct sr_channel_group *cg);
-SR_PRIV int es51919_serial_acquisition_start(const struct sr_dev_inst *sdi,
-                                            void *cb_data);
-SR_PRIV int es51919_serial_acquisition_stop(struct sr_dev_inst *sdi,
-                                           void *cb_data);
+SR_PRIV int es51919_serial_acquisition_start(const struct sr_dev_inst *sdi);
+SR_PRIV int es51919_serial_acquisition_stop(struct sr_dev_inst *sdi);
 
 /*--- hardware/dmm/ut372.c --------------------------------------------------*/
 
@@ -1256,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