|
|
|
@ -83,6 +83,7 @@
|
|
|
|
|
#include "mission/devices/devicedefinitions/RwDefinitions.h"
|
|
|
|
|
#include "mission/devices/devicedefinitions/SusDefinitions.h"
|
|
|
|
|
#include "mission/devices/devicedefinitions/SyrlinksDefinitions.h"
|
|
|
|
|
#include "mission/system/AcsBoardAssembly.h"
|
|
|
|
|
#include "mission/tmtc/CCSDSHandler.h"
|
|
|
|
|
#include "mission/tmtc/VirtualChannel.h"
|
|
|
|
|
#include "mission/utility/TmFunnel.h"
|
|
|
|
@ -124,18 +125,19 @@ void ObjectFactory::produce(void* args) {
|
|
|
|
|
UartComIF* uartComIF = nullptr;
|
|
|
|
|
SpiComIF* spiComIF = nullptr;
|
|
|
|
|
I2cComIF* i2cComIF = nullptr;
|
|
|
|
|
PowerSwitchIF* pwrSwitcher = nullptr;
|
|
|
|
|
createCommunicationInterfaces(&gpioComIF, &uartComIF, &spiComIF, &i2cComIF);
|
|
|
|
|
createTmpComponents();
|
|
|
|
|
#if BOARD_TE0720 == 0
|
|
|
|
|
new CoreController(objects::CORE_CONTROLLER);
|
|
|
|
|
|
|
|
|
|
gpioCallbacks::disableAllDecoder();
|
|
|
|
|
createPcduComponents(gpioComIF);
|
|
|
|
|
createPcduComponents(gpioComIF, &pwrSwitcher);
|
|
|
|
|
createRadSensorComponent(gpioComIF);
|
|
|
|
|
createSunSensorComponents(gpioComIF, spiComIF);
|
|
|
|
|
|
|
|
|
|
#if OBSW_ADD_ACS_BOARD == 1
|
|
|
|
|
createAcsBoardComponents(gpioComIF, uartComIF);
|
|
|
|
|
createAcsBoardComponents(gpioComIF, uartComIF, pwrSwitcher);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
createHeaterComponents();
|
|
|
|
@ -260,7 +262,7 @@ void ObjectFactory::createCommunicationInterfaces(LinuxLibgpioIF** gpioComIF, Ua
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ObjectFactory::createPcduComponents(LinuxLibgpioIF* gpioComIF) {
|
|
|
|
|
void ObjectFactory::createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF** pwrSwitcher) {
|
|
|
|
|
CspCookie* p60DockCspCookie = new CspCookie(P60Dock::MAX_REPLY_LENGTH, addresses::P60DOCK);
|
|
|
|
|
CspCookie* pdu1CspCookie = new CspCookie(PDU::MAX_REPLY_LENGTH, addresses::PDU1);
|
|
|
|
|
CspCookie* pdu2CspCookie = new CspCookie(PDU::MAX_REPLY_LENGTH, addresses::PDU2);
|
|
|
|
@ -275,7 +277,7 @@ void ObjectFactory::createPcduComponents(LinuxLibgpioIF* gpioComIF) {
|
|
|
|
|
new PDU2Handler(objects::PDU2_HANDLER, objects::CSP_COM_IF, pdu2CspCookie);
|
|
|
|
|
pdu2handler->assignChannelHookFunction(&pcdu::switchCallback, gpioComIF);
|
|
|
|
|
ACUHandler* acuhandler = new ACUHandler(objects::ACU_HANDLER, objects::CSP_COM_IF, acuCspCookie);
|
|
|
|
|
new PCDUHandler(objects::PCDU_HANDLER, 50);
|
|
|
|
|
auto pcduHandler = new PCDUHandler(objects::PCDU_HANDLER, 50);
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Setting PCDU devices to mode normal immediately after start up because PCDU is always
|
|
|
|
@ -285,6 +287,9 @@ void ObjectFactory::createPcduComponents(LinuxLibgpioIF* gpioComIF) {
|
|
|
|
|
pdu1handler->setModeNormal();
|
|
|
|
|
pdu2handler->setModeNormal();
|
|
|
|
|
acuhandler->setModeNormal();
|
|
|
|
|
if (pwrSwitcher != nullptr) {
|
|
|
|
|
*pwrSwitcher = pcduHandler;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ObjectFactory::createRadSensorComponent(LinuxLibgpioIF* gpioComIF) {
|
|
|
|
@ -473,7 +478,8 @@ void ObjectFactory::createSunSensorComponents(LinuxLibgpioIF* gpioComIF, SpiComI
|
|
|
|
|
#endif /* OBSW_ADD_SUN_SENSORS == 1 */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF) {
|
|
|
|
|
void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF,
|
|
|
|
|
PowerSwitchIF* pwrSwitcher) {
|
|
|
|
|
using namespace gpio;
|
|
|
|
|
GpioCookie* gpioCookieAcsBoard = new GpioCookie();
|
|
|
|
|
|
|
|
|
@ -580,6 +586,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
|
|
|
|
MGMLIS3MDL::MAX_BUFFER_SIZE, spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED);
|
|
|
|
|
auto mgmLis3Handler = new MgmLIS3MDLHandler(objects::MGM_0_LIS3_HANDLER, objects::SPI_COM_IF,
|
|
|
|
|
spiCookie, spi::LIS3_TRANSITION_DELAY);
|
|
|
|
|
static_cast<void>(mgmLis3Handler);
|
|
|
|
|
#if OBSW_TEST_ACS == 1
|
|
|
|
|
mgmLis3Handler->setStartUpImmediately();
|
|
|
|
|
mgmLis3Handler->setToGoToNormalMode(true);
|
|
|
|
@ -593,6 +600,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
|
|
|
|
RM3100::MAX_BUFFER_SIZE, spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED);
|
|
|
|
|
auto mgmRm3100Handler = new MgmRM3100Handler(objects::MGM_1_RM3100_HANDLER, objects::SPI_COM_IF,
|
|
|
|
|
spiCookie, spi::RM3100_TRANSITION_DELAY);
|
|
|
|
|
static_cast<void>(mgmRm3100Handler);
|
|
|
|
|
#if OBSW_TEST_ACS == 1
|
|
|
|
|
mgmRm3100Handler->setStartUpImmediately();
|
|
|
|
|
mgmRm3100Handler->setToGoToNormalMode(true);
|
|
|
|
@ -604,13 +612,14 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
|
|
|
|
spiCookie =
|
|
|
|
|
new SpiCookie(addresses::MGM_2_LIS3, gpioIds::MGM_2_LIS3_CS, spiDev,
|
|
|
|
|
MGMLIS3MDL::MAX_BUFFER_SIZE, spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED);
|
|
|
|
|
auto mgmLis3Handler2 = new MgmLIS3MDLHandler(objects::MGM_2_LIS3_HANDLER, objects::SPI_COM_IF,
|
|
|
|
|
mgmLis3Handler = new MgmLIS3MDLHandler(objects::MGM_2_LIS3_HANDLER, objects::SPI_COM_IF,
|
|
|
|
|
spiCookie, spi::LIS3_TRANSITION_DELAY);
|
|
|
|
|
static_cast<void>(mgmLis3Handler);
|
|
|
|
|
#if OBSW_TEST_ACS == 1
|
|
|
|
|
mgmLis3Handler2->setStartUpImmediately();
|
|
|
|
|
mgmLis3Handler2->setToGoToNormalMode(true);
|
|
|
|
|
mgmLis3Handler->setStartUpImmediately();
|
|
|
|
|
mgmLis3Handler->setToGoToNormalMode(true);
|
|
|
|
|
#if OBSW_DEBUG_ACS == 1
|
|
|
|
|
mgmLis3Handler2->enablePeriodicPrintouts(true, 10);
|
|
|
|
|
mgmLis3Handler->enablePeriodicPrintouts(true, 10);
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
@ -634,6 +643,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
|
|
|
|
spi::DEFAULT_ADIS16507_SPEED);
|
|
|
|
|
auto adisHandler = new GyroADIS1650XHandler(objects::GYRO_0_ADIS_HANDLER, objects::SPI_COM_IF,
|
|
|
|
|
spiCookie, ADIS1650X::Type::ADIS16505);
|
|
|
|
|
static_cast<void>(adisHandler);
|
|
|
|
|
#if OBSW_TEST_ACS == 1
|
|
|
|
|
adisHandler->setStartUpImmediately();
|
|
|
|
|
adisHandler->setToGoToNormalModeImmediately();
|
|
|
|
@ -648,6 +658,7 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
|
|
|
|
spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED);
|
|
|
|
|
auto gyroL3gHandler = new GyroHandlerL3GD20H(objects::GYRO_1_L3G_HANDLER, objects::SPI_COM_IF,
|
|
|
|
|
spiCookie, spi::L3G_TRANSITION_DELAY);
|
|
|
|
|
static_cast<void>(gyroL3gHandler);
|
|
|
|
|
#if OBSW_TEST_ACS == 1
|
|
|
|
|
gyroL3gHandler->setStartUpImmediately();
|
|
|
|
|
gyroL3gHandler->setToGoToNormalMode(true);
|
|
|
|
@ -692,6 +703,14 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI
|
|
|
|
|
auto gpsHandler0 =
|
|
|
|
|
new GPSHyperionLinuxController(objects::GPS_CONTROLLER, objects::NO_OBJECT, debugGps);
|
|
|
|
|
gpsHandler0->setResetPinTriggerFunction(gps::triggerGpioResetPin, &resetArgsGnss0);
|
|
|
|
|
|
|
|
|
|
AcsBoardHelper acsBoardHelper = AcsBoardHelper(
|
|
|
|
|
objects::MGM_0_LIS3_HANDLER, objects::MGM_1_RM3100_HANDLER, objects::MGM_2_LIS3_HANDLER,
|
|
|
|
|
objects::MGM_3_RM3100_HANDLER, objects::GYRO_0_ADIS_HANDLER, objects::GYRO_1_L3G_HANDLER,
|
|
|
|
|
objects::GYRO_2_ADIS_HANDLER, objects::GYRO_3_L3G_HANDLER, objects::GPS_CONTROLLER);
|
|
|
|
|
auto acsAss = new AcsBoardAssembly(objects::ACS_BOARD_ASS, objects::NO_OBJECT, pwrSwitcher,
|
|
|
|
|
acsBoardHelper, gpioComIF);
|
|
|
|
|
static_cast<void>(acsAss);
|
|
|
|
|
#endif /* OBSW_ADD_ACS_HANDLERS == 1 */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|