]> git.zerfleddert.de Git - rigol/blob - scope.h
86ce9df009d67399d1f53fa179b43d9496e7d687
[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 /* TODO */
30 };
31
32 struct scope {
33 struct {
34 struct usb_dev_handle *dev;
35 int ep_bulk_out;
36 int ep_bulk_in;
37 unsigned int wMaxPacketSize_in;
38 unsigned char bTag;
39 int brokenRigol;
40 struct usbtmc_capabilities *cap;
41 } usb;
42 struct {
43 struct {
44 char lang[32];
45 int counter_enabled;
46 int beep_enabled;
47 } system;
48
49 struct {
50 int key_lock;
51 } keyboard;
52
53 struct {
54 struct measure_s ch1;
55 struct measure_s ch2;
56
57 int total;
58 char source[32];
59 } measure;
60
61 struct {
62 char type[32];
63 char mode[32];
64 int averages;
65 double srate_ch1;
66 double srate_ch2;
67 double srate_digital;
68 } acquire;
69
70 struct {
71 char type[32];
72 char grid[32];
73 int persist;
74 char mnudisplay[32];
75 int mnustatus;
76 char screen[32];
77 int brightness;
78 int intensity;
79 } display;
80
81 struct {
82 struct channel_s ch1;
83 struct channel_s ch2;
84 } channel;
85
86 struct {
87 char mode[32];
88 double offset;
89 double delayed_offset;
90 double scale;
91 char format[32];
92 } timebase;
93
94 struct {
95 /* TODO */
96 } trigger;
97
98 struct {
99 /* TODO */
100 } la;
101
102 struct {
103 /* TODO */
104 } math;
105 } status;
106 char idn[128];
107 };
108
109 int sendscpi(struct scope* sc, char* cmd, unsigned char *resp, int resplen);
110 struct scope* initscope(void);
111 void closescope(struct scope* sc);
112 void claimscope(struct scope* sc);
113 void releasescope(struct scope* sc);
114 void resetscope(struct scope* sc);
115 char *scope_idn(struct scope *sc);
116 char *scope_get_string(struct scope *sc, char *cmd, int maxlen);
117 int scope_get_truth_value(struct scope *sc, char *cmd);
118 int scope_get_int(struct scope *sc, char *cmd);
119 double scope_get_double(struct scope *sc, char*cmd);
120 void update_scope_measurements(struct scope *sc);
121 int update_scope_status(struct scope *sc);
Impressum, Datenschutz