update to libusb-1.0
[rigol] / scope.h
CommitLineData
adb5a679
MG
1struct measure_s {
2 double vpp;
3 double vmax;
4 double vmin;
5 double vamplitude;
6 double vtop;
7 double vbase;
8 double vaverage;
9 double vrms;
10
11 double overshoot;
12 double preshoot;
13
14 double frequency;
15 double risetime;
16 double falltime;
17
18 double period;
19 double pwidth;
20 double nwidth;
21 double pdutycycle;
22 double ndutycycle;
23
24 double pdelay;
25 double ndelay;
26};
27
28struct channel_s {
15747296
MG
29 int bwlimit_enabled;
30 char coupling[32];
31 int displayed;
32 int inverted;
33 double offset;
34 double probe;
35 double scale;
36 int filter_enabled;
37 int memory_depth;
38 char vernier[32];
adb5a679
MG
39};
40
713be7a4 41struct scope {
7906b395 42 struct {
f416d675 43 struct libusb_device_handle *dev;
fc648ed8 44 int ep_bulk_out;
fc648ed8
MG
45 int ep_bulk_in;
46 unsigned int wMaxPacketSize_in;
7b575069
MG
47 unsigned char bTag;
48 int brokenRigol;
90e416c4 49 struct usbtmc_capabilities *cap;
7906b395 50 } usb;
78fb0984
MG
51 struct {
52 struct {
53 char lang[32];
54 int counter_enabled;
55 int beep_enabled;
56 } system;
57
58 struct {
59 int key_lock;
60 } keyboard;
61
62 struct {
adb5a679
MG
63 struct measure_s ch1;
64 struct measure_s ch2;
65
66 int total;
67 char source[32];
78fb0984
MG
68 } measure;
69
70 struct {
71 char type[32];
72 char mode[32];
73 int averages;
adb5a679
MG
74 double srate_ch1;
75 double srate_ch2;
78fb0984
MG
76 double srate_digital;
77 } acquire;
78
79 struct {
adb5a679
MG
80 char type[32];
81 char grid[32];
82 int persist;
83 char mnudisplay[32];
84 int mnustatus;
85 char screen[32];
86 int brightness;
87 int intensity;
78fb0984
MG
88 } display;
89
90 struct {
adb5a679
MG
91 struct channel_s ch1;
92 struct channel_s ch2;
78fb0984
MG
93 } channel;
94
95 struct {
96 char mode[32];
97 double offset;
98 double delayed_offset;
99 double scale;
100 char format[32];
101 } timebase;
102
103 struct {
f416d675
MG
104 char mode[32];
105
78fb0984
MG
106 /* TODO */
107 } trigger;
108
109 struct {
110 /* TODO */
111 } la;
112
113 struct {
811f1259 114 int displayed;
78fb0984 115 } math;
811f1259
MG
116
117 struct {
118 int displayed;
119 } fft;
78fb0984 120 } status;
811f1259 121
713be7a4
MG
122 char idn[128];
123};
124
125int sendscpi(struct scope* sc, char* cmd, unsigned char *resp, int resplen);
126struct scope* initscope(void);
127void closescope(struct scope* sc);
128void claimscope(struct scope* sc);
129void releasescope(struct scope* sc);
10ca7ea8 130void resetscope(struct scope* sc);
713be7a4 131char *scope_idn(struct scope *sc);
78fb0984
MG
132char *scope_get_string(struct scope *sc, char *cmd, int maxlen);
133int scope_get_truth_value(struct scope *sc, char *cmd);
134int scope_get_int(struct scope *sc, char *cmd);
135double scope_get_double(struct scope *sc, char*cmd);
adb5a679 136void update_scope_measurements(struct scope *sc);
78fb0984 137int update_scope_status(struct scope *sc);
8e60ee60 138char *scope_get_data(struct scope *sc, char *source, int *len);
Impressum, Datenschutz