Skip to content

Commit 695d857

Browse files
author
neil.hamilton
committed
Add enums to ps6000.py
1 parent 1ff9de6 commit 695d857

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

picosdk/ps6000.py

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
from ctypes import *
1111
from picosdk.library import Library
12+
from picosdk.ctypes_wrapper import C_CALLBACK_FUNCTION_FACTORY
13+
from picosdk.constants import make_enum
1214

1315

1416
class Ps6000lib(Library):
@@ -18,6 +20,62 @@ def __init__(self):
1820

1921
ps6000 = Ps6000lib()
2022

23+
ps6000.PS6000_RANGE = make_enum([
24+
"PS6000A_10MV",
25+
"PS6000_20MV",
26+
"PS6000_50MV",
27+
"PS6000_100MV",
28+
"PS6000_200MV",
29+
"PS6000_500MV",
30+
"PS6000_1V",
31+
"PS6000_2V",
32+
"PS6000_5V",
33+
"PS6000_10V",
34+
"PS6000_20V",
35+
"PS6000_50V",
36+
"PS6000_MAX_RANGES",
37+
])
38+
39+
ps6000.PS6000_CHANNEL = make_enum([
40+
"PS6000_CHANNEL_A",
41+
"PS6000_CHANNEL_B",
42+
"PS6000_CHANNEL_C",
43+
"PS6000_CHANNEL_D",
44+
("PS6000_EXTERNAL", "PS6000_MAX_CHANNELS"),
45+
"PS6000_TRIGGER_AUX",
46+
"PS6000_MAX_TRIGGER_SOURCES",
47+
])
48+
49+
ps6000.PS6000_COUPLING = make_enum([
50+
"PS6000_AC",
51+
"PS6000_DC_1M",
52+
"PS6000_DC_50R",
53+
])
54+
55+
ps6000.PS6000_BANDWIDTH_LIMITER = make_enum([
56+
"PS6000_BW_FULL",
57+
"PS6000_BW_20MHZ",
58+
"PS6000_BW_25MHZ",
59+
])
60+
61+
ps6000.PS6000_RATIO_MODE = {
62+
"PS6000_RATIO_MODE_NONE" : 0,
63+
"PS6000_RATIO_MODE_AGGREGATE" : 1,
64+
"PS6000_RATIO_MODE_AVERAGE" : 2,
65+
"PS6000_RATIO_MODE_DECIMATE" : 4,
66+
"PS6000_RATIO_MODE_DISTRIBUTION" : 8,
67+
}
68+
69+
ps6000.PS6000_TIME_UNITS = make_enum([
70+
"PS6000_FS",
71+
"PS6000_PS",
72+
"PS6000_NS",
73+
"PS6000_US",
74+
"PS6000_MS",
75+
"PS6000_S",
76+
"PS6000_MAX_TIME_UNITS",
77+
])
78+
2179
# some ps6000 scopes have 2GS of memory.
2280
ps6000.MAX_MEMORY = 2**31
2381

0 commit comments

Comments
 (0)