Skip to content

Commit f764da2

Browse files
author
neil.hamilton
committed
Update PicoDeviceEnums.py and PicoDeviceStructs.py with additional enums and structs
1 parent 9079d68 commit f764da2

File tree

2 files changed

+54
-4
lines changed

2 files changed

+54
-4
lines changed

picosdk/PicoDeviceEnums.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,8 @@ def _define_threshold_direction():
217217

218218
picoEnum.PICO_ETS_MODE = make_enum([
219219
"PICO_ETS_OFF",
220-
"PICO_WINDOW",
220+
"PICO_ETS_FAST",
221+
"PICO_ETS_SLOW"
221222
])
222223

223224
picoEnum.PICO_INDEX_MODE = make_enum([
@@ -250,6 +251,7 @@ def _define_resolution():
250251
PICO_DR_15BIT = 3
251252
PICO_DR_16BIT = 4
252253
PICO_DR_10BIT = 10
254+
PICO_DR_10BIT_TURBO = 0x1A
253255

254256
return {k.upper(): v for k, v in locals().items() if k.startswith("PICO")}
255257

@@ -312,7 +314,7 @@ def _define_conditions_info():
312314
])
313315

314316
def _define_digital_port():
315-
Pico_DIGITAL_PORT_NONE = 0
317+
PICO_DIGITAL_PORT_NONE = 0
316318
PICO_DIGITAL_PORT_MSO_POD = 1000
317319
PICO_DIGITAL_PORT_UNKNOWN_DEVICE = -2
318320

@@ -326,4 +328,13 @@ def _define_digital_port():
326328
"PICO_FREQUENCY_10MHZ",
327329
"PICO_FREQUENCY_20MHZ",
328330
"PICO_FREQUENCY_25MHZ"
329-
])
331+
])
332+
333+
def _define_power_delivery_device_type():
334+
PICO_USB_POWER_DELIEVRY_DEVICE_TYPE_NOTHING = 0
335+
PICO_USB_POWER_DELIEVRY_DEVICE_TYPE_SOURCE = 2
336+
PICO_USB_POWER_DELIEVRY_DEVICE_TYPE_DEBUG = 3
337+
338+
return {k.upper(): v for k, v in locals().items() if k.startswith("PICO")}
339+
340+
picoEnum.PICO_USB_POWER_DELIEVRY_DEVICE_TYPE = _define_power_delivery_device_type

picosdk/PicoDeviceStructs.py

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,17 @@ class PICO_SCALING_FACTORS(Structure):
117117

118118
picoStruct.PICO_SCALING_FACTORS = PICO_SCALING_FACTORS
119119

120+
class PICO_SCALING_FACTORS_FOR_RANGE_TYPES(Structure):
121+
_pack_ = 1
122+
_fields_ = [("channel", c_uint32),
123+
("rangeMin", c_int64),
124+
("rangeMax", c_int64),
125+
("rangeType", c_uint32),
126+
("offset", c_int16),
127+
("scalingFactor", c_double)]
128+
129+
picoStruct.PICO_SCALING_FACTORS_FOR_RANGE_TYPES = PICO_SCALING_FACTORS_FOR_RANGE_TYPES
130+
120131
class PROBE_APP(Structure):
121132
_pack_ = 1
122133
_fields_ = [("id", c_int32),
@@ -141,4 +152,32 @@ class PICO_DIGITAL_PORT_INTERACTIONS(Structure):
141152
("serial", c_int8),
142153
("calibrationDate", c_int8)]
143154

144-
picoStruct.PICO_DIGITAL_PORT_INTERACTIONS = PICO_DIGITAL_PORT_INTERACTIONS
155+
picoStruct.PICO_DIGITAL_PORT_INTERACTIONS = PICO_DIGITAL_PORT_INTERACTIONS
156+
157+
class PICO_CHANNEL_OVERVOLTAGE_TRIPPED(Structure):
158+
_pack_ = 1
159+
_fields_ = [("channel", c_uint32),
160+
("tripped", c_uint8)]
161+
162+
picoStruct.PICO_CHANNEL_OVERVOLTAGE_TRIPPED = PICO_CHANNEL_OVERVOLTAGE_TRIPPED
163+
164+
class PICO_USB_POWER_DELIVERY(Structure):
165+
_pack_ = 1
166+
_fields_ = [("valid", c_uint8),
167+
("busVoltagemV", c_uint32),
168+
("rpCurrentLimitmA", c_uint32),
169+
("partnerConnected", c_uint8),
170+
("ccPolarity", c_uint8),
171+
("attachedDevice", c_uint32),
172+
("contractExists", c_uint8),
173+
("currentPdo", c_uint32),
174+
("currentRdo", c_uint32)]
175+
176+
picoStruct.PICO_USB_POWER_DELIVERY = PICO_USB_POWER_DELIVERY
177+
178+
class PICO_USB_POWER_DETAILS(Structure):
179+
_pack_ = 1
180+
_fields_ = [("dataPort", c_uint32),
181+
("powerPort", c_uint32)]
182+
183+
picoStruct.PICO_USB_POWER_DETAILS = PICO_USB_POWER_DETAILS

0 commit comments

Comments
 (0)