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 SourceCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("source", core, parent)
[docs]
def set(self, slave_sel_src: enums.SignalSource, bus=repcap.Bus.Default) -> None:
"""
``BUS<*>:SPI:SSELect:SOURce`` \n
Snippet: ``driver.bus.spi.sselect.source.set(slave_sel_src = enums.SignalSource.AJ1, bus = repcap.Bus.Default)`` \n
Sets the input channel of the slave select line.
:param slave_sel_src: Digital and analog channels cannot be used at the same time for data, clock and slave select lines. See 'Waveform parameter'
:param bus: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Bus')
"""
param = Conversions.enum_scalar_to_str(slave_sel_src, enums.SignalSource)
bus_cmd_val = self._cmd_group.get_repcap_cmd_value(bus, repcap.Bus)
self._core.io.write_with_opc(f'BUS{bus_cmd_val}:SPI:SSELect:SOURce {param}')
# noinspection PyTypeChecker
[docs]
def get(self, bus=repcap.Bus.Default) -> enums.SignalSource:
"""
``BUS<*>:SPI:SSELect:SOURce`` \n
Snippet: ``value: enums.SignalSource = driver.bus.spi.sselect.source.get(bus = repcap.Bus.Default)`` \n
Sets the input channel of the slave select line.
:param bus: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Bus')
"""
bus_cmd_val = self._cmd_group.get_repcap_cmd_value(bus, repcap.Bus)
response = self._core.io.query_str_with_opc(f'BUS{bus_cmd_val}:SPI:SSELect:SOURce?')
return Conversions.str_to_scalar_enum(response, enums.SignalSource)