|
|
@ -36,15 +36,12 @@
|
|
|
|
#include "linux/obc/PdecHandler.h"
|
|
|
|
#include "linux/obc/PdecHandler.h"
|
|
|
|
#include "linux/obc/Ptme.h"
|
|
|
|
#include "linux/obc/Ptme.h"
|
|
|
|
#include "linux/obc/PtmeConfig.h"
|
|
|
|
#include "linux/obc/PtmeConfig.h"
|
|
|
|
|
|
|
|
#include "mission/system/objects/RwAssembly.h"
|
|
|
|
#include "mission/system/fdir/AcsBoardFdir.h"
|
|
|
|
#include "mission/system/fdir/AcsBoardFdir.h"
|
|
|
|
#include "mission/system/fdir/GomspacePowerFdir.h"
|
|
|
|
#include "mission/system/fdir/GomspacePowerFdir.h"
|
|
|
|
#include "mission/system/fdir/RtdFdir.h"
|
|
|
|
#include "mission/system/fdir/RtdFdir.h"
|
|
|
|
#include "mission/system/fdir/SusFdir.h"
|
|
|
|
#include "mission/system/fdir/SusFdir.h"
|
|
|
|
#include "mission/system/fdir/SyrlinksFdir.h"
|
|
|
|
#include "mission/system/fdir/SyrlinksFdir.h"
|
|
|
|
#include "mission/system/objects/RwAssembly.h"
|
|
|
|
|
|
|
|
#include "mission/system/objects/SusAssembly.h"
|
|
|
|
|
|
|
|
#include "mission/system/objects/TcsBoardAssembly.h"
|
|
|
|
|
|
|
|
#include "mission/system/tree/system.h"
|
|
|
|
|
|
|
|
#include "tmtc/apid.h"
|
|
|
|
#include "tmtc/apid.h"
|
|
|
|
#include "tmtc/pusIds.h"
|
|
|
|
#include "tmtc/pusIds.h"
|
|
|
|
#if OBSW_TEST_LIBGPIOD == 1
|
|
|
|
#if OBSW_TEST_LIBGPIOD == 1
|
|
|
@ -96,10 +93,8 @@
|
|
|
|
#include "mission/tmtc/VirtualChannel.h"
|
|
|
|
#include "mission/tmtc/VirtualChannel.h"
|
|
|
|
#include "mission/utility/TmFunnel.h"
|
|
|
|
#include "mission/utility/TmFunnel.h"
|
|
|
|
|
|
|
|
|
|
|
|
ResetArgs RESET_ARGS_GNSS_0;
|
|
|
|
ResetArgs resetArgsGnss0;
|
|
|
|
ResetArgs RESET_ARGS_GNSS_1;
|
|
|
|
ResetArgs resetArgsGnss1;
|
|
|
|
|
|
|
|
|
|
|
|
void ObjectFactory::setStatics() { Factory::setStaticFrameworkObjectIds(); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Factory::setStaticFrameworkObjectIds() {
|
|
|
|
void Factory::setStaticFrameworkObjectIds() {
|
|
|
|
PusServiceBase::packetSource = objects::PUS_PACKET_DISTRIBUTOR;
|
|
|
|
PusServiceBase::packetSource = objects::PUS_PACKET_DISTRIBUTOR;
|
|
|
@ -124,90 +119,7 @@ void Factory::setStaticFrameworkObjectIds() {
|
|
|
|
TmPacketBase::timeStamperId = objects::TIME_STAMPER;
|
|
|
|
TmPacketBase::timeStamperId = objects::TIME_STAMPER;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void ObjectFactory::produce(void* args) {
|
|
|
|
void ObjectFactory::setStatics() { Factory::setStaticFrameworkObjectIds(); }
|
|
|
|
ObjectFactory::setStatics();
|
|
|
|
|
|
|
|
ObjectFactory::produceGenericObjects();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
LinuxLibgpioIF* gpioComIF = nullptr;
|
|
|
|
|
|
|
|
UartComIF* uartComIF = nullptr;
|
|
|
|
|
|
|
|
SpiComIF* spiComIF = nullptr;
|
|
|
|
|
|
|
|
I2cComIF* i2cComIF = nullptr;
|
|
|
|
|
|
|
|
PowerSwitchIF* pwrSwitcher = nullptr;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
createCommunicationInterfaces(&gpioComIF, &uartComIF, &spiComIF, &i2cComIF);
|
|
|
|
|
|
|
|
createTmpComponents();
|
|
|
|
|
|
|
|
new CoreController(objects::CORE_CONTROLLER);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
gpioCallbacks::disableAllDecoder(gpioComIF);
|
|
|
|
|
|
|
|
createPcduComponents(gpioComIF, &pwrSwitcher);
|
|
|
|
|
|
|
|
createRadSensorComponent(gpioComIF);
|
|
|
|
|
|
|
|
createSunSensorComponents(gpioComIF, spiComIF, pwrSwitcher, q7s::SPI_DEFAULT_DEV);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if OBSW_ADD_ACS_BOARD == 1
|
|
|
|
|
|
|
|
createAcsBoardComponents(gpioComIF, uartComIF, pwrSwitcher);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
createHeaterComponents();
|
|
|
|
|
|
|
|
createSolarArrayDeploymentComponents();
|
|
|
|
|
|
|
|
createPlPcduComponents(gpioComIF, spiComIF, pwrSwitcher);
|
|
|
|
|
|
|
|
#if OBSW_ADD_SYRLINKS == 1
|
|
|
|
|
|
|
|
createSyrlinksComponents(pwrSwitcher);
|
|
|
|
|
|
|
|
#endif /* OBSW_ADD_SYRLINKS == 1 */
|
|
|
|
|
|
|
|
createRtdComponents(q7s::SPI_DEFAULT_DEV, gpioComIF, pwrSwitcher);
|
|
|
|
|
|
|
|
createPayloadComponents(gpioComIF);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if OBSW_ADD_MGT == 1
|
|
|
|
|
|
|
|
I2cCookie* imtqI2cCookie =
|
|
|
|
|
|
|
|
new I2cCookie(addresses::IMTQ, IMTQ::MAX_REPLY_SIZE, q7s::I2C_DEFAULT_DEV);
|
|
|
|
|
|
|
|
auto imtqHandler = new IMTQHandler(objects::IMTQ_HANDLER, objects::I2C_COM_IF, imtqI2cCookie,
|
|
|
|
|
|
|
|
pcdu::Switches::PDU1_CH3_MGT_5V);
|
|
|
|
|
|
|
|
imtqHandler->setPowerSwitcher(pwrSwitcher);
|
|
|
|
|
|
|
|
static_cast<void>(imtqHandler);
|
|
|
|
|
|
|
|
#if OBSW_TEST_IMTQ == 1
|
|
|
|
|
|
|
|
imtqHandler->setStartUpImmediately();
|
|
|
|
|
|
|
|
imtqHandler->setToGoToNormal(true);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if OBSW_DEBUG_IMTQ == 1
|
|
|
|
|
|
|
|
imtqHandler->setDebugMode(true);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
createReactionWheelComponents(gpioComIF);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if OBSW_ADD_BPX_BATTERY_HANDLER == 1
|
|
|
|
|
|
|
|
I2cCookie* bpxI2cCookie = new I2cCookie(addresses::BPX_BATTERY, 100, q7s::I2C_DEFAULT_DEV);
|
|
|
|
|
|
|
|
BpxBatteryHandler* bpxHandler =
|
|
|
|
|
|
|
|
new BpxBatteryHandler(objects::BPX_BATT_HANDLER, objects::I2C_COM_IF, bpxI2cCookie);
|
|
|
|
|
|
|
|
bpxHandler->setStartUpImmediately();
|
|
|
|
|
|
|
|
bpxHandler->setToGoToNormalMode(true);
|
|
|
|
|
|
|
|
#if OBSW_DEBUG_BPX_BATT == 1
|
|
|
|
|
|
|
|
bpxHandler->setDebugMode(true);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
new FileSystemHandler(objects::FILE_SYSTEM_HANDLER);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if OBSW_ADD_STAR_TRACKER == 1
|
|
|
|
|
|
|
|
UartCookie* starTrackerCookie =
|
|
|
|
|
|
|
|
new UartCookie(objects::STAR_TRACKER, q7s::UART_STAR_TRACKER_DEV, uart::STAR_TRACKER_BAUD,
|
|
|
|
|
|
|
|
startracker::MAX_FRAME_SIZE * 2 + 2, UartModes::NON_CANONICAL);
|
|
|
|
|
|
|
|
starTrackerCookie->setNoFixedSizeReply();
|
|
|
|
|
|
|
|
StrHelper* strHelper = new StrHelper(objects::STR_HELPER);
|
|
|
|
|
|
|
|
auto starTracker =
|
|
|
|
|
|
|
|
new StarTrackerHandler(objects::STAR_TRACKER, objects::UART_COM_IF, starTrackerCookie,
|
|
|
|
|
|
|
|
strHelper, pcdu::PDU1_CH2_STAR_TRACKER_5V);
|
|
|
|
|
|
|
|
starTracker->setPowerSwitcher(pwrSwitcher);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif /* OBSW_ADD_STAR_TRACKER == 1 */
|
|
|
|
|
|
|
|
#if OBSW_USE_CCSDS_IP_CORE == 1
|
|
|
|
|
|
|
|
createCcsdsComponents(gpioComIF);
|
|
|
|
|
|
|
|
#endif /* OBSW_USE_CCSDS_IP_CORE == 1 */
|
|
|
|
|
|
|
|
/* Test Task */
|
|
|
|
|
|
|
|
#if OBSW_ADD_TEST_CODE == 1
|
|
|
|
|
|
|
|
createTestComponents(gpioComIF);
|
|
|
|
|
|
|
|
#endif /* OBSW_ADD_TEST_CODE == 1 */
|
|
|
|
|
|
|
|
new PlocUpdater(objects::PLOC_UPDATER);
|
|
|
|
|
|
|
|
new PlocMemoryDumper(objects::PLOC_MEMORY_DUMPER);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
satsystem::init();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ObjectFactory::createTmpComponents() {
|
|
|
|
void ObjectFactory::createTmpComponents() {
|
|
|
|
I2cCookie* i2cCookieTmp1075tcs1 =
|
|
|
|
I2cCookie* i2cCookieTmp1075tcs1 =
|
|
|
@ -550,15 +462,15 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
|
|
|
#if OBSW_DEBUG_GPS == 1
|
|
|
|
#if OBSW_DEBUG_GPS == 1
|
|
|
|
debugGps = true;
|
|
|
|
debugGps = true;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
RESET_ARGS_GNSS_1.gnss1 = true;
|
|
|
|
resetArgsGnss1.gnss1 = true;
|
|
|
|
RESET_ARGS_GNSS_1.gpioComIF = gpioComIF;
|
|
|
|
resetArgsGnss1.gpioComIF = gpioComIF;
|
|
|
|
RESET_ARGS_GNSS_1.waitPeriodMs = 100;
|
|
|
|
resetArgsGnss1.waitPeriodMs = 100;
|
|
|
|
RESET_ARGS_GNSS_0.gnss1 = false;
|
|
|
|
resetArgsGnss0.gnss1 = false;
|
|
|
|
RESET_ARGS_GNSS_0.gpioComIF = gpioComIF;
|
|
|
|
resetArgsGnss0.gpioComIF = gpioComIF;
|
|
|
|
RESET_ARGS_GNSS_0.waitPeriodMs = 100;
|
|
|
|
resetArgsGnss0.waitPeriodMs = 100;
|
|
|
|
auto gpsHandler0 =
|
|
|
|
auto gpsHandler0 =
|
|
|
|
new GPSHyperionLinuxController(objects::GPS_CONTROLLER, objects::NO_OBJECT, debugGps);
|
|
|
|
new GPSHyperionLinuxController(objects::GPS_CONTROLLER, objects::NO_OBJECT, debugGps);
|
|
|
|
gpsHandler0->setResetPinTriggerFunction(gps::triggerGpioResetPin, &RESET_ARGS_GNSS_0);
|
|
|
|
gpsHandler0->setResetPinTriggerFunction(gps::triggerGpioResetPin, &resetArgsGnss0);
|
|
|
|
|
|
|
|
|
|
|
|
AcsBoardHelper acsBoardHelper = AcsBoardHelper(
|
|
|
|
AcsBoardHelper acsBoardHelper = AcsBoardHelper(
|
|
|
|
objects::MGM_0_LIS3_HANDLER, objects::MGM_1_RM3100_HANDLER, objects::MGM_2_LIS3_HANDLER,
|
|
|
|
objects::MGM_0_LIS3_HANDLER, objects::MGM_1_RM3100_HANDLER, objects::MGM_2_LIS3_HANDLER,
|
|
|
|