@@ -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,9 +59,9 @@ 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 address: Compliant connection string for identifying the
63
- device and interface.
62
+ :ivar identity: The type of device, this is must have a valid device
63
+ in the config. :ivar address: Compliant connection string for
64
+ identifying the device and interface.
64
65
"""
65
66
66
67
__device : Device # Device definitions as parsed from a compatible ini.
@@ -165,10 +166,11 @@ def get_gpio_input(
165
166
"""Read a GPIO pins level from device and returns the value.
166
167
167
168
: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.
169
+ dictionary for that device.
170
+ :param pull_up: Enable the internal pull-up resistor. Default is
171
+ false.
170
172
:param volatility: How volatile should the command be, use
171
- constants from uoshardware.
173
+ constants from uoshardware.
172
174
:return: ComResult object.
173
175
"""
174
176
result = self .__execute_instruction (
@@ -219,8 +221,9 @@ def reset_all_io(self, volatility=Persistence.RAM) -> ComResult:
219
221
"""Execute the reset IO at the defined volatility level.
220
222
221
223
:param volatility: Where should the pins reset from, use
222
- constants from uoshardware.
223
- :return: ComResult object containing the result of the reset operation..
224
+ constants from uoshardware.
225
+ :return: ComResult object containing the result of the reset
226
+ operation..
224
227
"""
225
228
return self .__execute_instruction (
226
229
UOSFunctions .reset_all_io ,
@@ -258,11 +261,13 @@ def __execute_instruction(
258
261
"""Execute a generic UOS function and get the result.
259
262
260
263
: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.
264
+ :param instruction_data: device_functions from the LUT, payload
265
+ ect.
266
+ :param retry: Allows the instruction to retry execution when
267
+ fails.
263
268
:return: ComResult object
264
269
:raises: UOSUnsupportedError if function is not possible on the
265
- loaded device.
270
+ loaded device.
266
271
"""
267
272
if (
268
273
function .name not in self .__device .functions_enabled
@@ -373,7 +378,8 @@ def get_compatible_pins(self, function: UOSFunction) -> set:
373
378
def get_functions_enabled (self ) -> dict : # dead: disable
374
379
"""Return functions enabled for the device.
375
380
376
- :return: Dictionary of function names to list of Persistence levels.
381
+ :return: Dictionary of function names to list of Persistence
382
+ levels.
377
383
"""
378
384
return self .__device .functions_enabled
379
385
0 commit comments