diff --git a/pus_tc/cmd_definitions.py b/pus_tc/cmd_definitions.py index 37e4a8e..785698a 100644 --- a/pus_tc/cmd_definitions.py +++ b/pus_tc/cmd_definitions.py @@ -541,6 +541,8 @@ def add_ploc_mpsoc_cmds(cmd_dict: ServiceOpCodeDictT): "14": ("Ploc MPSoC: Mode replay", {OpCodeDictKeys.TIMEOUT: 2.0}), "15": ("Ploc MPSoC: Mode idle", {OpCodeDictKeys.TIMEOUT: 2.0}), "16": ("Ploc MPSoC: Tc cam command send", {OpCodeDictKeys.TIMEOUT: 2.0}), + "17": ("Ploc MPSoC: Set UART TX tristate" , {OpCodeDictKeys.TIMEOUT: 2.0}), + "18": ("Ploc MPSoC: Relesase UART TX", {OpCodeDictKeys.TIMEOUT: 2.0}), } service_ploc_mpsoc_tuple = ("Ploc MPSoC", op_code_dict_srv_ploc_mpsoc) cmd_dict[CustomServiceList.PLOC_MPSOC.value] = service_ploc_mpsoc_tuple diff --git a/pus_tc/devs/ploc_mpsoc.py b/pus_tc/devs/ploc_mpsoc.py index 9a39acb..85d8a9c 100644 --- a/pus_tc/devs/ploc_mpsoc.py +++ b/pus_tc/devs/ploc_mpsoc.py @@ -53,6 +53,8 @@ class CommandIds(enum.IntEnum): TC_MODE_REPLAY = 16 TC_CAM_CMD_SEND = 17 TC_MODE_IDLE = 18 + SET_UART_TX_TRISTATE = 20 + RELEASE_UART_TX = 21 class MemAddresses(enum.IntEnum): @@ -175,6 +177,16 @@ def pack_ploc_mpsoc_commands( command = object_id + struct.pack("!I", CommandIds.TC_CAM_CMD_SEND) + bytearray(cam_cmd, 'utf-8') command = PusTelecommand(service=8, subservice=128, ssc=32, app_data=command) tc_queue.appendleft(command.pack_command_tuple()) + elif op_code == "17": + tc_queue.appendleft((QueueCommands.PRINT, "PLOC MPSoC: Set UART TX tristate")) + command = object_id + struct.pack("!I", CommandIds.SET_UART_TX_TRISTATE) + command = PusTelecommand(service=8, subservice=128, ssc=33, app_data=command) + tc_queue.appendleft(command.pack_command_tuple()) + elif op_code == "18": + tc_queue.appendleft((QueueCommands.PRINT, "PLOC MPSoC: Release UART TX")) + command = object_id + struct.pack("!I", CommandIds.RELEASE_UART_TX) + command = PusTelecommand(service=8, subservice=128, ssc=33, app_data=command) + tc_queue.appendleft(command.pack_command_tuple()) return tc_queue diff --git a/pus_tc/devs/ploc_supervisor.py b/pus_tc/devs/ploc_supervisor.py index c3d1d93..2113d4c 100644 --- a/pus_tc/devs/ploc_supervisor.py +++ b/pus_tc/devs/ploc_supervisor.py @@ -769,7 +769,7 @@ def get_debug_verbosity() -> int: def pack_set_gpio_cmd(object_id: bytearray) -> bytearray: - port = int(input("Specify port : 0x"), 16) + port = int(input("Specify port: 0x"), 16) pin = int(input("Specify pin: 0x"), 16) val = int(input("Specify val: 0x"), 16) command = object_id + struct.pack("!I", SupvActionIds.SET_GPIO)