#include <stdint.h>
#include <stdbool.h>
-#include "libsigrok.h"
+#include <libsigrok/libsigrok.h>
#include "libsigrok-internal.h"
#define LOG_PREFIX "rigol-ds"
/* Size of acquisition buffers */
-#define ACQ_BUFFER_SIZE 32768
+#define ACQ_BUFFER_SIZE (32 * 1024)
/* Maximum number of samples to retrieve at once. */
-#define ACQ_BLOCK_SIZE 30000
+#define ACQ_BLOCK_SIZE (30 * 1000)
#define MAX_ANALOG_CHANNELS 4
#define MAX_DIGITAL_CHANNELS 16
int buffer_samples;
};
+enum cmds {
+ CMD_GET_HORIZ_TRIGGERPOS,
+ CMD_SET_HORIZ_TRIGGERPOS,
+};
+
+struct rigol_ds_command {
+ int cmd;
+ const char *str;
+};
+
struct rigol_ds_model {
const struct rigol_ds_series *series;
const char *name;
uint64_t min_timebase[2];
unsigned int analog_channels;
bool has_digital;
+ const char **trigger_sources;
+ unsigned int num_trigger_sources;
+ const struct rigol_ds_command *cmds;
};
enum wait_events {
WAIT_STOP, /* Wait for scope stopping (only single shots) */
};
-/** Private, per-device-instance driver context. */
struct dev_context {
- /* Device model */
const struct rigol_ds_model *model;
enum data_format format;
/* Acquisition settings */
GSList *enabled_channels;
uint64_t limit_frames;
- void *cb_data;
enum data_source data_source;
uint64_t analog_frame_size;
uint64_t digital_frame_size;
gboolean digital_channels[MAX_DIGITAL_CHANNELS];
gboolean la_enabled;
float timebase;
+ float attenuation[MAX_ANALOG_CHANNELS];
float vdiv[MAX_ANALOG_CHANNELS];
int vert_reference[MAX_ANALOG_CHANNELS];
+ float vert_origin[MAX_ANALOG_CHANNELS];
float vert_offset[MAX_ANALOG_CHANNELS];
+ float vert_inc[MAX_ANALOG_CHANNELS];
char *trigger_source;
float horiz_triggerpos;
char *trigger_slope;
+ float trigger_level;
char *coupling[MAX_ANALOG_CHANNELS];
- /* Operational state */
-
/* Number of frames received in total. */
uint64_t num_frames;
/* GSList entry for the current channel. */
SR_PRIV int rigol_ds_channel_start(const struct sr_dev_inst *sdi);
SR_PRIV int rigol_ds_receive(int fd, int revents, void *cb_data);
SR_PRIV int rigol_ds_get_dev_cfg(const struct sr_dev_inst *sdi);
+SR_PRIV int rigol_ds_get_dev_cfg_vertical(const struct sr_dev_inst *sdi);
#endif