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 IdlPolarityCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("idlPolarity", core, parent)
[docs]
def set(self, nrz_pola_idle: enums.BusPolarityMode, bus=repcap.Bus.Default) -> None:
"""
``BUS<*>:CMSB:NRZ:IDLPolarity`` \n
Snippet: ``driver.bus.cmsb.nrz.idlPolarity.set(nrz_pola_idle = enums.BusPolarityMode.IDLHigh, bus = repcap.Bus.Default)`` \n
Selects the idle polarity of the custom serial bus data signal (only available for the coding standard NRZ Unclocked) .
:param nrz_pola_idle: IDLLow | IDLHigh \n
- IDLLow: Sets the base value of the data bus to be '0'. After an idle period, the data signal starts with a low-to-high transition
- IDLHigh: Sets the base value of the data bus to be '1'. After an idle period, the data signal starts with a high-to-low transition
:param bus: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Bus')
"""
param = Conversions.enum_scalar_to_str(nrz_pola_idle, enums.BusPolarityMode)
bus_cmd_val = self._cmd_group.get_repcap_cmd_value(bus, repcap.Bus)
self._core.io.write(f'BUS{bus_cmd_val}:CMSB:NRZ:IDLPolarity {param}')
# noinspection PyTypeChecker
[docs]
def get(self, bus=repcap.Bus.Default) -> enums.BusPolarityMode:
"""
``BUS<*>:CMSB:NRZ:IDLPolarity`` \n
Snippet: ``value: enums.BusPolarityMode = driver.bus.cmsb.nrz.idlPolarity.get(bus = repcap.Bus.Default)`` \n
Selects the idle polarity of the custom serial bus data signal (only available for the coding standard NRZ Unclocked) .
:param bus: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Bus')
:return: nrz_pola_idle: IDLLow | IDLHigh \n
- IDLLow: Sets the base value of the data bus to be '0'. After an idle period, the data signal starts with a low-to-high transition
- IDLHigh: Sets the base value of the data bus to be '1'. After an idle period, the data signal starts with a high-to-low transition
"""
bus_cmd_val = self._cmd_group.get_repcap_cmd_value(bus, repcap.Bus)
response = self._core.io.query_str(f'BUS{bus_cmd_val}:CMSB:NRZ:IDLPolarity?')
return Conversions.str_to_scalar_enum(response, enums.BusPolarityMode)