Skip to content

Commit dc2d85d

Browse files
author
neil.hamilton
committed
Add missing enums and functions to ps4000.py for streaming mode
1 parent fa7d9cf commit dc2d85d

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

picosdk/ps4000.py

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"""
99

1010
from ctypes import *
11+
from picosdk.ctypes_wrapper import C_CALLBACK_FUNCTION_FACTORY
1112
from picosdk.library import Library
1213
from picosdk.constants import make_enum
1314

@@ -103,6 +104,16 @@ def process_enum(enum):
103104

104105
ps4000.PICO_VOLTAGE_RANGE = process_enum(ps4000.PS4000_RANGE)
105106

107+
ps4000.PS4000_TIME_UNITS = make_enum([
108+
'PS4000_FS',
109+
'PS4000_PS',
110+
'PS4000_NS',
111+
'PS4000_US',
112+
'PS4000_MS',
113+
'PS4000_S',
114+
'PS4000_MAX_TIME_UNITS',
115+
])
116+
106117
doc = """ PICO_STATUS ps4000OpenUnit
107118
(
108119
int16_t *handle
@@ -614,6 +625,32 @@ def process_enum(enum):
614625
); """
615626
ps4000.make_symbol("_GetStreamingLatestValues", "ps4000GetStreamingLatestValues", c_uint32,
616627
[c_int16, c_void_p, c_void_p], doc)
628+
629+
doc = """ void *ps4000StreamingReady
630+
(
631+
int16_t handle,
632+
int32_t noOfSamples,
633+
uint32_t startIndex,
634+
int16_t overflow,
635+
uint32_t triggerAt,
636+
int16_t triggered,
637+
int16_t autoStop,
638+
void *pParameter
639+
);
640+
define a python function which accepts the correct arguments, and pass it to the constructor of this type.
641+
"""
642+
643+
ps4000.StreamingReadyType = C_CALLBACK_FUNCTION_FACTORY(None,
644+
c_int16,
645+
c_int32,
646+
c_uint32,
647+
c_int16,
648+
c_uint32,
649+
c_int16,
650+
c_int16,
651+
c_void_p)
652+
653+
ps4000.StreamingReadyType.__doc__ = doc
617654

618655
doc = """ PICO_STATUS ps4000NoOfStreamingValues
619656
(

0 commit comments

Comments
 (0)