|
10 | 10 | from ctypes import * |
11 | 11 | from picosdk.library import Library |
12 | 12 | from picosdk.constants import make_enum |
13 | | - |
| 13 | +from picosdk.ctypes_wrapper import C_CALLBACK_FUNCTION_FACTORY |
14 | 14 |
|
15 | 15 | class Ps4000alib(Library): |
16 | 16 | def __init__(self): |
@@ -188,6 +188,24 @@ def process_enum(enum): |
188 | 188 |
|
189 | 189 | ps4000a.PICO_VOLTAGE_RANGE = process_enum(ps4000a.PICO_CONNECT_PROBE_RANGE) |
190 | 190 |
|
| 191 | +ps4000a.PS4000A_RATIO_MODE = { |
| 192 | + 'PS4000A_RATIO_MODE_NONE': 0, |
| 193 | + 'PS4000A_RATIO_MODE_AGGREGATE': 1, |
| 194 | + 'PS4000A_RATIO_MODE_DECIMATE': 2, |
| 195 | + 'PS4000A_RATIO_MODE_AVERAGE': 4, |
| 196 | +} |
| 197 | + |
| 198 | +ps4000a.PICO_RATIO_MODE = {k[19:]: v for k, v in ps4000a.PS4000A_RATIO_MODE.items()} |
| 199 | + |
| 200 | +ps4000a.PS4000A_TIME_UNITS = make_enum([ |
| 201 | + 'PS4000A_FS', |
| 202 | + 'PS4000A_PS', |
| 203 | + 'PS4000A_NS', |
| 204 | + 'PS4000A_US', |
| 205 | + 'PS4000A_MS', |
| 206 | + 'PS4000A_S', |
| 207 | + 'PS4000A_MAX_TIME_UNITS', |
| 208 | +]) |
191 | 209 |
|
192 | 210 | doc = """ PICO_STATUS ps4000aOpenUnit |
193 | 211 | ( |
@@ -648,6 +666,33 @@ def process_enum(enum): |
648 | 666 | ps4000a.make_symbol("_GetStreamingLatestValues", "ps4000aGetStreamingLatestValues", c_uint32, |
649 | 667 | [c_int16, c_void_p, c_void_p], doc) |
650 | 668 |
|
| 669 | +doc = """ void *ps4000aStreamingReady |
| 670 | + ( |
| 671 | + int16_t handle, |
| 672 | + int32_t noOfSamples, |
| 673 | + uint32_t startIndex, |
| 674 | + int16_t overflow, |
| 675 | + uint32_t triggerAt, |
| 676 | + int16_t triggered, |
| 677 | + int16_t autoStop, |
| 678 | + void *pParameter |
| 679 | + ); |
| 680 | + define a python function which accepts the correct arguments, and pass it to the constructor of this type. |
| 681 | + """ |
| 682 | + |
| 683 | +ps4000a.StreamingReadyType = C_CALLBACK_FUNCTION_FACTORY(None, |
| 684 | + c_int16, |
| 685 | + c_int32, |
| 686 | + c_uint32, |
| 687 | + c_int16, |
| 688 | + c_uint32, |
| 689 | + c_int16, |
| 690 | + c_int16, |
| 691 | + c_void_p) |
| 692 | + |
| 693 | +ps4000a.StreamingReadyType.__doc__ = doc |
| 694 | + |
| 695 | + |
651 | 696 | doc = """ PICO_STATUS ps4000aNoOfStreamingValues |
652 | 697 | ( |
653 | 698 | int16_t handle, |
|
0 commit comments