update to libusb-1.0
[rigol] / scope.h
1 struct 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
28 struct channel_s {
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];
39 };
40
41 struct scope {
42 struct {
43 struct libusb_device_handle *dev;
44 int ep_bulk_out;
45 int ep_bulk_in;
46 unsigned int wMaxPacketSize_in;
47 unsigned char bTag;
48 int brokenRigol;
49 struct usbtmc_capabilities *cap;
50 } usb;
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 {
63 struct measure_s ch1;
64 struct measure_s ch2;
65
66 int total;
67 char source[32];
68 } measure;
69
70 struct {
71 char type[32];
72 char mode[32];
73 int averages;
74 double srate_ch1;
75 double srate_ch2;
76 double srate_digital;
77 } acquire;
78
79 struct {
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;
88 } display;
89
90 struct {
91 struct channel_s ch1;
92 struct channel_s ch2;
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 {
104 char mode[32];
105
106 /* TODO */
107 } trigger;
108
109 struct {
110 /* TODO */
111 } la;
112
113 struct {
114 int displayed;
115 } math;
116
117 struct {
118 int displayed;
119 } fft;
120 } status;
121
122 char idn[128];
123 };
124
125 int sendscpi(struct scope* sc, char* cmd, unsigned char *resp, int resplen);
126 struct scope* initscope(void);
127 void closescope(struct scope* sc);
128 void claimscope(struct scope* sc);
129 void releasescope(struct scope* sc);
130 void resetscope(struct scope* sc);
131 char *scope_idn(struct scope *sc);
132 char *scope_get_string(struct scope *sc, char *cmd, int maxlen);
133 int scope_get_truth_value(struct scope *sc, char *cmd);
134 int scope_get_int(struct scope *sc, char *cmd);
135 double scope_get_double(struct scope *sc, char*cmd);
136 void update_scope_measurements(struct scope *sc);
137 int update_scope_status(struct scope *sc);
138 char *scope_get_data(struct scope *sc, char *source, int *len);
Impressum, Datenschutz