a74809b3985af1d4d4c9a532ccd85dc8c83a05a2
[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 usb_dev_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 /* TODO */
105 } trigger;
106
107 struct {
108 /* TODO */
109 } la;
110
111 struct {
112 int displayed;
113 } math;
114
115 struct {
116 int displayed;
117 } fft;
118 } status;
119
120 char idn[128];
121 };
122
123 int sendscpi(struct scope* sc, char* cmd, unsigned char *resp, int resplen);
124 struct scope* initscope(void);
125 void closescope(struct scope* sc);
126 void claimscope(struct scope* sc);
127 void releasescope(struct scope* sc);
128 void resetscope(struct scope* sc);
129 char *scope_idn(struct scope *sc);
130 char *scope_get_string(struct scope *sc, char *cmd, int maxlen);
131 int scope_get_truth_value(struct scope *sc, char *cmd);
132 int scope_get_int(struct scope *sc, char *cmd);
133 double scope_get_double(struct scope *sc, char*cmd);
134 void update_scope_measurements(struct scope *sc);
135 int update_scope_status(struct scope *sc);
136 char *scope_get_data(struct scope *sc, char *source, int *len);
Impressum, Datenschutz