Source code for rsrtx.Implementations.Bus.I2S.Clock.Polarity

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

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

[docs] def set(self, bit_clock_edge: enums.BusClockEdge, bus=repcap.Bus.Default) -> None: """ ``BUS<*>:I2S:CLOCk:POLarity`` \n Snippet: ``driver.bus.i2S.clock.polarity.set(bit_clock_edge = enums.BusClockEdge.FALLing, bus = repcap.Bus.Default)`` \n Sets the polarity of the clock signal, that is the edge at which the instrument samples the data on the data line. :param bit_clock_edge: FALLing | RISing :param bus: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Bus') """ param = Conversions.enum_scalar_to_str(bit_clock_edge, enums.BusClockEdge) bus_cmd_val = self._cmd_group.get_repcap_cmd_value(bus, repcap.Bus) self._core.io.write(f'BUS{bus_cmd_val}:I2S:CLOCk:POLarity {param}')
# noinspection PyTypeChecker
[docs] def get(self, bus=repcap.Bus.Default) -> enums.BusClockEdge: """ ``BUS<*>:I2S:CLOCk:POLarity`` \n Snippet: ``value: enums.BusClockEdge = driver.bus.i2S.clock.polarity.get(bus = repcap.Bus.Default)`` \n Sets the polarity of the clock signal, that is the edge at which the instrument samples the data on the data line. :param bus: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Bus') :return: bit_clock_edge: FALLing | RISing """ bus_cmd_val = self._cmd_group.get_repcap_cmd_value(bus, repcap.Bus) response = self._core.io.query_str(f'BUS{bus_cmd_val}:I2S:CLOCk:POLarity?') return Conversions.str_to_scalar_enum(response, enums.BusClockEdge)