forked from picotech/picosdk-python-wrappers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathps2000a.py
717 lines (635 loc) · 25.6 KB
/
ps2000a.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
#
# Copyright (C) 2014-2018 Pico Technology Ltd. See LICENSE file for terms.
#
"""
This is a Python module defining the functions from the ps2000aApi.h C header
file for PicoScope 2000 Series oscilloscopes using the ps2000a driver API functions.
"""
from ctypes import *
from picosdk.library import Library
from picosdk.constants import make_enum
class Ps2000alib(Library):
def __init__(self):
super(Ps2000alib, self).__init__("ps2000a")
ps2000a = Ps2000alib()
# A tuple in an enum like this is 2 names for the same value.
ps2000a.PS2000A_CHANNEL = make_enum([
"PS2000A_CHANNEL_A",
"PS2000A_CHANNEL_B",
"PS2000A_CHANNEL_C",
"PS2000A_CHANNEL_D",
("PS2000A_EXTERNAL", "PS2000A_MAX_CHANNELS"),
"PS2000A_TRIGGER_AUX",
"PS2000A_MAX_TRIGGER_SOURCE",
])
# only include the normal analog channels for now:
ps2000a.PICO_CHANNEL = {k[-1]: v for k, v in ps2000a.PS2000A_CHANNEL.items() if "PS2000A_CHANNEL_" in k}
ps2000a.PS2000A_COUPLING = make_enum([
'PS2000A_AC',
'PS2000A_DC',
])
# Just use AC and DC.
ps2000a.PICO_COUPLING = {k[-2:]: v for k, v in ps2000a.PS2000A_COUPLING.items()}
ps2000a.PS2000A_RANGE = make_enum([
"PS2000A_10MV",
"PS2000A_20MV",
"PS2000A_50MV",
"PS2000A_100MV",
"PS2000A_200MV",
"PS2000A_500MV",
"PS2000A_1V",
"PS2000A_2V",
"PS2000A_5V",
"PS2000A_10V",
"PS2000A_20V",
"PS2000A_50V",
"PS2000A_MAX_RANGES",
])
ps2000a.PICO_VOLTAGE_RANGE = {
v: float(k.split('_')[1][:-1]) if k[-2] != 'M' else (0.001 * float(k.split('_')[1][:-2]))
for k, v in ps2000a.PS2000A_RANGE.items() if k != "PS2000A_MAX_RANGES"
}
ps2000a.MAX_MEMORY = 128e6
ps2000a.PS2000A_RATIO_MODE = {
'PS2000A_RATIO_MODE_NONE': 0,
'PS2000A_RATIO_MODE_AGGREGATE': 1,
'PS2000A_RATIO_MODE_DECIMATE': 2,
'PS2000A_RATIO_MODE_AVERAGE': 4,
}
ps2000a.PICO_RATIO_MODE = {k[19:]: v for k, v in ps2000a.PS2000A_RATIO_MODE.items()}
def _define_threshold_direction():
ps2000a_above = 0
ps2000a_below = 1
ps2000a_rising = 2
ps2000a_falling = 3
ps2000a_rising_or_falling = 4
ps2000a_above_lower = 5
ps2000a_below_lower = 6
ps2000a_rising_lower = 7
ps2000a_falling_lower = 8
ps2000a_inside = ps2000a_above
ps2000a_outside = ps2000a_below
ps2000a_enter = ps2000a_rising
ps2000a_exit = ps2000a_falling
ps2000a_enter_or_exit = ps2000a_rising_or_falling
ps2000a_positive_runt = 9
ps2000a_negative_runt = 10
ps2000a_none = ps2000a_rising
return {k.upper(): v for k, v in locals().items() if k.startswith("ps2000a")}
ps2000a.PS2000A_THRESHOLD_DIRECTION = _define_threshold_direction()
ps2000a.PICO_THRESHOLD_DIRECTION = {
k[8:]: v for k, v in ps2000a.PS2000A_THRESHOLD_DIRECTION.items()
}
doc = """ PICO_STATUS ps2000aOpenUnit
(
int16_t *status,
int8_t *serial
); """
ps2000a.make_symbol("_OpenUnit", "ps2000aOpenUnit", c_uint32, [c_void_p, c_char_p], doc)
doc = """ PICO_STATUS ps2000aOpenUnitAsync
(
int16_t *status,
int8_t *serial
); """
ps2000a.make_symbol("_OpenUnitAsync", "ps2000aOpenUnitAsync", c_uint32, [c_void_p, c_char_p], doc)
doc = """ PICO_STATUS ps2000aOpenUnitProgress
(
int16_t *handle,
int16_t *progressPercent,
int16_t *complete
); """
ps2000a.make_symbol("_OpenUnitProgress", "ps2000aOpenUnitProgress", c_uint32, [c_void_p, c_void_p, c_void_p], doc)
doc = """ PICO_STATUS ps2000aGetUnitInfo
(
int16_t handle,
int8_t *string,
int16_t stringLength,
int16_t *requiredSize,
PICO_INFO info
); """
ps2000a.make_symbol("_GetUnitInfo", "ps2000aGetUnitInfo", c_uint32, [c_int16, c_char_p, c_int16, c_void_p, c_uint32],
doc)
doc = """ PICO_STATUS ps2000aFlashLed
(
int16_t handle,
int16_t start
); """
ps2000a.make_symbol("_FlashLed", "ps2000aFlashLed", c_uint32, [c_int16, c_int16], doc)
doc = """ PICO_STATUS ps2000aCloseUnit
(
int16_t handle
); """
ps2000a.make_symbol("_CloseUnit", "ps2000aCloseUnit", c_uint32, [c_int16, ], doc)
doc = """ PICO_STATUS ps2000aMemorySegments
(
int16_t handle,
uint32_t nSegments,
int32_t *nMaxSamples
); """
ps2000a.make_symbol("_MemorySegments", "ps2000aMemorySegments", c_uint32, [c_int16, c_uint32, c_void_p], doc)
doc = """ PICO_STATUS ps2000aSetChannel
(
int16_t handle,
PS2000A_CHANNEL channel,
int16_t enabled,
PS2000A_COUPLING type,
PS2000A_RANGE range,
float analogOffset
); """
ps2000a.make_symbol("_SetChannel", "ps2000aSetChannel", c_uint32,
[c_int16, c_int32, c_int16, c_int32, c_int32, c_float], doc)
doc = """ PICO_STATUS ps2000aSetDigitalPort
(
int16_t handle,
PS2000A_DIGITAL_PORT port,
int16_t enabled,
int16_t logicLevel
); """
ps2000a.make_symbol("_SetDigitalPort", "ps2000aSetDigitalPort", c_uint32, [c_int16, c_int32, c_int16, c_int16], doc)
doc = """ PICO_STATUS ps2000aSetNoOfCaptures
(
int16_t handle,
uint32_t nCaptures
); """
ps2000a.make_symbol("_SetNoOfCaptures", "ps2000aSetNoOfCaptures", c_uint32, [c_int16, c_uint32], doc)
doc = """ PICO_STATUS ps2000aGetTimebase
(
int16_t handle,
uint32_t timebase,
int32_t noSamples,
int32_t *timeIntervalNanoseconds,
int16_t oversample,
int32_t *maxSamples,
uint32_t segmentIndex
); """
ps2000a.make_symbol("_GetTimebase", "ps2000aGetTimebase", c_uint32,
[c_int16, c_uint32, c_int32, c_void_p, c_int16, c_void_p, c_uint32], doc)
doc = """ PICO_STATUS ps2000aGetTimebase2
(
int16_t handle,
uint32_t timebase,
int32_t noSamples,
float *timeIntervalNanoseconds,
int16_t oversample,
int32_t *maxSamples,
uint32_t segmentIndex
); """
ps2000a.make_symbol("_GetTimebase2", "ps2000aGetTimebase2", c_uint32,
[c_int16, c_uint32, c_int32, c_void_p, c_int16, c_void_p, c_uint32], doc)
doc = """ PICO_STATUS ps2000aSetSigGenArbitrary
(
int16_t handle,
int32_t offsetVoltage,
uint32_t pkToPk,
uint32_t startDeltaPhase,
uint32_t stopDeltaPhase,
uint32_t deltaPhaseIncrement,
uint32_t dwellCount,
int16_t *arbitraryWaveform,
int32_t arbitraryWaveformSize,
PS2000A_SWEEP_TYPE sweepType,
PS2000A_EXTRA_OPERATIONS operation,
PS2000A_INDEX_MODE indexMode,
uint32_t shots,
uint32_t sweeps,
PS2000A_SIGGEN_TRIG_TYPE triggerType,
PS2000A_SIGGEN_TRIG_SOURCE triggerSource,
int16_t extInThreshold
); """
ps2000a.make_symbol("_SetSigGenArbitrary", "ps2000aSetSigGenArbitrary", c_uint32,
[c_int16, c_int32, c_uint32, c_uint32, c_uint32, c_uint32, c_uint32, c_void_p, c_int32, c_int32,
c_int32,
c_int32, c_uint32, c_uint32, c_int32, c_int32, c_int16], doc)
doc = """ PICO_STATUS ps2000aSetSigGenBuiltIn
(
int16_t handle,
int32_t offsetVoltage,
uint32_t pkToPk,
int16_t waveType,
float startFrequency,
float stopFrequency,
float increment,
float dwellTime,
PS2000A_SWEEP_TYPE sweepType,
PS2000A_EXTRA_OPERATIONS operation,
uint32_t shots,
uint32_t sweeps,
PS2000A_SIGGEN_TRIG_TYPE triggerType,
PS2000A_SIGGEN_TRIG_SOURCE triggerSource,
int16_t extInThreshold
); """
ps2000a.make_symbol("_SetSigGenBuiltIn", "ps2000aSetSigGenBuiltIn", c_uint32,
[c_int16, c_int32, c_uint32, c_int16, c_float, c_float, c_float, c_float, c_int32, c_int32,
c_uint32,
c_uint32, c_int32, c_int32, c_int16], doc)
doc = """ PICO_STATUS ps2000aSetSigGenPropertiesArbitrary
(
int16_t handle,
uint32_t startDeltaPhase,
uint32_t stopDeltaPhase,
uint32_t deltaPhaseIncrement,
uint32_t dwellCount,
PS2000A_SWEEP_TYPE sweepType,
uint32_t shots,
uint32_t sweeps,
PS2000A_SIGGEN_TRIG_TYPE triggerType,
PS2000A_SIGGEN_TRIG_SOURCE triggerSource,
int16_t extInThreshold
); """
ps2000a.make_symbol("_SetSigGenPropertiesArbitrary", "ps2000aSetSigGenPropertiesArbitrary", c_uint32,
[c_int16, c_uint32, c_uint32, c_uint32, c_uint32, c_int32, c_uint32, c_uint32, c_int32, c_int32,
c_int16], doc)
doc = """ PICO_STATUS ps2000aSetSigGenPropertiesBuiltIn
(
int16_t handle,
double startFrequency,
double stopFrequency,
double increment,
double dwellTime,
PS2000A_SWEEP_TYPE sweepType,
uint32_t shots,
uint32_t sweeps,
PS2000A_SIGGEN_TRIG_TYPE triggerType,
PS2000A_SIGGEN_TRIG_SOURCE triggerSource,
int16_t extInThreshold
); """
ps2000a.make_symbol("_SetSigGenPropertiesBuiltIn", "ps2000aSetSigGenPropertiesBuiltIn", c_uint32,
[c_int16, c_double, c_double, c_double, c_double, c_int32, c_uint32, c_uint32, c_int32, c_int32,
c_int16], doc)
doc = """ PICO_STATUS ps2000aSigGenFrequencyToPhase
(
int16_t handle,
double frequency,
PS2000A_INDEX_MODE indexMode,
uint32_t bufferLength,
uint32_t *phase
); """
ps2000a.make_symbol("_SigGenFrequencyToPhase", "ps2000aSigGenFrequencyToPhase", c_uint32,
[c_int16, c_double, c_int32, c_uint32, c_void_p], doc)
doc = """ PICO_STATUS ps2000aSigGenArbitraryMinMaxValues
(
int16_t handle,
int16_t *minArbitraryWaveformValue,
int16_t *maxArbitraryWaveformValue,
uint32_t *minArbitraryWaveformSize,
uint32_t *maxArbitraryWaveformSize
); """
ps2000a.make_symbol("_SigGenArbitraryMinMaxValues", "ps2000aSigGenArbitraryMinMaxValues", c_uint32,
[c_int16, c_void_p, c_void_p, c_void_p, c_void_p], doc)
doc = """ PICO_STATUS ps2000aSigGenSoftwareControl
(
int16_t handle,
int16_t state
); """
ps2000a.make_symbol("_SigGenSoftwareControl", "ps2000aSigGenSoftwareControl", c_uint32, [c_int16, c_int16], doc)
doc = """ PICO_STATUS ps2000aSetEts
(
int16_t handle,
PS2000A_ETS_MODE mode,
int16_t etsCycles,
int16_t etsInterleave,
int32_t *sampleTimePicoseconds
); """
ps2000a.make_symbol("_SetEts", "ps2000aSetEts", c_uint32, [c_int16, c_int32, c_int16, c_int16, c_void_p], doc)
doc = """ PICO_STATUS ps2000aSetSimpleTrigger
(
int16_t handle,
int16_t enable,
PS2000A_CHANNEL source,
int16_t threshold,
PS2000A_THRESHOLD_DIRECTION direction,
uint32_t delay,
int16_t autoTrigger_ms
); """
ps2000a.make_symbol("_SetSimpleTrigger", "ps2000aSetSimpleTrigger", c_uint32,
[c_int16, c_int16, c_int32, c_int16, c_int32, c_uint32, c_int16], doc)
doc = """ PICO_STATUS ps2000aSetTriggerDigitalPortProperties
(
int16_t handle,
PS2000A_DIGITAL_CHANNEL_DIRECTIONS *directions,
int16_t nDirections
); """
ps2000a.make_symbol("_SetTriggerDigitalPortProperties", "ps2000aSetTriggerDigitalPortProperties", c_uint32,
[c_int16, c_void_p, c_int16], doc)
doc = """ PICO_STATUS ps2000aSetDigitalAnalogTriggerOperand
(
int16_t handle,
PS2000A_TRIGGER_OPERAND operand
); """
ps2000a.make_symbol("_SetDigitalAnalogTriggerOperand", "ps2000aSetDigitalAnalogTriggerOperand", c_uint32,
[c_int16, c_int32], doc)
doc = """ PICO_STATUS ps2000aSetTriggerChannelProperties
(
int16_t handle,
PS2000A_TRIGGER_CHANNEL_PROPERTIES *channelProperties,
int16_t nChannelProperties,
int16_t auxOutputEnable,
int32_t autoTriggerMilliseconds
); """
ps2000a.make_symbol("_SetTriggerChannelProperties", "ps2000aSetTriggerChannelProperties", c_uint32,
[c_int16, c_void_p, c_int16, c_int16, c_int32], doc)
doc = """ PICO_STATUS ps2000aSetTriggerChannelConditions
(
int16_t handle,
PS2000A_TRIGGER_CONDITIONS *conditions,
int16_t nConditions
); """
ps2000a.make_symbol("_SetTriggerChannelConditions", "ps2000aSetTriggerChannelConditions", c_uint32,
[c_int16, c_void_p, c_int16], doc)
doc = """ PICO_STATUS ps2000aSetTriggerChannelDirections
(
int16_t handle,
PS2000A_THRESHOLD_DIRECTION channelA,
PS2000A_THRESHOLD_DIRECTION channelB,
PS2000A_THRESHOLD_DIRECTION channelC,
PS2000A_THRESHOLD_DIRECTION channelD,
PS2000A_THRESHOLD_DIRECTION ext,
PS2000A_THRESHOLD_DIRECTION aux
); """
ps2000a.make_symbol("_SetTriggerChannelDirections", "ps2000aSetTriggerChannelDirections", c_uint32,
[c_int16, c_int32, c_int32, c_int32, c_int32, c_int32, c_int32], doc)
doc = """ PICO_STATUS ps2000aSetTriggerDelay
(
int16_t handle,
uint32_t delay
); """
ps2000a.make_symbol("_SetTriggerDelay", "ps2000aSetTriggerDelay", c_uint32, [c_int16, c_uint32], doc)
doc = """ PICO_STATUS ps2000aSetPulseWidthQualifier
(
int16_t handle,
PS2000A_PWQ_CONDITIONS *conditions,
int16_t nConditions,
PS2000A_THRESHOLD_DIRECTION direction,
uint32_t lower,
uint32_t upper,
PS2000A_PULSE_WIDTH_TYPE type
); """
ps2000a.make_symbol("_SetPulseWidthQualifier", "ps2000aSetPulseWidthQualifier", c_uint32,
[c_int16, c_void_p, c_int16, c_int32, c_uint32, c_uint32, c_int32], doc)
doc = """ PICO_STATUS ps2000aIsTriggerOrPulseWidthQualifierEnabled
(
int16_t handle,
int16_t *triggerEnabled,
int16_t *pulseWidthQualifierEnabled
); """
ps2000a.make_symbol("_IsTriggerOrPulseWidthQualifierEnabled", "ps2000aIsTriggerOrPulseWidthQualifierEnabled", c_uint32,
[c_int16, c_void_p, c_void_p], doc)
doc = """ PICO_STATUS ps2000aGetTriggerTimeOffset64
(
int16_t handle,
int64_t *time,
PS2000A_TIME_UNITS *timeUnits,
uint32_t segmentIndex
); """
ps2000a.make_symbol("_GetTriggerTimeOffset", "ps2000aGetTriggerTimeOffset64", c_uint32,
[c_int16, c_void_p, c_void_p, c_uint32], doc)
doc = """ PICO_STATUS PREF2 PREF3 (ps2000aGetValuesTriggerTimeOffsetBulk64)
(
int16_t handle,
int64_t *times,
PS2000A_TIME_UNITS *timeUnits,
uint32_t fromSegmentIndex,
uint32_t toSegmentIndex
); """
ps2000a.make_symbol("_GetValuesTriggerTimeOffsetBulk", "ps2000aGetValuesTriggerTimeOffsetBulk64", c_uint32,
[c_int16, c_void_p, c_void_p, c_uint32, c_uint32], doc)
doc = """ PICO_STATUS ps2000aGetNoOfCaptures
(
int16_t handle,
uint32_t *nCaptures
); """
ps2000a.make_symbol("_GetNoOfCaptures", "ps2000aGetNoOfCaptures", c_uint32, [c_int16, c_void_p], doc)
doc = """ PICO_STATUS ps2000aGetNoOfProcessedCaptures
(
int16_t handle,
uint32_t *nProcessedCaptures
); """
ps2000a.make_symbol("_GetNoOfProcessedCaptures", "ps2000aGetNoOfProcessedCaptures", c_uint32, [c_int16, c_void_p], doc)
doc = """ PICO_STATUS ps2000aSetDataBuffer
(
int16_t handle,
int32_t channelOrPort,
int16_t *buffer,
int32_t bufferLth,
uint32_t segmentIndex,
PS2000A_RATIO_MODE mode
); """
ps2000a.make_symbol("_SetDataBuffer", "ps2000aSetDataBuffer", c_uint32,
[c_int16, c_int32, c_void_p, c_int32, c_uint32, c_int32], doc)
doc = """ PICO_STATUS ps2000aSetDataBuffers
(
int16_t handle,
int32_t channelOrPort,
int16_t *bufferMax,
int16_t *bufferMin,
int32_t bufferLth,
uint32_t segmentIndex,
PS2000A_RATIO_MODE mode
); """
ps2000a.make_symbol("_SetDataBuffers", "ps2000aSetDataBuffers", c_uint32,
[c_int16, c_int32, c_void_p, c_void_p, c_int32, c_uint32, c_int32], doc)
doc = """ PICO_STATUS ps2000aSetEtsTimeBuffer
(
int16_t handle,
int64_t *buffer,
int32_t bufferLth
); """
ps2000a.make_symbol("_SetEtsTimeBuffer", "ps2000aSetEtsTimeBuffer", c_uint32, [c_int16, c_void_p, c_int32], doc)
doc = """ PICO_STATUS ps2000aIsReady
(
int16_t handle,
int16_t *ready
); """
ps2000a.make_symbol("_IsReady", "ps2000aIsReady", c_uint32, [c_int16, c_void_p], doc)
doc = """ PICO_STATUS ps2000aRunBlock
(
int16_t handle,
int32_t noOfPreTriggerSamples,
int32_t noOfPostTriggerSamples,
uint32_t timebase,
int16_t oversample,
int32_t *timeIndisposedMs,
uint32_t segmentIndex,
ps2000aBlockReady lpReady,
void *pParameter
); """
ps2000a.make_symbol("_RunBlock", "ps2000aRunBlock", c_uint32,
[c_int16, c_int32, c_int32, c_uint32, c_int16, c_void_p, c_uint32, c_void_p, c_void_p], doc)
doc = """ PICO_STATUS ps2000aRunStreaming
(
int16_t handle,
uint32_t *sampleInterval,
PS2000A_TIME_UNITS sampleIntervalTimeUnits,
uint32_t maxPreTriggerSamples,
uint32_t maxPostPreTriggerSamples,
int16_t autoStop,
uint32_t downSampleRatio,
PS2000A_RATIO_MODE downSampleRatioMode,
uint32_t overviewBufferSize
); """
ps2000a.make_symbol("_RunStreaming", "ps2000aRunStreaming", c_uint32,
[c_int16, c_void_p, c_int32, c_uint32, c_uint32, c_int16, c_uint32, c_int32, c_uint32], doc)
doc = """ PICO_STATUS ps2000aGetStreamingLatestValues
(
int16_t handle,
ps2000aStreamingReady lpPs2000aReady,
void *pParameter
); """
ps2000a.make_symbol("_GetStreamingLatestValues", "ps2000aGetStreamingLatestValues", c_uint32,
[c_int16, c_void_p, c_void_p], doc)
# TODO sort out how to make a callback for a C function in ctypes!
# doc = """ void *ps2000aStreamingReady
# (
# int16_t handle,
# int32_t noOfSamples,
# uint32_t startIndex,
# int16_t overflow,
# uint32_t triggerAt,
# int16_t triggered,
# int16_t autoStop,
# void *pParameter
# ); """
# ps2000a.make_symbol("_StreamingReady", "ps2000aStreamingReady", c_void_p,
# [c_int16, c_int32, c_uint32, c_int16, c_uint32, c_int16, c_int16, c_void_p], doc)
doc = """ PICO_STATUS ps2000aNoOfStreamingValues
(
int16_t handle,
uint32_t *noOfValues
); """
ps2000a.make_symbol("_NoOfStreamingValues", "ps2000aNoOfStreamingValues", c_uint32, [c_int16, c_void_p], doc)
doc = """ PICO_STATUS ps2000aGetMaxDownSampleRatio
(
int16_t handle,
uint32_t noOfUnaggreatedSamples,
uint32_t *maxDownSampleRatio,
PS2000A_RATIO_MODE downSampleRatioMode,
uint32_t segmentIndex
); """
ps2000a.make_symbol("_GetMaxDownSampleRatio", "ps2000aGetMaxDownSampleRatio", c_uint32,
[c_int16, c_uint32, c_void_p, c_int32, c_uint32], doc)
doc = """ PICO_STATUS ps2000aGetValues
(
int16_t handle,
uint32_t startIndex,
uint32_t *noOfSamples,
uint32_t downSampleRatio,
PS2000A_RATIO_MODE downSampleRatioMode,
uint32_t segmentIndex,
int16_t *overflow
); """
ps2000a.make_symbol("_GetValues", "ps2000aGetValues", c_uint32,
[c_int16, c_uint32, c_void_p, c_uint32, c_int32, c_uint32, c_void_p], doc)
doc = """ PICO_STATUS ps2000aGetValuesBulk
(
int16_t handle,
uint32_t *noOfSamples,
uint32_t fromSegmentIndex,
uint32_t toSegmentIndex,
uint32_t downSampleRatio,
PS2000A_RATIO_MODE downSampleRatioMode,
int16_t *overflow
); """
ps2000a.make_symbol("_GetValuesBulk", "ps2000aGetValuesBulk", c_uint32,
[c_int16, c_void_p, c_uint32, c_uint32, c_uint32, c_int32, c_void_p], doc)
doc = """ PICO_STATUS ps2000aGetValuesAsync
(
int16_t handle,
uint32_t startIndex,
uint32_t noOfSamples,
uint32_t downSampleRatio,
PS2000A_RATIO_MODE downSampleRatioMode,
uint32_t segmentIndex,
void *lpDataReady,
void *pParameter
); """
ps2000a.make_symbol("_GetValuesAsync", "ps2000aGetValuesAsync", c_uint32,
[c_int16, c_uint32, c_uint32, c_uint32, c_int32, c_uint32, c_void_p, c_void_p], doc)
doc = """ PICO_STATUS ps2000aGetValuesOverlapped
(
int16_t handle,
uint32_t startIndex,
uint32_t *noOfSamples,
uint32_t downSampleRatio,
PS2000A_RATIO_MODE downSampleRatioMode,
uint32_t segmentIndex,
int16_t *overflow
); """
ps2000a.make_symbol("_GetValuesOverlapped", "ps2000aGetValuesOverlapped", c_uint32,
[c_int16, c_uint32, c_void_p, c_uint32, c_int32, c_uint32, c_void_p], doc)
doc = """ PICO_STATUS ps2000aGetValuesOverlappedBulk
(
int16_t handle,
uint32_t startIndex,
uint32_t *noOfSamples,
uint32_t downSampleRatio,
PS2000A_RATIO_MODE downSampleRatioMode,
uint32_t fromSegmentIndex,
uint32_t toSegmentIndex,
int16_t *overflow
); """
ps2000a.make_symbol("_GetValuesOverlappedBulk", "ps2000aGetValuesOverlappedBulk", c_uint32,
[c_int16, c_uint32, c_void_p, c_uint32, c_int32, c_uint32, c_int32, c_void_p], doc)
doc = """ PICO_STATUS ps2000aStop
(
int16_t handle
); """
ps2000a.make_symbol("_Stop", "ps2000aStop", c_uint32, [c_int16, ], doc)
doc = """ PICO_STATUS ps2000aHoldOff
(
int16_t handle,
uint64_t holdoff,
PS2000A_HOLDOFF_TYPE type
); """
ps2000a.make_symbol("_HoldOff", "ps2000aHoldOff", c_uint32, [c_int16, c_uint64, c_int32], doc)
doc = """ PICO_STATUS ps2000aGetChannelInformation
(
int16_t handle,
PS2000A_CHANNEL_INFO info,
int32_t probe,
int32_t *ranges,
int32_t *length,
int32_t channels
); """
ps2000a.make_symbol("_GetChannelInformation", "ps2000aGetChannelInformation", c_uint32,
[c_int16, c_int32, c_int32, c_int32, c_int32, c_int32], doc)
doc = """ PICO_STATUS ps2000aEnumerateUnits
(
int16_t *count,
int8_t *serials,
int16_t *serialLth
); """
ps2000a.make_symbol("_EnumerateUnits", "ps2000aEnumerateUnits", c_uint32, [c_void_p, c_char_p, c_void_p], doc)
doc = """ PICO_STATUS ps2000aPingUnit
(
int16_t handle
); """
ps2000a.make_symbol("_PingUnit", "ps2000aPingUnit", c_uint32, [c_int16, ], doc)
doc = """ PICO_STATUS ps2000aMaximumValue
(
int16_t handle,
int16_t *value
); """
ps2000a.make_symbol("_MaximumValue", "ps2000aMaximumValue", c_uint32, [c_int16, c_void_p], doc)
doc = """ PICO_STATUS ps2000aMinimumValue
(
int16_t handle,
int16_t *value
); """
ps2000a.make_symbol("_MinimumValue", "ps2000aMinimumValue", c_uint32, [c_int16, c_void_p], doc)
doc = """ PICO_STATUS ps2000aGetAnalogueOffset
(
int16_t handle,
PS2000A_RANGE range,
PS2000A_COUPLING coupling,
float *maximumVoltage,
float *minimumVoltage
); """
ps2000a.make_symbol("_GetAnalogueOffset", "ps2000aGetAnalogueOffset", c_uint32,
[c_int16, c_int32, c_int32, c_void_p, c_void_p], doc)
doc = """ PICO_STATUS ps2000aGetMaxSegments
(
int16_t handle,
uint32_t *maxSegments
); """
ps2000a.make_symbol("_GetMaxSegments", "ps2000aGetMaxSegments", c_uint32, [c_int16, c_void_p], doc)
ps2000a.INI_LOGIC_VOLTS = 1.5