WIP: COM Subsystem #356
@ -68,6 +68,7 @@
|
||||
#include "fsfw_hal/linux/spi/SpiCookie.h"
|
||||
#include "fsfw_hal/linux/uart/UartComIF.h"
|
||||
#include "fsfw_hal/linux/uart/UartCookie.h"
|
||||
#include "linux/tmtc/CCSDSHandler.h"
|
||||
#include "mission/core/GenericFactory.h"
|
||||
#include "mission/devices/ACUHandler.h"
|
||||
#include "mission/devices/BpxBatteryHandler.h"
|
||||
@ -94,7 +95,6 @@
|
||||
#include "mission/devices/devicedefinitions/SyrlinksDefinitions.h"
|
||||
#include "mission/devices/devicedefinitions/payloadPcduDefinitions.h"
|
||||
#include "mission/system/objects/AcsBoardAssembly.h"
|
||||
#include "mission/tmtc/CCSDSHandler.h"
|
||||
#include "mission/tmtc/VirtualChannel.h"
|
||||
#include "mission/utility/TmFunnel.h"
|
||||
|
||||
|
@ -43,6 +43,7 @@ enum commonObjects: uint32_t {
|
||||
PLOC_MPSOC_HANDLER = 0x44330015,
|
||||
PLOC_SUPERVISOR_HANDLER = 0x44330016,
|
||||
PLOC_SUPERVISOR_HELPER = 0x44330017,
|
||||
SYRLINKS_HK_HANDLER = 0x445300A3,
|
||||
|
||||
/**
|
||||
* Not yet specified which pt1000 will measure which device/location in the satellite.
|
||||
@ -105,6 +106,7 @@ enum commonObjects: uint32_t {
|
||||
ACS_SUBSYSTEM = 0x73010001,
|
||||
PL_SUBSYSTEM = 0x73010002,
|
||||
PLOC_SUBSYSTEM = 0x73010003,
|
||||
COM_SUBSYSTEM = 0x73010004,
|
||||
};
|
||||
}
|
||||
|
||||
|
2
fsfw
2
fsfw
@ -1 +1 @@
|
||||
Subproject commit 1c4ea6dd0dbc6e93086c28d8e0ce3bed5be0c73c
|
||||
Subproject commit 3225a8e350efbc3ff2e8d9dd9757de52be90d4fd
|
@ -5,6 +5,7 @@ add_subdirectory(boardtest)
|
||||
add_subdirectory(devices)
|
||||
add_subdirectory(fsfwconfig)
|
||||
add_subdirectory(obc)
|
||||
add_subdirectory(tmtc)
|
||||
|
||||
target_sources(${OBSW_NAME} PUBLIC
|
||||
ObjectFactory.cpp
|
||||
|
@ -53,7 +53,7 @@ enum sourceObjects : uint32_t {
|
||||
/* Custom device handler */
|
||||
PCDU_HANDLER = 0x442000A1,
|
||||
SOLAR_ARRAY_DEPL_HANDLER = 0x444100A2,
|
||||
SYRLINKS_HK_HANDLER = 0x445300A3,
|
||||
|
||||
HEATER_HANDLER = 0x444100A4,
|
||||
RAD_SENSOR = 0x443200A5,
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
||||
#include "linux/obc/VcInterfaceIF.h"
|
||||
#include "mission/tmtc/VcInterfaceIF.h"
|
||||
|
||||
/**
|
||||
* @brief This class handles the transmission of data to a virtual channel of the PTME IP Core
|
||||
|
@ -9,8 +9,8 @@
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
||||
#include "linux/obc/PtmeIF.h"
|
||||
#include "linux/obc/VcInterfaceIF.h"
|
||||
#include "mission/tmtc/PtmeIF.h"
|
||||
#include "mission/tmtc/VcInterfaceIF.h"
|
||||
|
||||
/**
|
||||
* @brief This class handles the interfacing to the telemetry (PTME) IP core responsible for the
|
||||
|
@ -4,7 +4,6 @@
|
||||
#include <unordered_map>
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
#include "VirtualChannel.h"
|
||||
#include "fsfw/action/ActionHelper.h"
|
||||
#include "fsfw/action/HasActionsIF.h"
|
||||
#include "fsfw/events/EventMessage.h"
|
||||
@ -18,6 +17,7 @@
|
||||
#include "fsfw_hal/common/gpio/GpioIF.h"
|
||||
#include "fsfw_hal/common/gpio/gpioDefinitions.h"
|
||||
#include "linux/obc/PtmeConfig.h"
|
||||
#include "mission/tmtc/VirtualChannel.h"
|
||||
|
||||
/**
|
||||
* @brief This class handles the data exchange with the CCSDS IP cores implemented in the
|
5
linux/tmtc/CMakeLists.txt
Normal file
5
linux/tmtc/CMakeLists.txt
Normal file
@ -0,0 +1,5 @@
|
||||
target_sources(${OBSW_NAME} PUBLIC
|
||||
CCSDSHandler.cpp
|
||||
)
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
target_sources(${LIB_EIVE_MISSION} PRIVATE
|
||||
acsModeTree.cpp
|
||||
payloadModeTree.cpp
|
||||
comModeTree.cpp
|
||||
system.cpp
|
||||
util.cpp
|
||||
)
|
||||
|
111
mission/system/tree/comModeTree.cpp
Normal file
111
mission/system/tree/comModeTree.cpp
Normal file
@ -0,0 +1,111 @@
|
||||
#include "comModeTree.h"
|
||||
|
||||
#include <commonObjects.h>
|
||||
#include <fsfw/devicehandlers/DeviceHandlerIF.h>
|
||||
#include <fsfw/modes/HasModesIF.h>
|
||||
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
||||
#include <fsfw/subsystem/Subsystem.h>
|
||||
|
||||
#include "mission/tmtc/comDefinitions.h"
|
||||
#include "util.h"
|
||||
|
||||
const auto check = subsystem::checkInsert;
|
||||
|
||||
static const auto OFF = HasModesIF::MODE_OFF;
|
||||
static const auto ON = HasModesIF::MODE_ON;
|
||||
static const auto NML = DeviceHandlerIF::MODE_NORMAL;
|
||||
|
||||
auto COM_SEQUENCE_TX_OFF = std::make_pair(NML << 24, FixedArrayList<ModeListEntry, 2>());
|
||||
auto COM_TABLE_TX_OFF_TGT = std::make_pair((NML << 24) | 1, FixedArrayList<ModeListEntry, 0>());
|
||||
auto COM_TABLE_TX_OFF_TRANS = std::make_pair((NML << 24) | 2, FixedArrayList<ModeListEntry, 6>());
|
||||
|
||||
auto COM_SEQUENCE_TX_ON = std::make_pair(NML << 24, FixedArrayList<ModeListEntry, 2>());
|
||||
auto COM_TABLE_TX_ON_TGT = std::make_pair((NML << 24) | 1, FixedArrayList<ModeListEntry, 0>());
|
||||
auto COM_TABLE_TX_ON_TRANS = std::make_pair((NML << 24) | 2, FixedArrayList<ModeListEntry, 6>());
|
||||
|
||||
namespace {
|
||||
void buildTxOffSequence(Subsystem* ss, ModeListEntry& eh);
|
||||
void buildTxOnSequence(Subsystem* ss, ModeListEntry& eh);
|
||||
} // namespace
|
||||
|
||||
void satsystem::com::init() {
|
||||
ModeListEntry entry;
|
||||
Subsystem* comSubsystem = new Subsystem(objects::COM_SUBSYSTEM, objects::EIVE_SYSTEM, 12, 24);
|
||||
buildTxOffSequence(comSubsystem, entry);
|
||||
buildTxOnSequence(comSubsystem, entry);
|
||||
comSubsystem->setInitialMode(NML, ::com::Submodes::NONE);
|
||||
}
|
||||
|
||||
namespace {
|
||||
|
||||
void buildTxOffSequence(Subsystem* ss, ModeListEntry& eh) {
|
||||
std::string context = "satsystem::com::buildTxOffSequence";
|
||||
auto ctxc = context.c_str();
|
||||
// Insert Helper Table
|
||||
auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, ArrayList<ModeListEntry>& table) {
|
||||
eh.setObject(obj);
|
||||
eh.setMode(mode);
|
||||
eh.setSubmode(submode);
|
||||
check(table.insert(eh), ctxc);
|
||||
};
|
||||
// Insert Helper Sequence
|
||||
auto ihs = [&](ArrayList<ModeListEntry>& sequence, Mode_t tableId, uint32_t waitSeconds,
|
||||
bool checkSuccess) {
|
||||
eh.setTableId(tableId);
|
||||
eh.setWaitSeconds(waitSeconds);
|
||||
eh.setCheckSuccess(checkSuccess);
|
||||
check(sequence.insert(eh), ctxc);
|
||||
};
|
||||
|
||||
// Build TX OFF table
|
||||
iht(objects::SYRLINKS_HK_HANDLER, NML, com::NONE, COM_TABLE_TX_OFF_TGT.second);
|
||||
check(ss->addTable(TableEntry(COM_SEQUENCE_TX_OFF.first, &COM_TABLE_TX_OFF_TGT.second)), ctxc);
|
||||
|
||||
// Build TX OFF transition
|
||||
iht(objects::SYRLINKS_HK_HANDLER, NML, com::NONE, COM_TABLE_TX_OFF_TRANS.second);
|
||||
check(ss->addTable(TableEntry(COM_SEQUENCE_TX_OFF.first, &COM_TABLE_TX_OFF_TRANS.second)), ctxc);
|
||||
|
||||
// Build TX OFF sequence
|
||||
ihs(COM_SEQUENCE_TX_OFF.second, COM_TABLE_TX_OFF_TGT.first, 0, false);
|
||||
ihs(COM_SEQUENCE_TX_OFF.second, COM_TABLE_TX_OFF_TRANS.first, 0, false);
|
||||
check(ss->addSequence(SequenceEntry(COM_TABLE_TX_OFF_TRANS.first, &COM_TABLE_TX_OFF_TRANS.second,
|
||||
COM_TABLE_TX_OFF_TRANS.first)),
|
||||
ctxc);
|
||||
}
|
||||
|
||||
void buildTxOnSequence(Subsystem* ss, ModeListEntry& eh) {
|
||||
std::string context = "satsystem::com::buildTxOnSequence";
|
||||
auto ctxc = context.c_str();
|
||||
// Insert Helper Table
|
||||
auto iht = [&](object_id_t obj, Mode_t mode, Submode_t submode, ArrayList<ModeListEntry>& table) {
|
||||
eh.setObject(obj);
|
||||
eh.setMode(mode);
|
||||
eh.setSubmode(submode);
|
||||
check(table.insert(eh), ctxc);
|
||||
};
|
||||
// Insert Helper Sequence
|
||||
auto ihs = [&](ArrayList<ModeListEntry>& sequence, Mode_t tableId, uint32_t waitSeconds,
|
||||
bool checkSuccess) {
|
||||
eh.setTableId(tableId);
|
||||
eh.setWaitSeconds(waitSeconds);
|
||||
eh.setCheckSuccess(checkSuccess);
|
||||
check(sequence.insert(eh), ctxc);
|
||||
};
|
||||
|
||||
// Build TX ON table
|
||||
iht(objects::SYRLINKS_HK_HANDLER, NML, com::TX_ON, COM_TABLE_TX_ON_TGT.second);
|
||||
check(ss->addTable(TableEntry(COM_SEQUENCE_TX_ON.first, &COM_TABLE_TX_ON_TGT.second)), ctxc);
|
||||
|
||||
// Build TX ON transition
|
||||
iht(objects::SYRLINKS_HK_HANDLER, NML, com::NONE, COM_TABLE_TX_ON_TRANS.second);
|
||||
check(ss->addTable(TableEntry(COM_SEQUENCE_TX_ON.first, &COM_TABLE_TX_ON_TRANS.second)), ctxc);
|
||||
|
||||
// Build TX ON sequence
|
||||
ihs(COM_SEQUENCE_TX_ON.second, COM_TABLE_TX_ON_TGT.first, 0, false);
|
||||
ihs(COM_SEQUENCE_TX_ON.second, COM_TABLE_TX_ON_TRANS.first, 0, false);
|
||||
check(ss->addSequence(SequenceEntry(COM_TABLE_TX_ON_TRANS.first, &COM_TABLE_TX_ON_TRANS.second,
|
||||
COM_TABLE_TX_ON_TRANS.first)),
|
||||
ctxc);
|
||||
}
|
||||
|
||||
} // namespace
|
12
mission/system/tree/comModeTree.h
Normal file
12
mission/system/tree/comModeTree.h
Normal file
@ -0,0 +1,12 @@
|
||||
#ifndef MISSION_SYSTEM_TREE_COMMODETREE_H_
|
||||
#define MISSION_SYSTEM_TREE_COMMODETREE_H_
|
||||
|
||||
namespace satsystem {
|
||||
|
||||
namespace com {
|
||||
void init();
|
||||
}
|
||||
|
||||
} // namespace satsystem
|
||||
|
||||
#endif /* MISSION_SYSTEM_TREE_COMMODETREE_H_ */
|
@ -1,9 +1,11 @@
|
||||
#include "system.h"
|
||||
|
||||
#include "acsModeTree.h"
|
||||
#include "comModeTree.h"
|
||||
#include "payloadModeTree.h"
|
||||
|
||||
void satsystem::init() {
|
||||
acs::init();
|
||||
pl::init();
|
||||
com::init();
|
||||
}
|
||||
|
@ -1,5 +1,4 @@
|
||||
target_sources(${LIB_EIVE_MISSION} PRIVATE
|
||||
CCSDSHandler.cpp
|
||||
VirtualChannel.cpp
|
||||
)
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#ifndef LINUX_OBC_VCINTERFACEIF_H_
|
||||
#define LINUX_OBC_VCINTERFACEIF_H_
|
||||
|
||||
#include <stddef.h>
|
||||
#include <cstddef>
|
||||
|
||||
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
||||
|
@ -1,6 +1,5 @@
|
||||
#include "VirtualChannel.h"
|
||||
|
||||
#include "CCSDSHandler.h"
|
||||
#include "OBSWConfig.h"
|
||||
#include "fsfw/ipc/QueueFactory.h"
|
||||
#include "fsfw/objectmanager/ObjectManager.h"
|
||||
|
@ -1,12 +1,10 @@
|
||||
#ifndef VIRTUALCHANNEL_H_
|
||||
#define VIRTUALCHANNEL_H_
|
||||
|
||||
#include <fsfw/ipc/MessageQueueIF.h>
|
||||
#include <linux/obc/PtmeIF.h>
|
||||
#pragma once
|
||||
|
||||
#include "OBSWConfig.h"
|
||||
#include "fsfw/ipc/MessageQueueIF.h"
|
||||
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
||||
#include "fsfw/tmtcservices/AcceptsTelemetryIF.h"
|
||||
#include "mission/tmtc/PtmeIF.h"
|
||||
|
||||
class StorageManagerIF;
|
||||
|
||||
@ -52,5 +50,3 @@ class VirtualChannel : public AcceptsTelemetryIF, public HasReturnvaluesIF {
|
||||
|
||||
StorageManagerIF* tmStore = nullptr;
|
||||
};
|
||||
|
||||
#endif /* VIRTUALCHANNEL_H_ */
|
||||
|
9
mission/tmtc/comDefinitions.h
Normal file
9
mission/tmtc/comDefinitions.h
Normal file
@ -0,0 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace com {
|
||||
|
||||
enum Submodes : uint8_t { NONE = 0, TX_ON = 1 };
|
||||
|
||||
}
|
2
tmtc
2
tmtc
@ -1 +1 @@
|
||||
Subproject commit 76da8042a4601087e99fa856af241afe9e43695d
|
||||
Subproject commit 168b662288175f9db77a5796a02f38cb66911092
|
Loading…
x
Reference in New Issue
Block a user