from ......Internal.Core import Core
from ......Internal.CommandsGroup import CommandsGroup
from ......Internal import Conversions
from ...... import repcap
# noinspection PyPep8Naming,PyAttributeOutsideInit,SpellCheckingInspection
class DataCls:
"""
| Commands in total: 1
| Subgroups: 0
| Direct child commands: 1
"""
def __init__(self, core: Core, parent):
self._core = core
self._cmd_group = CommandsGroup("data", core, parent)
[docs]
def set(self, data: bool, serialBus=repcap.SerialBus.Default, item=repcap.Item.Default) -> None:
"""
``SBUS<*>:QSPI:OPCode:ITEM<*>:DATA`` \n
Snippet: ``driver.sbus.qspi.opCode.item.data.set(data = False, serialBus = repcap.SerialBus.Default, item = repcap.Item.Default)`` \n
Enable, if data is being transferred in the opcode operation.
:param data: OFF | ON
:param serialBus: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Sbus')
:param item: optional repeated capability selector. Default value: Ix1 (settable in the interface 'Item')
"""
param = Conversions.bool_to_str(data)
serialBus_cmd_val = self._cmd_group.get_repcap_cmd_value(serialBus, repcap.SerialBus)
item_cmd_val = self._cmd_group.get_repcap_cmd_value(item, repcap.Item)
self._core.io.write(f'SBUS{serialBus_cmd_val}:QSPI:OPCode:ITEM{item_cmd_val}:DATA {param}')
[docs]
def get(self, serialBus=repcap.SerialBus.Default, item=repcap.Item.Default) -> bool:
"""
``SBUS<*>:QSPI:OPCode:ITEM<*>:DATA`` \n
Snippet: ``value: bool = driver.sbus.qspi.opCode.item.data.get(serialBus = repcap.SerialBus.Default, item = repcap.Item.Default)`` \n
Enable, if data is being transferred in the opcode operation.
:param serialBus: optional repeated capability selector. Default value: Nr1 (settable in the interface 'Sbus')
:param item: optional repeated capability selector. Default value: Ix1 (settable in the interface 'Item')
:return: data: OFF | ON
"""
serialBus_cmd_val = self._cmd_group.get_repcap_cmd_value(serialBus, repcap.SerialBus)
item_cmd_val = self._cmd_group.get_repcap_cmd_value(item, repcap.Item)
response = self._core.io.query_str(f'SBUS{serialBus_cmd_val}:QSPI:OPCode:ITEM{item_cmd_val}:DATA?')
return Conversions.str_to_bool(response)