Source code for rsrtx.Implementations.Trigger.I2S.Tcondition.Channel

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

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

[docs] def set(self, channel: enums.TriggerI2sChannel, trigger=repcap.Trigger.Default, tcondition=repcap.Tcondition.Default) -> None: """ ``TRIGger<*>:I2S:TCONdition<*>:CHANnel`` \n Snippet: ``driver.trigger.i2S.tcondition.channel.set(channel = enums.TriggerI2sChannel.ANY, trigger = repcap.Trigger.Default, tcondition = repcap.Tcondition.Default)`` \n Selects the audio channel on which the instrument looks for the specified data condition. :param channel: ANY | TDMC1 | TDMCh1 | TDMC2 | TDMCh2 | TDMC3 | TDMCh3 | TDMC4 | TDMCh4 | TDMC5 | TDMCh5 | TDMC6 | TDMCh6 | TDMC7 | TDMCh7 | TDMC8 | TDMCh8 | LEFT | RIGHT | RIGHt \n - ANY: The instrument triggers on any channel on which the specified data is found. - LEFT | RIGHT = RIGHt: Available for I²S Standard, left- und right-justified data formats. - TDMCh1 | TDMCh2 | TDMCh3 | TDMCh4 | TDMCh5 | TDMCh6 | TDMCh7 | TDMCh8: Available for TDM audio signalsTDMC1 = TDMCh1, TDMC2 = TDMCh2, TDMC3 = TDMCh3, TDMC4 = TDMCh4, TDMC5 = TDMCh5, TDMC6 = TDMCh6, TDMC7 = TDMCh7, TDMC8 = TDMCh8. Query returns short form.Note: Available audio channels depend on the configuration of the audio bus. The command BUSb:I2S:CHANnel:TDMCount specifies the number of channels in a TDM frame. :param trigger: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Trigger') :param tcondition: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Tcondition') """ param = Conversions.enum_scalar_to_str(channel, enums.TriggerI2sChannel) trigger_cmd_val = self._cmd_group.get_repcap_cmd_value(trigger, repcap.Trigger) tcondition_cmd_val = self._cmd_group.get_repcap_cmd_value(tcondition, repcap.Tcondition) self._core.io.write(f'TRIGger{trigger_cmd_val}:I2S:TCONdition{tcondition_cmd_val}:CHANnel {param}')
# noinspection PyTypeChecker
[docs] def get(self, trigger=repcap.Trigger.Default, tcondition=repcap.Tcondition.Default) -> enums.TriggerI2sChannel: """ ``TRIGger<*>:I2S:TCONdition<*>:CHANnel`` \n Snippet: ``value: enums.TriggerI2sChannel = driver.trigger.i2S.tcondition.channel.get(trigger = repcap.Trigger.Default, tcondition = repcap.Tcondition.Default)`` \n Selects the audio channel on which the instrument looks for the specified data condition. :param trigger: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Trigger') :param tcondition: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Tcondition') :return: channel: ANY | TDMC1 | TDMCh1 | TDMC2 | TDMCh2 | TDMC3 | TDMCh3 | TDMC4 | TDMCh4 | TDMC5 | TDMCh5 | TDMC6 | TDMCh6 | TDMC7 | TDMCh7 | TDMC8 | TDMCh8 | LEFT | RIGHT | RIGHt \n - ANY: The instrument triggers on any channel on which the specified data is found. - LEFT | RIGHT = RIGHt: Available for I²S Standard, left- und right-justified data formats. - TDMCh1 | TDMCh2 | TDMCh3 | TDMCh4 | TDMCh5 | TDMCh6 | TDMCh7 | TDMCh8: Available for TDM audio signalsTDMC1 = TDMCh1, TDMC2 = TDMCh2, TDMC3 = TDMCh3, TDMC4 = TDMCh4, TDMC5 = TDMCh5, TDMC6 = TDMCh6, TDMC7 = TDMCh7, TDMC8 = TDMCh8. Query returns short form.Note: Available audio channels depend on the configuration of the audio bus. The command BUSb:I2S:CHANnel:TDMCount specifies the number of channels in a TDM frame. """ trigger_cmd_val = self._cmd_group.get_repcap_cmd_value(trigger, repcap.Trigger) tcondition_cmd_val = self._cmd_group.get_repcap_cmd_value(tcondition, repcap.Tcondition) response = self._core.io.query_str(f'TRIGger{trigger_cmd_val}:I2S:TCONdition{tcondition_cmd_val}:CHANnel?') return Conversions.str_to_scalar_enum(response, enums.TriggerI2sChannel)