Merge branch 'meier/ploc' of https://egit.irs.uni-stuttgart.de/eive/eive-tmtc into meier/ploc

This commit is contained in:
Jakob Meier 2022-05-06 19:30:46 +02:00
commit e62484ee80
3 changed files with 25 additions and 1 deletions

View File

@ -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
@ -622,6 +624,7 @@ def add_ploc_supv_cmds(cmd_dict: ServiceOpCodeDictT):
"54": ("PLOC Supervisor: Logging request counters", {OpCodeDictKeys.TIMEOUT: 2.0}),
"55": ("PLOC Supervisor: Request ADC Report", {OpCodeDictKeys.TIMEOUT: 2.0}),
"56": ("PLOC Supervisor: Reset PL", {OpCodeDictKeys.TIMEOUT: 2.0}),
"57": ("PLOC Supervisor: Enable NVMs", {OpCodeDictKeys.TIMEOUT: 2.0}),
}
service_ploc_supv_tuple = ("PLOC Supervisor", op_code_dict_srv_ploc_supv)

View File

@ -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):
@ -177,6 +179,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

View File

@ -87,6 +87,7 @@ class SupvActionIds:
LOGGING_SET_TOPIC = 56
REQUEST_ADC_REPORT = 57
RESET_PL = 58
ENABLE_NVMS = 59
class SupvHkIds:
@ -378,6 +379,14 @@ def pack_ploc_supv_commands(
command = object_id + struct.pack('!I', SupvActionIds.RESET_PL)
command = PusTelecommand(service=8, subservice=128, ssc=71, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
elif op_code == "57":
tc_queue.appendleft((QueueCommands.PRINT, "PLOC Supervisor: Enable NVMs"))
nvm01 = int(input("Enable (1) or disable(0) NVM 0 and 1: "))
nvm3 = int(input("Enable (1) or disable(0) NVM 3: "))
command = object_id + struct.pack('!I', SupvActionIds.ENABLE_NVMS) + struct.pack('B', nvm01) + \
struct.pack('B', nvm3)
command = PusTelecommand(service=8, subservice=128, ssc=72, app_data=command)
tc_queue.appendleft(command.pack_command_tuple())
return tc_queue
@ -599,7 +608,7 @@ def pack_logging_buffer_request(object_id: bytearray) -> bytearray:
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)