]> sigrok.org Git - libsigrok.git/blobdiff - hardware/rigol-ds1xx2/protocol.h
serial-dmm: Use sr_dev_inst to store connection handle.
[libsigrok.git] / hardware / rigol-ds1xx2 / protocol.h
index d9afa3c09f4f6fa5442634cdba41ed48f6a19dfd..34d9e8adf42d57fa6599ce8686e03b4babc613c7 100644 (file)
 #define sr_warn(s, args...) sr_warn(DRIVER_LOG_DOMAIN s, ## args)
 #define sr_err(s, args...) sr_err(DRIVER_LOG_DOMAIN s, ## args)
 
-#define WAVEFORM_SIZE 600
+#define ANALOG_WAVEFORM_SIZE 600
+#define DIGITAL_WAVEFORM_SIZE 1210
 
 /** Private, per-device-instance driver context. */
 struct dev_context {
-       /** The current frame limit. */
-       uint64_t limit_frames;
-
-       /** The current sampling limit (in number of samples). */
-       uint64_t limit_samples;
+       /* Device features */
+       gboolean has_digital;
 
-       /** The current sampling limit (in ms). */
-       uint64_t limit_msec;
-
-       /** Opaque pointer passed in by the frontend. */
+       /* Acquisition settings */
+       GSList *enabled_analog_probes;
+       GSList *enabled_digital_probes;
+       uint64_t limit_frames;
        void *cb_data;
 
-       /** The current number of already received frames. */
-       uint64_t num_frames;
-
-       /** The current number of samples received in this frame. */
-       uint64_t num_frame_samples;
-
-       /** Current scale setting. */
-       float scale;
-
-       /** Current offset setting. */
-       float offset;
-
-       /** Path to USBTMC character device file. */
+       /* Device settings */
+       gboolean analog_channels[2];
+       gboolean digital_channels[16];
+       float timebase;
+       float vdiv[2];
+       float vert_offset[2];
+       char *trigger_source;
+       float horiz_triggerpos;
+       char *trigger_slope;
+       char *coupling[2];
+
+       /* Operational state */
        char *device;
-
-       /** USBTMC character device file descriptor. */
        int fd;
-
-       GSList *enabled_probes;
+       uint64_t num_frames;
+       uint64_t num_frame_bytes;
+       struct sr_probe *channel_frame;
 };
 
-SR_PRIV int rigol_ds1xx2_receive_data(int fd, int revents, void *cb_data);
-
-SR_PRIV int rigol_ds1xx2_send_data(int fd, const char *format, ...);
+SR_PRIV int rigol_ds1xx2_receive(int fd, int revents, void *cb_data);
+SR_PRIV int rigol_ds1xx2_send(struct dev_context *devc, const char *format, ...);
+SR_PRIV int rigol_ds1xx2_get_dev_cfg(const struct sr_dev_inst *sdi);
 
 #endif