write lcl config register

This commit is contained in:
Robin Müller 2022-03-30 16:31:52 +02:00
parent c1a8170945
commit eb4dc95160
3 changed files with 38 additions and 1 deletions

View File

@ -13,7 +13,7 @@
<option name="ADD_SOURCE_ROOTS" value="true" />
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/tmtccli.py" />
<option name="PARAMETERS" value="-s syrlinks -l -t 6" />
<option name="PARAMETERS" value="-s syrlinks -t 6" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="true" />
<option name="MODULE_MODE" value="false" />

View File

@ -350,6 +350,18 @@ def get_eive_service_op_code_dict(service_op_code_dict: ServiceOpCodeDictT):
"Syrlinks Handler: Read TX AGC value low byte ",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"12": (
"Syrlinks Handler: Write LCL config",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"13": (
"Syrlinks Handler: Read RX status registers",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
"14": (
"Syrlinks Handler: Read LCL config register",
{OpCodeDictKeys.TIMEOUT: 2.0},
),
}
service_syrlinks_handler_tuple = (
"Syrlinks Handler",

View File

@ -11,6 +11,7 @@ from tmtccmd.tc.definitions import TcQueueT
from tmtccmd.tc.service_3_housekeeping import make_sid, generate_one_hk_command
from spacepackets.ecss.tc import PusTelecommand
from tmtccmd.tc.service_200_mode import pack_mode_data, Modes
import struct
class SetIds:
@ -26,6 +27,9 @@ class CommandIds:
READ_TX_WAVEFORM = bytearray([0x0, 0x0, 0x0, 0x8])
READ_TX_AGC_VALUE_HIGH_BYTE = bytearray([0x0, 0x0, 0x0, 0x9])
READ_TX_AGC_VALUE_LOW_BYTE = bytearray([0x0, 0x0, 0x0, 0x9])
WRITE_LCL_CONFIG = 11
READ_LCL_CONFIG_REGISTER = 12
READ_RX_STATUS_REGISTERS = 2
def pack_syrlinks_command(
@ -106,3 +110,24 @@ def pack_syrlinks_command(
command = object_id + CommandIds.READ_TX_AGC_VALUE_LOW_BYTE
command = PusTelecommand(service=8, subservice=128, ssc=16, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "12":
tc_queue.appendleft(
(QueueCommands.PRINT, "Syrlinks: Write LCL config")
)
command = object_id + struct.pack('!I', CommandIds.WRITE_LCL_CONFIG)
command = PusTelecommand(service=8, subservice=128, ssc=17, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "13":
tc_queue.appendleft(
(QueueCommands.PRINT, "Syrlinks: Read RX status registers")
)
command = object_id + struct.pack('!I', CommandIds.READ_RX_STATUS_REGISTERS)
command = PusTelecommand(service=8, subservice=128, ssc=18, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
if op_code == "14":
tc_queue.appendleft(
(QueueCommands.PRINT, "Syrlinks: Read LCL config register")
)
command = object_id + struct.pack('!I', CommandIds.READ_LCL_CONFIG_REGISTER)
command = PusTelecommand(service=8, subservice=128, ssc=19, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())