]>
Commit | Line | Data |
---|---|---|
adb5a679 MG |
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 | ||
713be7a4 | 32 | struct scope { |
7906b395 MG |
33 | struct { |
34 | struct usb_dev_handle *dev; | |
fc648ed8 | 35 | int ep_bulk_out; |
fc648ed8 MG |
36 | int ep_bulk_in; |
37 | unsigned int wMaxPacketSize_in; | |
7b575069 MG |
38 | unsigned char bTag; |
39 | int brokenRigol; | |
90e416c4 | 40 | struct usbtmc_capabilities *cap; |
7906b395 | 41 | } usb; |
78fb0984 MG |
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 { | |
adb5a679 MG |
54 | struct measure_s ch1; |
55 | struct measure_s ch2; | |
56 | ||
57 | int total; | |
58 | char source[32]; | |
78fb0984 MG |
59 | } measure; |
60 | ||
61 | struct { | |
62 | char type[32]; | |
63 | char mode[32]; | |
64 | int averages; | |
adb5a679 MG |
65 | double srate_ch1; |
66 | double srate_ch2; | |
78fb0984 MG |
67 | double srate_digital; |
68 | } acquire; | |
69 | ||
70 | struct { | |
adb5a679 MG |
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; | |
78fb0984 MG |
79 | } display; |
80 | ||
81 | struct { | |
adb5a679 MG |
82 | struct channel_s ch1; |
83 | struct channel_s ch2; | |
78fb0984 MG |
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; | |
713be7a4 MG |
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); | |
10ca7ea8 | 114 | void resetscope(struct scope* sc); |
713be7a4 | 115 | char *scope_idn(struct scope *sc); |
78fb0984 MG |
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); | |
adb5a679 | 120 | void update_scope_measurements(struct scope *sc); |
78fb0984 | 121 | int update_scope_status(struct scope *sc); |