Source code for rsrtx.Implementations.Bus.Mphy.ThPreset

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 ThPresetCls:
	"""
	| Commands in total: 1
	| Subgroups: 0
	| Direct child commands: 1
	"""

	def __init__(self, core: Core, parent):
		self._core = core
		self._cmd_group = CommandsGroup("thPreset", core, parent)

[docs] def set(self, thres_preset: enums.BusMphyThresPreset, bus=repcap.Bus.Default) -> None: """ ``BUS<*>:MPHY:THPReset`` \n Snippet: ``driver.bus.mphy.thPreset.set(thres_preset = enums.BusMphyThresPreset.MANual, bus = repcap.Bus.Default)`` \n Selects the predefined value to preset the threshold value of the data lanes. :param thres_preset: THRES_60MV | THRES_120MV | THRES_240MV | MANual \n - THRES_60MV | THRES_120MV | THRES_240MV: Sets the threshold value of the data lane to the selected predefined value. - MANual: Automatically switches to this option if you edit the threshold text box manually. :param bus: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Bus') """ param = Conversions.enum_scalar_to_str(thres_preset, enums.BusMphyThresPreset) bus_cmd_val = self._cmd_group.get_repcap_cmd_value(bus, repcap.Bus) self._core.io.write(f'BUS{bus_cmd_val}:MPHY:THPReset {param}')
# noinspection PyTypeChecker
[docs] def get(self, bus=repcap.Bus.Default) -> enums.BusMphyThresPreset: """ ``BUS<*>:MPHY:THPReset`` \n Snippet: ``value: enums.BusMphyThresPreset = driver.bus.mphy.thPreset.get(bus = repcap.Bus.Default)`` \n Selects the predefined value to preset the threshold value of the data lanes. :param bus: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Bus') :return: thres_preset: THRES_60MV | THRES_120MV | THRES_240MV | MANual \n - THRES_60MV | THRES_120MV | THRES_240MV: Sets the threshold value of the data lane to the selected predefined value. - MANual: Automatically switches to this option if you edit the threshold text box manually. """ bus_cmd_val = self._cmd_group.get_repcap_cmd_value(bus, repcap.Bus) response = self._core.io.query_str(f'BUS{bus_cmd_val}:MPHY:THPReset?') return Conversions.str_to_scalar_enum(response, enums.BusMphyThresPreset)