|
8 | 8 | """ |
9 | 9 |
|
10 | 10 | from ctypes import * |
| 11 | +from picosdk.ctypes_wrapper import C_CALLBACK_FUNCTION_FACTORY |
11 | 12 | from picosdk.library import Library |
12 | 13 | from picosdk.constants import make_enum |
13 | 14 |
|
@@ -161,6 +162,25 @@ def _define_conditionsInfo(): |
161 | 162 | "PS5000A_CONDITION_MAX" |
162 | 163 | ]) |
163 | 164 |
|
| 165 | +ps5000a.PS5000A_RATIO_MODE = { |
| 166 | + 'PS5000A_RATIO_MODE_NONE': 0, |
| 167 | + 'PS5000A_RATIO_MODE_AGGREGATE': 1, |
| 168 | + 'PS5000A_RATIO_MODE_DECIMATE': 2, |
| 169 | + 'PS5000A_RATIO_MODE_AVERAGE': 4, |
| 170 | +} |
| 171 | + |
| 172 | +ps5000a.PS5000A_TIME_UNITS = make_enum([ |
| 173 | + 'PS5000A_FS', |
| 174 | + 'PS5000A_PS', |
| 175 | + 'PS5000A_NS', |
| 176 | + 'PS5000A_US', |
| 177 | + 'PS5000A_MS', |
| 178 | + 'PS5000A_S', |
| 179 | + 'PS5000A_MAX_TIME_UNITS', |
| 180 | +]) |
| 181 | + |
| 182 | +ps5000a.PICO_RATIO_MODE = {k[19:]: v for k, v in ps5000a.PS5000A_RATIO_MODE.items()} |
| 183 | + |
164 | 184 |
|
165 | 185 | class PS5000A_DIGITAL_CHANNEL_DIRECTIONS(Structure): |
166 | 186 | _pack_ = 1 |
@@ -619,6 +639,32 @@ class PS5000A_CONDITION (Structure): |
619 | 639 | ); """ |
620 | 640 | ps5000a.make_symbol("_GetStreamingLatestValues", "ps5000aGetStreamingLatestValues", c_uint32, |
621 | 641 | [c_int16, c_void_p, c_void_p], doc) |
| 642 | + |
| 643 | +doc = """ void *ps5000aStreamingReady |
| 644 | + ( |
| 645 | + int16_t handle, |
| 646 | + int32_t noOfSamples, |
| 647 | + uint32_t startIndex, |
| 648 | + int16_t overflow, |
| 649 | + uint32_t triggerAt, |
| 650 | + int16_t triggered, |
| 651 | + int16_t autoStop, |
| 652 | + void *pParameter |
| 653 | + ); |
| 654 | + define a python function which accepts the correct arguments, and pass it to the constructor of this type. |
| 655 | + """ |
| 656 | + |
| 657 | +ps5000a.StreamingReadyType = C_CALLBACK_FUNCTION_FACTORY(None, |
| 658 | + c_int16, |
| 659 | + c_int32, |
| 660 | + c_uint32, |
| 661 | + c_int16, |
| 662 | + c_uint32, |
| 663 | + c_int16, |
| 664 | + c_int16, |
| 665 | + c_void_p) |
| 666 | + |
| 667 | +ps5000a.StreamingReadyType.__doc__ = doc |
622 | 668 |
|
623 | 669 | # TODO sort out how to make a callback for a C function in ctypes! |
624 | 670 | # doc = """ void *ps5000aStreamingReady |
|
0 commit comments