Skip to content

Commit 4920ab4

Browse files
author
neil.hamilton
committed
Add ps3000aStreamingReady to ps3000a.py
1 parent 1c92212 commit 4920ab4

File tree

1 file changed

+25
-14
lines changed

1 file changed

+25
-14
lines changed

picosdk/ps3000a.py

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -601,20 +601,31 @@ class PS3000A_DIGITAL_CHANNEL_DIRECTIONS(Structure):
601601
ps3000a.make_symbol("_GetStreamingLatestValues", "ps3000aGetStreamingLatestValues", c_uint32,
602602
[c_int16, c_void_p, c_void_p], doc)
603603

604-
# TODO sort out how to make a callback for a C function in ctypes!
605-
# doc = """ void *ps3000aStreamingReady
606-
# (
607-
# int16_t handle,
608-
# int32_t noOfSamples,
609-
# uint32_t startIndex,
610-
# int16_t overflow,
611-
# uint32_t triggerAt,
612-
# int16_t triggered,
613-
# int16_t autoStop,
614-
# void *pParameter
615-
# ); """
616-
# ps3000a.make_symbol("_StreamingReady", "ps3000aStreamingReady", c_void_p,
617-
# [c_int16, c_int32, c_uint32, c_int16, c_uint32, c_int16, c_int16, c_void_p], doc)
604+
doc = """ void *ps3000aStreamingReady
605+
(
606+
int16_t handle,
607+
int32_t noOfSamples,
608+
uint32_t startIndex,
609+
int16_t overflow,
610+
uint32_t triggerAt,
611+
int16_t triggered,
612+
int16_t autoStop,
613+
void *pParameter
614+
);
615+
define a python function which accepts the correct arguments, and pass it to the constructor of this type.
616+
"""
617+
618+
ps3000a.StreamingReadyType = C_CALLBACK_FUNCTION_FACTORY(None,
619+
c_int16,
620+
c_int32,
621+
c_uint32,
622+
c_int16,
623+
c_uint32,
624+
c_int16,
625+
c_int16,
626+
c_void_p)
627+
628+
ps3000a.StreamingReadyType.__doc__ = doc
618629

619630
doc = """ PICO_STATUS ps3000aNoOfStreamingValues
620631
(

0 commit comments

Comments
 (0)