Skip to content

Commit bd6193e

Browse files
author
neil.hamilton
committed
Add enums and structures needed for advanced triggers
1 parent 8900386 commit bd6193e

File tree

1 file changed

+51
-1
lines changed

1 file changed

+51
-1
lines changed

picosdk/ps4000a.py

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,56 @@ def process_enum(enum):
257257
'PS4000A_PRBS',
258258
])
259259

260+
ps4000a.PS4000A_CONDITIONS_INFO = make_enum([
261+
'PS4000A_CLEAR',
262+
'PS4000A_ADD',
263+
])
264+
265+
ps4000a.PS4000A_THRESHOLD_DIRECTION = make_enum([
266+
("PS4000A_ABOVE", "PS4000A_INSIDE"),
267+
("PS4000A_BELOW", "PS4000A_OUTSIDE"),
268+
("PS4000A_RISING", "PS4000A_ENTER", "PS4000A_NONE"),
269+
("PS4000A_FALLING", "PS4000A_EXIT"),
270+
("PS4000A_RISING_OR_FALLING", "PS4000A_ENTER_OR_EXIT"),
271+
"PS4000A_ABOVE_LOWER",
272+
"PS4000A_BELOW_LOWER",
273+
"PS4000A_RISING_LOWER",
274+
"PS4000A_FALLING_LOWER",
275+
"PS4000A_POSITIVE_RUNT",
276+
"PS4000A_NEGATIVE_RUNT",
277+
])
278+
279+
ps4000a.PS4000A_THRESHOLD_MODE = make_enum([
280+
"PS4000A_LEVEL",
281+
"PS4000A_WINDOW"
282+
])
283+
284+
class PS4000A_CONDITION (Structure):
285+
_pack_ = 1
286+
_fields_ = [("source", c_int32),
287+
("condition", c_int16)]
288+
289+
ps4000a.PS4000A_CONDITION = PS4000A_CONDITION
290+
291+
class PS4000A_DIRECTION(Structure):
292+
_pack_ = 1
293+
_fields_ = [("channel", c_int32),
294+
("direction", c_int32),
295+
("mode", c_int32)]
296+
297+
ps4000a.PS4000A_DIRECTION = PS4000A_DIRECTION
298+
299+
class PS4000A_TRIGGER_CHANNEL_PROPERTIES(Structure):
300+
_pack_ = 1
301+
_fields_ = [("thresholdUpper", c_int16),
302+
("thresholdUpperHysteresis", c_uint16),
303+
("thresholdLower", c_int16),
304+
("thresholdLowerHysteresis", c_uint16),
305+
("channel", c_int32),
306+
("thresholdMode", c_int32)]
307+
308+
ps4000a.PS4000A_TRIGGER_CHANNEL_PROPERTIES = PS4000A_TRIGGER_CHANNEL_PROPERTIES
309+
260310
doc = """ PICO_STATUS ps4000aOpenUnit
261311
(
262312
int16_t *handle,
@@ -994,4 +1044,4 @@ def process_enum(enum):
9941044
int16_t handle,
9951045
PS4000A_DEVICE_RESOLUTION resolution
9961046
); """
997-
ps4000a.make_symbol("_SetResolution", "ps4000aSetDeviceResolution", c_uint32, [c_int16, c_int32], doc)
1047+
ps4000a.make_symbol("_SetResolution", "ps4000aSetDeviceResolution", c_uint32, [c_int16, c_int32], doc)

0 commit comments

Comments
 (0)