]> sigrok.org Git - libsigrok.git/blobdiff - libsigrok-internal.h
sysclk-lwla: Add support for external trigger input.
[libsigrok.git] / libsigrok-internal.h
index e99e5473afdeead7a09160ee9bcd6c4727ce1e08..aa8283f1c070c5eca237e46334692caca589f329 100644 (file)
@@ -174,6 +174,14 @@ SR_PRIV int sr_err(const char *format, ...);
 
 /*--- device.c --------------------------------------------------------------*/
 
+/** Values for the changes argument of sr_dev_driver.config_probe_set. */
+enum {
+       /** The enabled state of the probe has been changed. */
+       SR_PROBE_SET_ENABLED = 1 << 0,
+       /** The trigger setup of the probe has been changed. */
+       SR_PROBE_SET_TRIGGER = 1 << 1,
+};
+
 SR_PRIV struct sr_probe *sr_probe_new(int index, int type,
                gboolean enabled, const char *name);
 
@@ -273,6 +281,7 @@ SR_PRIV int sr_atol(const char *str, long *ret);
 SR_PRIV int sr_atoi(const char *str, int *ret);
 SR_PRIV int sr_atod(const char *str, double *ret);
 SR_PRIV int sr_atof(const char *str, float *ret);
+SR_PRIV int sr_atof_ascii(const char *str, float *ret);
 
 /*--- hardware/common/serial.c ----------------------------------------------*/
 
@@ -364,6 +373,8 @@ enum {
        SCPI_CMD_SET_DIG_POD_STATE,
        SCPI_CMD_GET_ANALOG_DATA,
        SCPI_CMD_GET_DIG_DATA,
+       SCPI_CMD_GET_SAMPLE_RATE,
+       SCPI_CMD_GET_SAMPLE_RATE_LIVE,
 };
 
 struct sr_scpi_hw_info {
@@ -374,6 +385,11 @@ struct sr_scpi_hw_info {
 };
 
 struct sr_scpi_dev_inst {
+       const char *name;
+       const char *prefix;
+       int priv_size;
+       int (*dev_inst_new)(void *priv, const char *resource, char **params,
+               const char *serialcomm);
        int (*open)(void *priv);
        int (*source_add)(void *priv, int events,
                int timeout, sr_receive_data_callback_t cb, void *cb_data);
@@ -387,6 +403,8 @@ struct sr_scpi_dev_inst {
        void *priv;
 };
 
+SR_PRIV struct sr_scpi_dev_inst *scpi_dev_inst_new(const char *resource,
+               const char *serialcomm);
 SR_PRIV int sr_scpi_open(struct sr_scpi_dev_inst *scpi);
 SR_PRIV int sr_scpi_source_add(struct sr_scpi_dev_inst *scpi, int events,
                int timeout, sr_receive_data_callback_t cb, void *cb_data);
@@ -420,27 +438,6 @@ SR_PRIV int sr_scpi_get_hw_id(struct sr_scpi_dev_inst *scpi,
                        struct sr_scpi_hw_info **scpi_response);
 SR_PRIV void sr_scpi_hw_info_free(struct sr_scpi_hw_info *hw_info);
 
-/*--- hardware/common/scpi_vxi.c --------------------------------------------*/
-
-SR_PRIV struct sr_scpi_dev_inst *scpi_vxi_dev_inst_new(const char *address,
-                       const char *instrument);
-
-/*--- hardware/common/scpi_serial.c -----------------------------------------*/
-
-#ifdef HAVE_LIBSERIALPORT
-SR_PRIV struct sr_scpi_dev_inst *scpi_serial_dev_inst_new(const char *port,
-                       const char *serialcomm);
-#endif
-
-/*--- hardware/common/scpi_tcp.c --------------------------------------------*/
-
-SR_PRIV struct sr_scpi_dev_inst *scpi_tcp_dev_inst_new(const char *address,
-                       const char *port);
-
-/*--- hardware/common/scpi_usbtmc.c -----------------------------------------*/
-
-SR_PRIV struct sr_scpi_dev_inst *scpi_usbtmc_dev_inst_new(const char *device);
-
 /*--- hardware/common/dmm/es519xx.c -----------------------------------------*/
 
 /**
@@ -467,6 +464,9 @@ struct es519xx_info {
 SR_PRIV gboolean sr_es519xx_2400_11b_packet_valid(const uint8_t *buf);
 SR_PRIV int sr_es519xx_2400_11b_parse(const uint8_t *buf, float *floatval,
                struct sr_datafeed_analog *analog, void *info);
+SR_PRIV gboolean sr_es519xx_2400_11b_altfn_packet_valid(const uint8_t *buf);
+SR_PRIV int sr_es519xx_2400_11b_altfn_parse(const uint8_t *buf,
+               float *floatval, struct sr_datafeed_analog *analog, void *info);
 SR_PRIV gboolean sr_es519xx_19200_11b_5digits_packet_valid(const uint8_t *buf);
 SR_PRIV int sr_es519xx_19200_11b_5digits_parse(const uint8_t *buf,
                float *floatval, struct sr_datafeed_analog *analog, void *info);