from ....Internal.Core import Core
from ....Internal.CommandsGroup import CommandsGroup
from ....Internal import Conversions
from .... import enums
from .... import repcap
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class TechnologyCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("technology", core, parent)
[docs]
def set(self, technology: enums.BusTechnology, bus=repcap.Bus.Default) -> None:
"""
``BUS<*>:UART:TECHnology`` \n
Snippet: ``driver.bus.uart.technology.set(technology = enums.BusTechnology.CUSTom, bus = repcap.Bus.Default)`` \n
Sets the threshold voltage Tx and Rx lines as defined for various signal technologies.
:param technology: V15 | V25 | V165 | V125 | V09 | VM13 | V38 | V20 | V0 | MANual \n
- V15 | V25 | V165 | V125 | V09 | V38 | V20 | V0: 1.5 V, 2.5 V, 1.65 V ... respectively
- VM13: -1.3 V (negative value)
- MANual: Manual setting of user-defined values with BUSb:UART:RX:THReshold and BUSb:UART:TX:THReshold.
:param bus: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Bus')
"""
param = Conversions.enum_scalar_to_str(technology, enums.BusTechnology)
bus_cmd_val = self._cmd_group.get_repcap_cmd_value(bus, repcap.Bus)
self._core.io.write(f'BUS{bus_cmd_val}:UART:TECHnology {param}')
# noinspection PyTypeChecker
[docs]
def get(self, bus=repcap.Bus.Default) -> enums.BusTechnology:
"""
``BUS<*>:UART:TECHnology`` \n
Snippet: ``value: enums.BusTechnology = driver.bus.uart.technology.get(bus = repcap.Bus.Default)`` \n
Sets the threshold voltage Tx and Rx lines as defined for various signal technologies.
:param bus: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Bus')
:return: technology: V15 | V25 | V165 | V125 | V09 | VM13 | V38 | V20 | V0 | MANual \n
- V15 | V25 | V165 | V125 | V09 | V38 | V20 | V0: 1.5 V, 2.5 V, 1.65 V ... respectively
- VM13: -1.3 V (negative value)
- MANual: Manual setting of user-defined values with BUSb:UART:RX:THReshold and BUSb:UART:TX:THReshold.
"""
bus_cmd_val = self._cmd_group.get_repcap_cmd_value(bus, repcap.Bus)
response = self._core.io.query_str(f'BUS{bus_cmd_val}:UART:TECHnology?')
return Conversions.str_to_scalar_enum(response, enums.BusTechnology)