Skip to content

Commit ce5fb2e

Browse files
author
neil.hamilton
committed
Updated enums
1 parent 757aac3 commit ce5fb2e

File tree

1 file changed

+23
-16
lines changed

1 file changed

+23
-16
lines changed

picosdk/ps4000a.py

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,24 +28,23 @@ def __init__(self):
2828
ps4000a.PICO_COUPLING = {k[-2:]: v for k, v in ps4000a.PS4000A_COUPLING.items()}
2929

3030
# A tuple in an enum like this is 2 names for the same value.
31-
ps4000a.PS4000A_CHANNEL = make_enum([
32-
"PS4000A_CHANNEL_A",
33-
"PS4000A_CHANNEL_B",
34-
"PS4000A_CHANNEL_C",
35-
"PS4000A_CHANNEL_D",
36-
("PS4000A_CHANNEL_E", "PS4000A_MAX_4_CHANNELS"),
37-
"PS4000A_CHANNEL_F",
38-
"PS4000A_CHANNEL_G",
39-
"PS4000A_CHANNEL_H",
40-
("PS4000A_MAX_CHANNELS", "PS4000A_EXTERNAL"),
41-
"PS4000A_TRIGGER_AUX",
42-
"PS4000A_MAX_TRIGGER_SOURCES",
43-
])
31+
ps4000a.PS4000A_CHANNEL = {
32+
"PS4000A_CHANNEL_A" : 0,
33+
"PS4000A_CHANNEL_B" : 1,
34+
"PS4000A_CHANNEL_C" : 2,
35+
"PS4000A_CHANNEL_D" : 3,
36+
("PS4000A_CHANNEL_E", "PS4000A_MAX_4_CHANNELS") : 4,
37+
"PS4000A_CHANNEL_F" : 5,
38+
"PS4000A_CHANNEL_G" : 6 ,
39+
"PS4000A_CHANNEL_H" : 7,
40+
("PS4000A_MAX_CHANNELS", "PS4000A_EXTERNAL") : 8,
41+
"PS4000A_TRIGGER_AUX" : 9,
42+
"PS4000A_MAX_TRIGGER_SOURCES" : 10,
43+
"PS4000A_PULSE_WIDTH_SOURCE" : 0x10000000
44+
}
4445

45-
ps4000a.PS4000A_CHANNEL["PS4000A_PULSE_WIDTH_SOURCE"] = 0x10000000
46+
ps4000a.PICO_CHANNEL = {k[19:]: v for k, v in ps4000a.PS4000A_CHANNEL.items()}
4647

47-
# only include the normal analog channels for now:
48-
ps4000a.PICO_CHANNEL = {k[-1]: v for k, v in ps4000a.PS4000A_CHANNEL.items() if "PS4000A_CHANNEL_" in k}
4948

5049

5150
# The voltage ranges for this driver are so oddly defined, that it is easier to describe them as a literal than trying
@@ -287,6 +286,14 @@ def process_enum(enum):
287286
"PS4000A_FALSE"
288287
])
289288

289+
ps4000a.PS4000A_PULSE_WIDTH_TYPE = make_enum([
290+
"PW_TYPE NONE",
291+
"PW_TYPE_LESS_THAN",
292+
"PW_TYPE_GREATER_THAN",
293+
"PW_TYPE_IN_RANGE",
294+
"PW_TYPE_OUT_OF_RANGE"
295+
])
296+
290297
class PS4000A_CONDITION (Structure):
291298
_pack_ = 1
292299
_fields_ = [("source", c_int32),

0 commit comments

Comments
 (0)