@@ -29,7 +29,7 @@ def enumerate_system_devices( # dead: disable
29
29
"""Iterate through all interfaces and locates available devices.
30
30
31
31
:param interface_filter: Interface enum to limit the search to a
32
- single interface type.
32
+ single interface type.
33
33
:return: A list of uosinterface objects.
34
34
"""
35
35
system_devices = []
@@ -44,7 +44,8 @@ def enumerate_system_devices( # dead: disable
44
44
def get_device_definition (identity : str ) -> Device | None :
45
45
"""Look up the system config dictionary for the defined device mappings.
46
46
47
- :param identity: String containing the lookup key of the device in the dictionary.
47
+ :param identity: String containing the lookup key of the device in
48
+ the dictionary.
48
49
:return: Device Object or None if not found
49
50
"""
50
51
if identity is not None and hasattr (Devices , identity ):
@@ -58,7 +59,8 @@ def get_device_definition(identity: str) -> Device | None:
58
59
class UOSDevice : # dead: disable
59
60
"""Class for high level object-orientated control of UOS devices.
60
61
61
- :ivar identity: The type of device, this is must have a valid device in the config.
62
+ :ivar identity: The type of device, this is must have a valid device
63
+ in the config.
62
64
:ivar address: Compliant connection string for identifying the
63
65
device and interface.
64
66
"""
@@ -165,10 +167,11 @@ def get_gpio_input(
165
167
"""Read a GPIO pins level from device and returns the value.
166
168
167
169
:param pin: The numeric number of the pin as defined in the
168
- dictionary for that device.
169
- :param pull_up: Enable the internal pull-up resistor. Default is false.
170
+ dictionary for that device.
171
+ :param pull_up: Enable the internal pull-up resistor. Default is
172
+ false.
170
173
:param volatility: How volatile should the command be, use
171
- constants from uoshardware.
174
+ constants from uoshardware.
172
175
:return: ComResult object.
173
176
"""
174
177
result = self .__execute_instruction (
@@ -219,8 +222,9 @@ def reset_all_io(self, volatility=Persistence.RAM) -> ComResult:
219
222
"""Execute the reset IO at the defined volatility level.
220
223
221
224
:param volatility: Where should the pins reset from, use
222
- constants from uoshardware.
223
- :return: ComResult object containing the result of the reset operation..
225
+ constants from uoshardware.
226
+ :return: ComResult object containing the result of the reset
227
+ operation..
224
228
"""
225
229
return self .__execute_instruction (
226
230
UOSFunctions .reset_all_io ,
@@ -258,11 +262,13 @@ def __execute_instruction(
258
262
"""Execute a generic UOS function and get the result.
259
263
260
264
:param function: The name of the function in the OOL.
261
- :param instruction_data: device_functions from the LUT, payload ect.
262
- :param retry: Allows the instruction to retry execution when fails.
265
+ :param instruction_data: device_functions from the LUT, payload
266
+ ect.
267
+ :param retry: Allows the instruction to retry execution when
268
+ fails.
263
269
:return: ComResult object
264
270
:raises: UOSUnsupportedError if function is not possible on the
265
- loaded device.
271
+ loaded device.
266
272
"""
267
273
if (
268
274
function .name not in self .__device .functions_enabled
@@ -373,7 +379,8 @@ def get_compatible_pins(self, function: UOSFunction) -> set:
373
379
def get_functions_enabled (self ) -> dict : # dead: disable
374
380
"""Return functions enabled for the device.
375
381
376
- :return: Dictionary of function names to list of Persistence levels.
382
+ :return: Dictionary of function names to list of Persistence
383
+ levels.
377
384
"""
378
385
return self .__device .functions_enabled
379
386
0 commit comments