1pub const PS3000_FIRST_USB: u32 = 1;
2pub const PS3000_LAST_USB: u32 = 127;
3pub const PS3000_MAX_UNITS: u32 = 127;
4pub const PS3206_MAX_TIMEBASE: u32 = 21;
5pub const PS3205_MAX_TIMEBASE: u32 = 20;
6pub const PS3204_MAX_TIMEBASE: u32 = 19;
7pub const PS3224_MAX_TIMEBASE: u32 = 19;
8pub const PS3223_MAX_TIMEBASE: u32 = 19;
9pub const PS3424_MAX_TIMEBASE: u32 = 19;
10pub const PS3423_MAX_TIMEBASE: u32 = 19;
11pub const PS3225_MAX_TIMEBASE: u32 = 18;
12pub const PS3226_MAX_TIMEBASE: u32 = 19;
13pub const PS3425_MAX_TIMEBASE: u32 = 19;
14pub const PS3426_MAX_TIMEBASE: u32 = 19;
15pub const PS3000_MAX_OVERSAMPLE: u32 = 256;
16pub const PS3000_MAX_VALUE: u32 = 32767;
17pub const PS3000_MIN_VALUE: i32 = -32767;
18pub const PS3000_LOST_DATA: i32 = -32768;
19pub const PS3000_MIN_SIGGEN_FREQ: f64 = 0.093;
20pub const PS3000_MAX_SIGGEN_FREQ: u32 = 1000000;
21pub const PS3206_MAX_ETS_CYCLES: u32 = 500;
22pub const PS3206_MAX_ETS_INTERLEAVE: u32 = 100;
23pub const PS3205_MAX_ETS_CYCLES: u32 = 250;
24pub const PS3205_MAX_ETS_INTERLEAVE: u32 = 50;
25pub const PS3204_MAX_ETS_CYCLES: u32 = 125;
26pub const PS3204_MAX_ETS_INTERLEAVE: u32 = 25;
27pub const PS3000_MAX_ETS_CYCLES_INTERLEAVE_RATIO: u32 = 10;
28pub const PS3000_MIN_ETS_CYCLES_INTERLEAVE_RATIO: u32 = 1;
29pub const PS300_MAX_ETS_SAMPLES: u32 = 100000;
30pub const MAX_PULSE_WIDTH_QUALIFIER_COUNT: u32 = 16777215;
31pub const MAX_HOLDOFF_COUNT: u32 = 8388607;
32
33pub const enPS3000Channel_PS3000_CHANNEL_A: enPS3000Channel = 0;
34pub const enPS3000Channel_PS3000_CHANNEL_B: enPS3000Channel = 1;
35pub const enPS3000Channel_PS3000_CHANNEL_C: enPS3000Channel = 2;
36pub const enPS3000Channel_PS3000_CHANNEL_D: enPS3000Channel = 3;
37pub const enPS3000Channel_PS3000_EXTERNAL: enPS3000Channel = 4;
38pub const enPS3000Channel_PS3000_MAX_CHANNELS: enPS3000Channel = 4;
39pub const enPS3000Channel_PS3000_NONE: enPS3000Channel = 5;
40pub const enPS3000Channel_PS3000_MAX_TRIGGER_SOURCES: enPS3000Channel = 6;
41pub type enPS3000Channel = ::std::os::raw::c_uint;
42pub use self::enPS3000Channel as PS3000_CHANNEL;
43pub const enPS3000Range_PS3000_10MV: enPS3000Range = 0;
44pub const enPS3000Range_PS3000_20MV: enPS3000Range = 1;
45pub const enPS3000Range_PS3000_50MV: enPS3000Range = 2;
46pub const enPS3000Range_PS3000_100MV: enPS3000Range = 3;
47pub const enPS3000Range_PS3000_200MV: enPS3000Range = 4;
48pub const enPS3000Range_PS3000_500MV: enPS3000Range = 5;
49pub const enPS3000Range_PS3000_1V: enPS3000Range = 6;
50pub const enPS3000Range_PS3000_2V: enPS3000Range = 7;
51pub const enPS3000Range_PS3000_5V: enPS3000Range = 8;
52pub const enPS3000Range_PS3000_10V: enPS3000Range = 9;
53pub const enPS3000Range_PS3000_20V: enPS3000Range = 10;
54pub const enPS3000Range_PS3000_50V: enPS3000Range = 11;
55pub const enPS3000Range_PS3000_100V: enPS3000Range = 12;
56pub const enPS3000Range_PS3000_200V: enPS3000Range = 13;
57pub const enPS3000Range_PS3000_400V: enPS3000Range = 14;
58pub const enPS3000Range_PS3000_MAX_RANGES: enPS3000Range = 15;
59pub type enPS3000Range = ::std::os::raw::c_uint;
60pub use self::enPS3000Range as PS3000_RANGE;
61pub const enPS3000WaveTypes_PS3000_SQUARE: enPS3000WaveTypes = 0;
62pub const enPS3000WaveTypes_PS3000_TRIANGLE: enPS3000WaveTypes = 1;
63pub const enPS3000WaveTypes_PS3000_SINE: enPS3000WaveTypes = 2;
64pub const enPS3000WaveTypes_PS3000_MAX_WAVE_TYPES: enPS3000WaveTypes = 3;
65pub type enPS3000WaveTypes = ::std::os::raw::c_uint;
66pub use self::enPS3000WaveTypes as PS3000_WAVE_TYPES;
67pub const enPS3000TimeUnits_PS3000_FS: enPS3000TimeUnits = 0;
68pub const enPS3000TimeUnits_PS3000_PS: enPS3000TimeUnits = 1;
69pub const enPS3000TimeUnits_PS3000_NS: enPS3000TimeUnits = 2;
70pub const enPS3000TimeUnits_PS3000_US: enPS3000TimeUnits = 3;
71pub const enPS3000TimeUnits_PS3000_MS: enPS3000TimeUnits = 4;
72pub const enPS3000TimeUnits_PS3000_S: enPS3000TimeUnits = 5;
73pub const enPS3000TimeUnits_PS3000_MAX_TIME_UNITS: enPS3000TimeUnits = 6;
74pub type enPS3000TimeUnits = ::std::os::raw::c_uint;
75pub use self::enPS3000TimeUnits as PS3000_TIME_UNITS;
76pub const enPS3000Error_PS3000_OK: enPS3000Error = 0;
77pub const enPS3000Error_PS3000_MAX_UNITS_OPENED: enPS3000Error = 1;
78pub const enPS3000Error_PS3000_MEM_FAIL: enPS3000Error = 2;
79pub const enPS3000Error_PS3000_NOT_FOUND: enPS3000Error = 3;
80pub const enPS3000Error_PS3000_FW_FAIL: enPS3000Error = 4;
81pub const enPS3000Error_PS3000_NOT_RESPONDING: enPS3000Error = 5;
82pub const enPS3000Error_PS3000_CONFIG_FAIL: enPS3000Error = 6;
83pub const enPS3000Error_PS3000_OS_NOT_SUPPORTED: enPS3000Error = 7;
84pub const enPS3000Error_PS3000_PICOPP_TOO_OLD: enPS3000Error = 8;
85pub type enPS3000Error = ::std::os::raw::c_uint;
86pub use self::enPS3000Error as PS3000_ERROR;
87pub const enPS3000Info_PS3000_DRIVER_VERSION: enPS3000Info = 0;
88pub const enPS3000Info_PS3000_USB_VERSION: enPS3000Info = 1;
89pub const enPS3000Info_PS3000_HARDWARE_VERSION: enPS3000Info = 2;
90pub const enPS3000Info_PS3000_VARIANT_INFO: enPS3000Info = 3;
91pub const enPS3000Info_PS3000_BATCH_AND_SERIAL: enPS3000Info = 4;
92pub const enPS3000Info_PS3000_CAL_DATE: enPS3000Info = 5;
93pub const enPS3000Info_PS3000_ERROR_CODE: enPS3000Info = 6;
94pub const enPS3000Info_PS3000_KERNEL_DRIVER_VERSION: enPS3000Info = 7;
95pub const enPS3000Info_PS3000_DRIVER_PATH: enPS3000Info = 8;
96pub type enPS3000Info = ::std::os::raw::c_uint;
97pub use self::enPS3000Info as PS3000_INFO;
98pub const enPS3000TriggerDirection_PS3000_RISING: enPS3000TriggerDirection = 0;
99pub const enPS3000TriggerDirection_PS3000_FALLING: enPS3000TriggerDirection = 1;
100pub const enPS3000TriggerDirection_PS3000_MAX_DIRS: enPS3000TriggerDirection = 2;
101pub type enPS3000TriggerDirection = ::std::os::raw::c_uint;
102pub use self::enPS3000TriggerDirection as PS3000_TDIR;
103pub const enPS3000OpenProgress_PS3000_OPEN_PROGRESS_FAIL: enPS3000OpenProgress = -1;
104pub const enPS3000OpenProgress_PS3000_OPEN_PROGRESS_PENDING: enPS3000OpenProgress = 0;
105pub const enPS3000OpenProgress_PS3000_OPEN_PROGRESS_COMPLETE: enPS3000OpenProgress = 1;
106pub type enPS3000OpenProgress = ::std::os::raw::c_int;
107pub use self::enPS3000OpenProgress as PS3000_OPEN_PROGRESS;
108pub const enPS3000EtsMode_PS3000_ETS_OFF: enPS3000EtsMode = 0;
109pub const enPS3000EtsMode_PS3000_ETS_FAST: enPS3000EtsMode = 1;
110pub const enPS3000EtsMode_PS3000_ETS_SLOW: enPS3000EtsMode = 2;
111pub const enPS3000EtsMode_PS3000_ETS_MODES_MAX: enPS3000EtsMode = 3;
112pub type enPS3000EtsMode = ::std::os::raw::c_uint;
113pub use self::enPS3000EtsMode as PS3000_ETS_MODE;
114pub type PS3000_CALLBACK_FUNC =
115 ::std::option::Option<unsafe extern "C" fn(dataBuffer: *mut i16, noOfBuffers: i16) -> i16>;
116pub type GetOverviewBuffersMaxMin = ::std::option::Option<
117 extern "C" fn(
118 overviewBuffers: *mut *mut i16,
119 overflow: i16,
120 triggeredAt: u32,
121 triggered: i16,
122 auto_stop: i16,
123 nValues: u32,
124 ),
125>;
126pub const enThresholdDirection_ABOVE: enThresholdDirection = 0;
127pub const enThresholdDirection_BELOW: enThresholdDirection = 1;
128pub const enThresholdDirection_RISING: enThresholdDirection = 2;
129pub const enThresholdDirection_FALLING: enThresholdDirection = 3;
130pub const enThresholdDirection_RISING_OR_FALLING: enThresholdDirection = 4;
131pub const enThresholdDirection_INSIDE: enThresholdDirection = 0;
132pub const enThresholdDirection_OUTSIDE: enThresholdDirection = 1;
133pub const enThresholdDirection_ENTER: enThresholdDirection = 2;
134pub const enThresholdDirection_EXIT: enThresholdDirection = 3;
135pub const enThresholdDirection_ENTER_OR_EXIT: enThresholdDirection = 4;
136pub const enThresholdDirection_NONE: enThresholdDirection = 2;
137pub type enThresholdDirection = ::std::os::raw::c_uint;
138pub use self::enThresholdDirection as THRESHOLD_DIRECTION;
139pub const enThresholdMode_LEVEL: enThresholdMode = 0;
140pub const enThresholdMode_WINDOW: enThresholdMode = 1;
141pub type enThresholdMode = ::std::os::raw::c_uint;
142pub use self::enThresholdMode as THRESHOLD_MODE;
143pub const enTriggerState_CONDITION_DONT_CARE: enTriggerState = 0;
144pub const enTriggerState_CONDITION_TRUE: enTriggerState = 1;
145pub const enTriggerState_CONDITION_FALSE: enTriggerState = 2;
146pub const enTriggerState_CONDITION_MAX: enTriggerState = 3;
147pub type enTriggerState = ::std::os::raw::c_uint;
148pub use self::enTriggerState as TRIGGER_STATE;
149pub const enPulseWidthType_PW_TYPE_NONE: enPulseWidthType = 0;
150pub const enPulseWidthType_PW_TYPE_LESS_THAN: enPulseWidthType = 1;
151pub const enPulseWidthType_PW_TYPE_GREATER_THAN: enPulseWidthType = 2;
152pub const enPulseWidthType_PW_TYPE_IN_RANGE: enPulseWidthType = 3;
153pub const enPulseWidthType_PW_TYPE_OUT_OF_RANGE: enPulseWidthType = 4;
154pub type enPulseWidthType = ::std::os::raw::c_uint;
155pub use self::enPulseWidthType as PULSE_WIDTH_TYPE;
156#[repr(C, packed)]
157#[derive(Debug, Copy, Clone)]
158pub struct tTriggerChannelProperties {
159 pub thresholdMajor: i16,
160 pub thresholdMinor: i16,
161 pub hysteresis: u16,
162 pub channel: i16,
163 pub thresholdMode: THRESHOLD_MODE,
164}
165
166pub type TRIGGER_CHANNEL_PROPERTIES = tTriggerChannelProperties;
167#[repr(C, packed)]
168#[derive(Debug, Copy, Clone)]
169pub struct tTriggerConditions {
170 pub channelA: TRIGGER_STATE,
171 pub channelB: TRIGGER_STATE,
172 pub channelC: TRIGGER_STATE,
173 pub channelD: TRIGGER_STATE,
174 pub external: TRIGGER_STATE,
175 pub pulseWidthQualifier: TRIGGER_STATE,
176}
177
178pub type TRIGGER_CONDITIONS = tTriggerConditions;
179#[repr(C, packed)]
180#[derive(Debug, Copy, Clone)]
181pub struct tPwqConditions {
182 pub channelA: TRIGGER_STATE,
183 pub channelB: TRIGGER_STATE,
184 pub channelC: TRIGGER_STATE,
185 pub channelD: TRIGGER_STATE,
186 pub external: TRIGGER_STATE,
187}
188pub type PWQ_CONDITIONS = tPwqConditions;
189pub type __builtin_va_list = [__va_list_tag; 1usize];
190#[repr(C)]
191#[derive(Debug, Copy, Clone)]
192pub struct __va_list_tag {
193 pub gp_offset: ::std::os::raw::c_uint,
194 pub fp_offset: ::std::os::raw::c_uint,
195 pub overflow_arg_area: *mut ::std::os::raw::c_void,
196 pub reg_save_area: *mut ::std::os::raw::c_void,
197}
198
199extern crate libloading;
200pub struct PS3000Loader {
201 __library: ::libloading::Library,
202 pub ps3000_apply_fix: Result<unsafe extern "C" fn(u32, u16), ::libloading::Error>,
203 pub ps3000_open_unit: Result<unsafe extern "C" fn() -> i16, ::libloading::Error>,
204 pub ps3000_get_unit_info: Result<
205 unsafe extern "C" fn(handle: i16, string: *mut i8, string_length: i16, line: i16) -> i16,
206 ::libloading::Error,
207 >,
208 pub ps3000_flash_led: Result<unsafe extern "C" fn(handle: i16) -> i16, ::libloading::Error>,
209 pub ps3000_close_unit: Result<unsafe extern "C" fn(handle: i16) -> i16, ::libloading::Error>,
210 pub ps3000_set_channel: Result<
211 unsafe extern "C" fn(handle: i16, channel: i16, enabled: i16, dc: i16, range: i16) -> i16,
212 ::libloading::Error,
213 >,
214 pub ps3000_get_timebase: Result<
215 unsafe extern "C" fn(
216 handle: i16,
217 timebase: i16,
218 no_of_samples: i32,
219 time_interval: *mut i32,
220 time_units: *mut i16,
221 oversample: i16,
222 max_samples: *mut i32,
223 ) -> i16,
224 ::libloading::Error,
225 >,
226 pub ps3000_set_siggen: Result<
227 unsafe extern "C" fn(
228 handle: i16,
229 wave_type: i16,
230 start_frequency: i32,
231 stop_frequency: i32,
232 increment: f32,
233 dwell_time: i16,
234 repeat: i16,
235 dual_slope: i16,
236 ) -> i32,
237 ::libloading::Error,
238 >,
239 pub ps3000_set_ets: Result<
240 unsafe extern "C" fn(handle: i16, mode: i16, ets_cycles: i16, ets_interleave: i16) -> i32,
241 ::libloading::Error,
242 >,
243 pub ps3000_set_trigger: Result<
244 unsafe extern "C" fn(
245 handle: i16,
246 source: i16,
247 threshold: i16,
248 direction: i16,
249 delay: i16,
250 auto_trigger_ms: i16,
251 ) -> i16,
252 ::libloading::Error,
253 >,
254 pub ps3000_set_trigger2: Result<
255 unsafe extern "C" fn(
256 handle: i16,
257 source: i16,
258 threshold: i16,
259 direction: i16,
260 delay: f32,
261 auto_trigger_ms: i16,
262 ) -> i16,
263 ::libloading::Error,
264 >,
265 pub ps3000_run_block: Result<
266 unsafe extern "C" fn(
267 handle: i16,
268 no_of_values: i32,
269 timebase: i16,
270 oversample: i16,
271 time_indisposed_ms: *mut i32,
272 ) -> i16,
273 ::libloading::Error,
274 >,
275 pub ps3000_run_streaming_ns: Result<
276 unsafe extern "C" fn(
277 handle: i16,
278 sample_interval: u32,
279 time_units: PS3000_TIME_UNITS,
280 max_samples: u32,
281 auto_stop: i16,
282 noOfSamplesPerAggregate: u32,
283 overview_buffer_size: u32,
284 ) -> i16,
285 ::libloading::Error,
286 >,
287 pub ps3000_run_streaming: Result<
288 unsafe extern "C" fn(
289 handle: i16,
290 sample_interval_ms: i16,
291 max_samples: i32,
292 windowed: i16,
293 ) -> i16,
294 ::libloading::Error,
295 >,
296 pub ps3000_ready: Result<unsafe extern "C" fn(handle: i16) -> i16, ::libloading::Error>,
297 pub ps3000_stop: Result<unsafe extern "C" fn(handle: i16) -> i16, ::libloading::Error>,
298 pub ps3000_get_values: Result<
299 unsafe extern "C" fn(
300 handle: i16,
301 buffer_a: *mut i16,
302 buffer_b: *mut i16,
303 buffer_c: *mut i16,
304 buffer_d: *mut i16,
305 overflow: *mut i16,
306 no_of_values: i32,
307 ) -> i32,
308 ::libloading::Error,
309 >,
310 pub ps3000_release_stream_buffer:
311 Result<unsafe extern "C" fn(handle: i16), ::libloading::Error>,
312 pub ps3000_get_times_and_values: Result<
313 unsafe extern "C" fn(
314 handle: i16,
315 times: *mut i32,
316 buffer_a: *mut i16,
317 buffer_b: *mut i16,
318 buffer_c: *mut i16,
319 buffer_d: *mut i16,
320 overflow: *mut i16,
321 time_units: i16,
322 no_of_values: i32,
323 ) -> i32,
324 ::libloading::Error,
325 >,
326 pub ps3000_open_unit_async: Result<unsafe extern "C" fn() -> i16, ::libloading::Error>,
327 pub ps3000_open_unit_progress: Result<
328 unsafe extern "C" fn(handle: *mut i16, progress_percent: *mut i16) -> i16,
329 ::libloading::Error,
330 >,
331 pub ps3000_streaming_ns_get_interval_stateless: Result<
332 unsafe extern "C" fn(handle: i16, nChannels: i16, sample_interval: *mut u32) -> i16,
333 ::libloading::Error,
334 >,
335 pub ps3000_get_streaming_last_values: Result<
336 unsafe extern "C" fn(
337 handle: i16,
338 lpGetOverviewBuffersMaxMin: GetOverviewBuffersMaxMin,
339 ) -> i16,
340 ::libloading::Error,
341 >,
342 pub ps3000_overview_buffer_status: Result<
343 unsafe extern "C" fn(handle: i16, previous_buffer_overrun: *mut i16) -> i16,
344 ::libloading::Error,
345 >,
346 pub ps3000_get_streaming_values: Result<
347 unsafe extern "C" fn(
348 handle: i16,
349 start_time: *mut f64,
350 pbuffer_a_max: *mut i16,
351 pbuffer_a_min: *mut i16,
352 pbuffer_b_max: *mut i16,
353 pbuffer_b_min: *mut i16,
354 pbuffer_c_max: *mut i16,
355 pbuffer_c_min: *mut i16,
356 pbuffer_d_max: *mut i16,
357 pbuffer_d_min: *mut i16,
358 overflow: *mut i16,
359 triggerAt: *mut u32,
360 triggered: *mut i16,
361 no_of_values: u32,
362 noOfSamplesPerAggregate: u32,
363 ) -> u32,
364 ::libloading::Error,
365 >,
366 pub ps3000_get_streaming_values_no_aggregation: Result<
367 unsafe extern "C" fn(
368 handle: i16,
369 start_time: *mut f64,
370 pbuffer_a: *mut i16,
371 pbuffer_b: *mut i16,
372 pbuffer_c: *mut i16,
373 pbuffer_d: *mut i16,
374 overflow: *mut i16,
375 triggerAt: *mut u32,
376 trigger: *mut i16,
377 no_of_values: u32,
378 ) -> u32,
379 ::libloading::Error,
380 >,
381 pub ps3000_save_streaming_data: Result<
382 unsafe extern "C" fn(
383 handle: i16,
384 lpCallbackFunc: PS3000_CALLBACK_FUNC,
385 dataBuffers: *mut i16,
386 dataBufferSize: i16,
387 ) -> i16,
388 ::libloading::Error,
389 >,
390 pub ps3000SetAdvTriggerChannelProperties: Result<
391 unsafe extern "C" fn(
392 handle: i16,
393 channelProperties: *mut TRIGGER_CHANNEL_PROPERTIES,
394 nChannelProperties: i16,
395 autoTriggerMilliseconds: i32,
396 ) -> i16,
397 ::libloading::Error,
398 >,
399 pub ps3000SetAdvTriggerChannelConditions: Result<
400 unsafe extern "C" fn(
401 handle: i16,
402 conditions: *mut TRIGGER_CONDITIONS,
403 nConditions: i16,
404 ) -> i16,
405 ::libloading::Error,
406 >,
407 pub ps3000SetAdvTriggerChannelDirections: Result<
408 unsafe extern "C" fn(
409 handle: i16,
410 channelA: THRESHOLD_DIRECTION,
411 channelB: THRESHOLD_DIRECTION,
412 channelC: THRESHOLD_DIRECTION,
413 channelD: THRESHOLD_DIRECTION,
414 ext: THRESHOLD_DIRECTION,
415 ) -> i16,
416 ::libloading::Error,
417 >,
418 pub ps3000SetPulseWidthQualifier: Result<
419 unsafe extern "C" fn(
420 handle: i16,
421 conditions: *mut PWQ_CONDITIONS,
422 nConditions: i16,
423 direction: THRESHOLD_DIRECTION,
424 lower: u32,
425 upper: u32,
426 type_: PULSE_WIDTH_TYPE,
427 ) -> i16,
428 ::libloading::Error,
429 >,
430 pub ps3000SetAdvTriggerDelay: Result<
431 unsafe extern "C" fn(handle: i16, delay: u32, preTriggerDelay: f32) -> i16,
432 ::libloading::Error,
433 >,
434 pub ps3000PingUnit: Result<unsafe extern "C" fn(handle: i16) -> i16, ::libloading::Error>,
435}
436impl PS3000Loader {
437 pub unsafe fn new<P>(path: P) -> Result<Self, ::libloading::Error>
438 where
439 P: AsRef<::std::ffi::OsStr>,
440 {
441 let __library = ::libloading::Library::new(path)?;
442 let ps3000_apply_fix = __library.get(b"ps3000_apply_fix\0").map(|sym| *sym);
443 let ps3000_open_unit = __library.get(b"ps3000_open_unit\0").map(|sym| *sym);
444 let ps3000_get_unit_info = __library.get(b"ps3000_get_unit_info\0").map(|sym| *sym);
445 let ps3000_flash_led = __library.get(b"ps3000_flash_led\0").map(|sym| *sym);
446 let ps3000_close_unit = __library.get(b"ps3000_close_unit\0").map(|sym| *sym);
447 let ps3000_set_channel = __library.get(b"ps3000_set_channel\0").map(|sym| *sym);
448 let ps3000_get_timebase = __library.get(b"ps3000_get_timebase\0").map(|sym| *sym);
449 let ps3000_set_siggen = __library.get(b"ps3000_set_siggen\0").map(|sym| *sym);
450 let ps3000_set_ets = __library.get(b"ps3000_set_ets\0").map(|sym| *sym);
451 let ps3000_set_trigger = __library.get(b"ps3000_set_trigger\0").map(|sym| *sym);
452 let ps3000_set_trigger2 = __library.get(b"ps3000_set_trigger2\0").map(|sym| *sym);
453 let ps3000_run_block = __library.get(b"ps3000_run_block\0").map(|sym| *sym);
454 let ps3000_run_streaming_ns = __library.get(b"ps3000_run_streaming_ns\0").map(|sym| *sym);
455 let ps3000_run_streaming = __library.get(b"ps3000_run_streaming\0").map(|sym| *sym);
456 let ps3000_ready = __library.get(b"ps3000_ready\0").map(|sym| *sym);
457 let ps3000_stop = __library.get(b"ps3000_stop\0").map(|sym| *sym);
458 let ps3000_get_values = __library.get(b"ps3000_get_values\0").map(|sym| *sym);
459 let ps3000_release_stream_buffer = __library
460 .get(b"ps3000_release_stream_buffer\0")
461 .map(|sym| *sym);
462 let ps3000_get_times_and_values = __library
463 .get(b"ps3000_get_times_and_values\0")
464 .map(|sym| *sym);
465 let ps3000_open_unit_async = __library.get(b"ps3000_open_unit_async\0").map(|sym| *sym);
466 let ps3000_open_unit_progress = __library
467 .get(b"ps3000_open_unit_progress\0")
468 .map(|sym| *sym);
469 let ps3000_streaming_ns_get_interval_stateless = __library
470 .get(b"ps3000_streaming_ns_get_interval_stateless\0")
471 .map(|sym| *sym);
472 let ps3000_get_streaming_last_values = __library
473 .get(b"ps3000_get_streaming_last_values\0")
474 .map(|sym| *sym);
475 let ps3000_overview_buffer_status = __library
476 .get(b"ps3000_overview_buffer_status\0")
477 .map(|sym| *sym);
478 let ps3000_get_streaming_values = __library
479 .get(b"ps3000_get_streaming_values\0")
480 .map(|sym| *sym);
481 let ps3000_get_streaming_values_no_aggregation = __library
482 .get(b"ps3000_get_streaming_values_no_aggregation\0")
483 .map(|sym| *sym);
484 let ps3000_save_streaming_data = __library
485 .get(b"ps3000_save_streaming_data\0")
486 .map(|sym| *sym);
487 let ps3000SetAdvTriggerChannelProperties = __library
488 .get(b"ps3000SetAdvTriggerChannelProperties\0")
489 .map(|sym| *sym);
490 let ps3000SetAdvTriggerChannelConditions = __library
491 .get(b"ps3000SetAdvTriggerChannelConditions\0")
492 .map(|sym| *sym);
493 let ps3000SetAdvTriggerChannelDirections = __library
494 .get(b"ps3000SetAdvTriggerChannelDirections\0")
495 .map(|sym| *sym);
496 let ps3000SetPulseWidthQualifier = __library
497 .get(b"ps3000SetPulseWidthQualifier\0")
498 .map(|sym| *sym);
499 let ps3000SetAdvTriggerDelay = __library.get(b"ps3000SetAdvTriggerDelay\0").map(|sym| *sym);
500 let ps3000PingUnit = __library.get(b"ps3000PingUnit\0").map(|sym| *sym);
501 Ok(PS3000Loader {
502 __library,
503 ps3000_apply_fix,
504 ps3000_open_unit,
505 ps3000_get_unit_info,
506 ps3000_flash_led,
507 ps3000_close_unit,
508 ps3000_set_channel,
509 ps3000_get_timebase,
510 ps3000_set_siggen,
511 ps3000_set_ets,
512 ps3000_set_trigger,
513 ps3000_set_trigger2,
514 ps3000_run_block,
515 ps3000_run_streaming_ns,
516 ps3000_run_streaming,
517 ps3000_ready,
518 ps3000_stop,
519 ps3000_get_values,
520 ps3000_release_stream_buffer,
521 ps3000_get_times_and_values,
522 ps3000_open_unit_async,
523 ps3000_open_unit_progress,
524 ps3000_streaming_ns_get_interval_stateless,
525 ps3000_get_streaming_last_values,
526 ps3000_overview_buffer_status,
527 ps3000_get_streaming_values,
528 ps3000_get_streaming_values_no_aggregation,
529 ps3000_save_streaming_data,
530 ps3000SetAdvTriggerChannelProperties,
531 ps3000SetAdvTriggerChannelConditions,
532 ps3000SetAdvTriggerChannelDirections,
533 ps3000SetPulseWidthQualifier,
534 ps3000SetAdvTriggerDelay,
535 ps3000PingUnit,
536 })
537 }
538 pub unsafe fn ps3000_apply_fix(&self, a: u32, b: u16) {
539 let sym = self
540 .ps3000_apply_fix
541 .as_ref()
542 .expect("Expected function, got error.");
543 (sym)(a, b)
544 }
545 pub unsafe fn ps3000_open_unit(&self) -> i16 {
546 let sym = self
547 .ps3000_open_unit
548 .as_ref()
549 .expect("Expected function, got error.");
550 (sym)()
551 }
552 pub unsafe fn ps3000_get_unit_info(
553 &self,
554 handle: i16,
555 string: *mut i8,
556 string_length: i16,
557 line: i16,
558 ) -> i16 {
559 let sym = self
560 .ps3000_get_unit_info
561 .as_ref()
562 .expect("Expected function, got error.");
563 (sym)(handle, string, string_length, line)
564 }
565 pub unsafe fn ps3000_flash_led(&self, handle: i16) -> i16 {
566 let sym = self
567 .ps3000_flash_led
568 .as_ref()
569 .expect("Expected function, got error.");
570 (sym)(handle)
571 }
572 pub unsafe fn ps3000_close_unit(&self, handle: i16) -> i16 {
573 let sym = self
574 .ps3000_close_unit
575 .as_ref()
576 .expect("Expected function, got error.");
577 (sym)(handle)
578 }
579 pub unsafe fn ps3000_set_channel(
580 &self,
581 handle: i16,
582 channel: i16,
583 enabled: i16,
584 dc: i16,
585 range: i16,
586 ) -> i16 {
587 let sym = self
588 .ps3000_set_channel
589 .as_ref()
590 .expect("Expected function, got error.");
591 (sym)(handle, channel, enabled, dc, range)
592 }
593 pub unsafe fn ps3000_get_timebase(
594 &self,
595 handle: i16,
596 timebase: i16,
597 no_of_samples: i32,
598 time_interval: *mut i32,
599 time_units: *mut i16,
600 oversample: i16,
601 max_samples: *mut i32,
602 ) -> i16 {
603 let sym = self
604 .ps3000_get_timebase
605 .as_ref()
606 .expect("Expected function, got error.");
607 (sym)(
608 handle,
609 timebase,
610 no_of_samples,
611 time_interval,
612 time_units,
613 oversample,
614 max_samples,
615 )
616 }
617 pub unsafe fn ps3000_set_siggen(
618 &self,
619 handle: i16,
620 wave_type: i16,
621 start_frequency: i32,
622 stop_frequency: i32,
623 increment: f32,
624 dwell_time: i16,
625 repeat: i16,
626 dual_slope: i16,
627 ) -> i32 {
628 let sym = self
629 .ps3000_set_siggen
630 .as_ref()
631 .expect("Expected function, got error.");
632 (sym)(
633 handle,
634 wave_type,
635 start_frequency,
636 stop_frequency,
637 increment,
638 dwell_time,
639 repeat,
640 dual_slope,
641 )
642 }
643 pub unsafe fn ps3000_set_ets(
644 &self,
645 handle: i16,
646 mode: i16,
647 ets_cycles: i16,
648 ets_interleave: i16,
649 ) -> i32 {
650 let sym = self
651 .ps3000_set_ets
652 .as_ref()
653 .expect("Expected function, got error.");
654 (sym)(handle, mode, ets_cycles, ets_interleave)
655 }
656 pub unsafe fn ps3000_set_trigger(
657 &self,
658 handle: i16,
659 source: i16,
660 threshold: i16,
661 direction: i16,
662 delay: i16,
663 auto_trigger_ms: i16,
664 ) -> i16 {
665 let sym = self
666 .ps3000_set_trigger
667 .as_ref()
668 .expect("Expected function, got error.");
669 (sym)(handle, source, threshold, direction, delay, auto_trigger_ms)
670 }
671 pub unsafe fn ps3000_set_trigger2(
672 &self,
673 handle: i16,
674 source: i16,
675 threshold: i16,
676 direction: i16,
677 delay: f32,
678 auto_trigger_ms: i16,
679 ) -> i16 {
680 let sym = self
681 .ps3000_set_trigger2
682 .as_ref()
683 .expect("Expected function, got error.");
684 (sym)(handle, source, threshold, direction, delay, auto_trigger_ms)
685 }
686 pub unsafe fn ps3000_run_block(
687 &self,
688 handle: i16,
689 no_of_values: i32,
690 timebase: i16,
691 oversample: i16,
692 time_indisposed_ms: *mut i32,
693 ) -> i16 {
694 let sym = self
695 .ps3000_run_block
696 .as_ref()
697 .expect("Expected function, got error.");
698 (sym)(
699 handle,
700 no_of_values,
701 timebase,
702 oversample,
703 time_indisposed_ms,
704 )
705 }
706 pub unsafe fn ps3000_run_streaming_ns(
707 &self,
708 handle: i16,
709 sample_interval: u32,
710 time_units: PS3000_TIME_UNITS,
711 max_samples: u32,
712 auto_stop: i16,
713 noOfSamplesPerAggregate: u32,
714 overview_buffer_size: u32,
715 ) -> i16 {
716 let sym = self
717 .ps3000_run_streaming_ns
718 .as_ref()
719 .expect("Expected function, got error.");
720 (sym)(
721 handle,
722 sample_interval,
723 time_units,
724 max_samples,
725 auto_stop,
726 noOfSamplesPerAggregate,
727 overview_buffer_size,
728 )
729 }
730 pub unsafe fn ps3000_run_streaming(
731 &self,
732 handle: i16,
733 sample_interval_ms: i16,
734 max_samples: i32,
735 windowed: i16,
736 ) -> i16 {
737 let sym = self
738 .ps3000_run_streaming
739 .as_ref()
740 .expect("Expected function, got error.");
741 (sym)(handle, sample_interval_ms, max_samples, windowed)
742 }
743 pub unsafe fn ps3000_ready(&self, handle: i16) -> i16 {
744 let sym = self
745 .ps3000_ready
746 .as_ref()
747 .expect("Expected function, got error.");
748 (sym)(handle)
749 }
750 pub unsafe fn ps3000_stop(&self, handle: i16) -> i16 {
751 let sym = self
752 .ps3000_stop
753 .as_ref()
754 .expect("Expected function, got error.");
755 (sym)(handle)
756 }
757 pub unsafe fn ps3000_get_values(
758 &self,
759 handle: i16,
760 buffer_a: *mut i16,
761 buffer_b: *mut i16,
762 buffer_c: *mut i16,
763 buffer_d: *mut i16,
764 overflow: *mut i16,
765 no_of_values: i32,
766 ) -> i32 {
767 let sym = self
768 .ps3000_get_values
769 .as_ref()
770 .expect("Expected function, got error.");
771 (sym)(
772 handle,
773 buffer_a,
774 buffer_b,
775 buffer_c,
776 buffer_d,
777 overflow,
778 no_of_values,
779 )
780 }
781 pub unsafe fn ps3000_release_stream_buffer(&self, handle: i16) -> () {
782 let sym = self
783 .ps3000_release_stream_buffer
784 .as_ref()
785 .expect("Expected function, got error.");
786 (sym)(handle)
787 }
788 pub unsafe fn ps3000_get_times_and_values(
789 &self,
790 handle: i16,
791 times: *mut i32,
792 buffer_a: *mut i16,
793 buffer_b: *mut i16,
794 buffer_c: *mut i16,
795 buffer_d: *mut i16,
796 overflow: *mut i16,
797 time_units: i16,
798 no_of_values: i32,
799 ) -> i32 {
800 let sym = self
801 .ps3000_get_times_and_values
802 .as_ref()
803 .expect("Expected function, got error.");
804 (sym)(
805 handle,
806 times,
807 buffer_a,
808 buffer_b,
809 buffer_c,
810 buffer_d,
811 overflow,
812 time_units,
813 no_of_values,
814 )
815 }
816 pub unsafe fn ps3000_open_unit_async(&self) -> i16 {
817 let sym = self
818 .ps3000_open_unit_async
819 .as_ref()
820 .expect("Expected function, got error.");
821 (sym)()
822 }
823 pub unsafe fn ps3000_open_unit_progress(
824 &self,
825 handle: *mut i16,
826 progress_percent: *mut i16,
827 ) -> i16 {
828 let sym = self
829 .ps3000_open_unit_progress
830 .as_ref()
831 .expect("Expected function, got error.");
832 (sym)(handle, progress_percent)
833 }
834 pub unsafe fn ps3000_streaming_ns_get_interval_stateless(
835 &self,
836 handle: i16,
837 nChannels: i16,
838 sample_interval: *mut u32,
839 ) -> i16 {
840 let sym = self
841 .ps3000_streaming_ns_get_interval_stateless
842 .as_ref()
843 .expect("Expected function, got error.");
844 (sym)(handle, nChannels, sample_interval)
845 }
846 pub unsafe fn ps3000_get_streaming_last_values(
847 &self,
848 handle: i16,
849 lpGetOverviewBuffersMaxMin: GetOverviewBuffersMaxMin,
850 ) -> i16 {
851 let sym = self
852 .ps3000_get_streaming_last_values
853 .as_ref()
854 .expect("Expected function, got error.");
855 (sym)(handle, lpGetOverviewBuffersMaxMin)
856 }
857 pub unsafe fn ps3000_overview_buffer_status(
858 &self,
859 handle: i16,
860 previous_buffer_overrun: *mut i16,
861 ) -> i16 {
862 let sym = self
863 .ps3000_overview_buffer_status
864 .as_ref()
865 .expect("Expected function, got error.");
866 (sym)(handle, previous_buffer_overrun)
867 }
868 pub unsafe fn ps3000_get_streaming_values(
869 &self,
870 handle: i16,
871 start_time: *mut f64,
872 pbuffer_a_max: *mut i16,
873 pbuffer_a_min: *mut i16,
874 pbuffer_b_max: *mut i16,
875 pbuffer_b_min: *mut i16,
876 pbuffer_c_max: *mut i16,
877 pbuffer_c_min: *mut i16,
878 pbuffer_d_max: *mut i16,
879 pbuffer_d_min: *mut i16,
880 overflow: *mut i16,
881 triggerAt: *mut u32,
882 triggered: *mut i16,
883 no_of_values: u32,
884 noOfSamplesPerAggregate: u32,
885 ) -> u32 {
886 let sym = self
887 .ps3000_get_streaming_values
888 .as_ref()
889 .expect("Expected function, got error.");
890 (sym)(
891 handle,
892 start_time,
893 pbuffer_a_max,
894 pbuffer_a_min,
895 pbuffer_b_max,
896 pbuffer_b_min,
897 pbuffer_c_max,
898 pbuffer_c_min,
899 pbuffer_d_max,
900 pbuffer_d_min,
901 overflow,
902 triggerAt,
903 triggered,
904 no_of_values,
905 noOfSamplesPerAggregate,
906 )
907 }
908 pub unsafe fn ps3000_get_streaming_values_no_aggregation(
909 &self,
910 handle: i16,
911 start_time: *mut f64,
912 pbuffer_a: *mut i16,
913 pbuffer_b: *mut i16,
914 pbuffer_c: *mut i16,
915 pbuffer_d: *mut i16,
916 overflow: *mut i16,
917 triggerAt: *mut u32,
918 trigger: *mut i16,
919 no_of_values: u32,
920 ) -> u32 {
921 let sym = self
922 .ps3000_get_streaming_values_no_aggregation
923 .as_ref()
924 .expect("Expected function, got error.");
925 (sym)(
926 handle,
927 start_time,
928 pbuffer_a,
929 pbuffer_b,
930 pbuffer_c,
931 pbuffer_d,
932 overflow,
933 triggerAt,
934 trigger,
935 no_of_values,
936 )
937 }
938 pub unsafe fn ps3000_save_streaming_data(
939 &self,
940 handle: i16,
941 lpCallbackFunc: PS3000_CALLBACK_FUNC,
942 dataBuffers: *mut i16,
943 dataBufferSize: i16,
944 ) -> i16 {
945 let sym = self
946 .ps3000_save_streaming_data
947 .as_ref()
948 .expect("Expected function, got error.");
949 (sym)(handle, lpCallbackFunc, dataBuffers, dataBufferSize)
950 }
951 pub unsafe fn ps3000SetAdvTriggerChannelProperties(
952 &self,
953 handle: i16,
954 channelProperties: *mut TRIGGER_CHANNEL_PROPERTIES,
955 nChannelProperties: i16,
956 autoTriggerMilliseconds: i32,
957 ) -> i16 {
958 let sym = self
959 .ps3000SetAdvTriggerChannelProperties
960 .as_ref()
961 .expect("Expected function, got error.");
962 (sym)(
963 handle,
964 channelProperties,
965 nChannelProperties,
966 autoTriggerMilliseconds,
967 )
968 }
969 pub unsafe fn ps3000SetAdvTriggerChannelConditions(
970 &self,
971 handle: i16,
972 conditions: *mut TRIGGER_CONDITIONS,
973 nConditions: i16,
974 ) -> i16 {
975 let sym = self
976 .ps3000SetAdvTriggerChannelConditions
977 .as_ref()
978 .expect("Expected function, got error.");
979 (sym)(handle, conditions, nConditions)
980 }
981 pub unsafe fn ps3000SetAdvTriggerChannelDirections(
982 &self,
983 handle: i16,
984 channelA: THRESHOLD_DIRECTION,
985 channelB: THRESHOLD_DIRECTION,
986 channelC: THRESHOLD_DIRECTION,
987 channelD: THRESHOLD_DIRECTION,
988 ext: THRESHOLD_DIRECTION,
989 ) -> i16 {
990 let sym = self
991 .ps3000SetAdvTriggerChannelDirections
992 .as_ref()
993 .expect("Expected function, got error.");
994 (sym)(handle, channelA, channelB, channelC, channelD, ext)
995 }
996 pub unsafe fn ps3000SetPulseWidthQualifier(
997 &self,
998 handle: i16,
999 conditions: *mut PWQ_CONDITIONS,
1000 nConditions: i16,
1001 direction: THRESHOLD_DIRECTION,
1002 lower: u32,
1003 upper: u32,
1004 type_: PULSE_WIDTH_TYPE,
1005 ) -> i16 {
1006 let sym = self
1007 .ps3000SetPulseWidthQualifier
1008 .as_ref()
1009 .expect("Expected function, got error.");
1010 (sym)(
1011 handle,
1012 conditions,
1013 nConditions,
1014 direction,
1015 lower,
1016 upper,
1017 type_,
1018 )
1019 }
1020 pub unsafe fn ps3000SetAdvTriggerDelay(
1021 &self,
1022 handle: i16,
1023 delay: u32,
1024 preTriggerDelay: f32,
1025 ) -> i16 {
1026 let sym = self
1027 .ps3000SetAdvTriggerDelay
1028 .as_ref()
1029 .expect("Expected function, got error.");
1030 (sym)(handle, delay, preTriggerDelay)
1031 }
1032 pub unsafe fn ps3000PingUnit(&self, handle: i16) -> i16 {
1033 let sym = self
1034 .ps3000PingUnit
1035 .as_ref()
1036 .expect("Expected function, got error.");
1037 (sym)(handle)
1038 }
1039}