Source code for rsrtx.Implementations.Bus.Cmsb.Nrz.Cphase

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

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

[docs] def set(self, cpha_mode: enums.BusCmsbCphaMode, bus=repcap.Bus.Default) -> None: """ ``BUS<*>:CMSB:NRZ:CPHase`` \n Snippet: ``driver.bus.cmsb.nrz.cphase.set(cpha_mode = enums.BusCmsbCphaMode.FEDGe, bus = repcap.Bus.Default)`` \n Selects the phase of the custom serial bus clock signal for the coding standard NRZ Clocked, depending on method ``RsRtx.bus.cmsb.nrz.idlPolarity.set()`` . :param cpha_mode: FEDGe | SEDGe \n - FEDGe: Sets the clocking transaction to be on the first edge:If Clock Polarity = 'IDLLow', data are captured on the clock's rising edge (low-to-high transition) and propagated on a falling edgeIf Clock Polarity = 'IDLHigh', data are captured on the clock's falling edge (high-to-low transition) and propagated on a rising edge - SEDGe: Sets the clocking transaction to be on the second edge:If Clock Polarity = 'IDLLow', data are captured on the clock's falling edge (high-to-low transition) and propagated on a rising edgeIf Clock Polarity = 'IDLHigh', data are captured on the clock's rising edge (low-to-high transition) and propagated on a falling edge :param bus: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Bus') """ param = Conversions.enum_scalar_to_str(cpha_mode, enums.BusCmsbCphaMode) bus_cmd_val = self._cmd_group.get_repcap_cmd_value(bus, repcap.Bus) self._core.io.write(f'BUS{bus_cmd_val}:CMSB:NRZ:CPHase {param}')
# noinspection PyTypeChecker
[docs] def get(self, bus=repcap.Bus.Default) -> enums.BusCmsbCphaMode: """ ``BUS<*>:CMSB:NRZ:CPHase`` \n Snippet: ``value: enums.BusCmsbCphaMode = driver.bus.cmsb.nrz.cphase.get(bus = repcap.Bus.Default)`` \n Selects the phase of the custom serial bus clock signal for the coding standard NRZ Clocked, depending on method ``RsRtx.bus.cmsb.nrz.idlPolarity.set()`` . :param bus: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Bus') :return: cpha_mode: FEDGe | SEDGe \n - FEDGe: Sets the clocking transaction to be on the first edge:If Clock Polarity = 'IDLLow', data are captured on the clock's rising edge (low-to-high transition) and propagated on a falling edgeIf Clock Polarity = 'IDLHigh', data are captured on the clock's falling edge (high-to-low transition) and propagated on a rising edge - SEDGe: Sets the clocking transaction to be on the second edge:If Clock Polarity = 'IDLLow', data are captured on the clock's falling edge (high-to-low transition) and propagated on a rising edgeIf Clock Polarity = 'IDLHigh', data are captured on the clock's rising edge (low-to-high transition) and propagated on a falling edge """ 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:CPHase?') return Conversions.str_to_scalar_enum(response, enums.BusCmsbCphaMode)