diff --git a/archive/gpio/gpioDefinitions.h b/archive/gpio/gpioDefinitions.h index 0db4db11..46050d12 100644 --- a/archive/gpio/gpioDefinitions.h +++ b/archive/gpio/gpioDefinitions.h @@ -8,13 +8,13 @@ using gpioId_t = uint16_t; namespace gpio { -enum Levels { LOW = 0, HIGH = 1 }; +enum class Levels : uint8_t { LOW = 0, HIGH = 1 }; -enum Direction { IN = 0, OUT = 1 }; +enum class Direction : uint8_t { IN = 0, OUT = 1 }; -enum GpioOperation { READ, WRITE }; +enum class GpioOperation { READ, WRITE }; -enum GpioTypes { NONE, GPIOD_REGULAR, CALLBACK }; +enum class GpioTypes { NONE, GPIOD_REGULAR, CALLBACK }; static constexpr gpioId_t NO_GPIO = -1; } // namespace gpio diff --git a/bsp_linux_board/main.cpp b/bsp_linux_board/main.cpp index 4e286f5d..0ecb56d9 100644 --- a/bsp_linux_board/main.cpp +++ b/bsp_linux_board/main.cpp @@ -3,7 +3,7 @@ #include "InitMission.h" #include "OBSWConfig.h" #include "OBSWVersion.h" -#include "fsfw/FSFWVersion.h" +#include "fsfw/version.h" #include "fsfw/tasks/TaskFactory.h" #ifdef RASPBERRY_PI @@ -22,7 +22,7 @@ int main(void) { std::cout << "-- EIVE OBSW --" << std::endl; std::cout << "-- Compiled for Linux board " << BOARD_NAME << " --" << std::endl; std::cout << "-- OBSW " << SW_NAME << " v" << SW_VERSION << "." << SW_SUBVERSION << "." - << SW_REVISION << ", FSFW v" << FSFW_VERSION << "." << FSFW_SUBVERSION << FSFW_REVISION + << SW_REVISION << ", FSFW v" << fsfw::FSFW_VERSION << "--" << std::endl; std::cout << "-- " << __DATE__ << " " << __TIME__ << " --" << std::endl; diff --git a/bsp_q7s/core/InitMission.cpp b/bsp_q7s/core/InitMission.cpp index 70580333..04bc8d3d 100644 --- a/bsp_q7s/core/InitMission.cpp +++ b/bsp_q7s/core/InitMission.cpp @@ -116,14 +116,30 @@ void initmission::initTasks() { #endif /* OBSW_USE_CCSDS_IP_CORE == 1 */ #if OBSW_ADD_ACS_HANDLERS == 1 - PeriodicTaskIF* acsCtrl = factory->createPeriodicTask( - "ACS_CTRL", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc); - result = acsCtrl->addComponent(objects::GPS_CONTROLLER); + PeriodicTaskIF* acsTask = factory->createPeriodicTask( + "ACS_CTRL", 45, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc); + result = acsTask->addComponent(objects::GPS_CONTROLLER); if (result != HasReturnvaluesIF::RETURN_OK) { - initmission::printAddObjectError("ACS_CTRL", objects::GPS_CONTROLLER); + initmission::printAddObjectError("GPS_CTRL", objects::GPS_CONTROLLER); } + #endif /* OBSW_ADD_ACS_HANDLERS */ + PeriodicTaskIF* sysTask = factory->createPeriodicTask( + "SYS_TASK", 40, PeriodicTaskIF::MINIMUM_STACK_SIZE * 2, 0.4, missedDeadlineFunc); + result = sysTask->addComponent(objects::ACS_BOARD_ASS); + if (result != HasReturnvaluesIF::RETURN_OK) { + initmission::printAddObjectError("ACS_ASS", objects::ACS_BOARD_ASS); + } + result = sysTask->addComponent(objects::SUS_BOARD_ASS); + if (result != HasReturnvaluesIF::RETURN_OK) { + initmission::printAddObjectError("SUS_ASS", objects::SUS_BOARD_ASS); + } + result = sysTask->addComponent(objects::TCS_BOARD_ASS); + if (result != HasReturnvaluesIF::RETURN_OK) { + initmission::printAddObjectError("TCS_BOARD_ASS", objects::TCS_BOARD_ASS); + } + #if BOARD_TE0720 == 0 // FS task, task interval does not matter because it runs in permanent loop, priority low // because it is a non-essential background task @@ -218,8 +234,9 @@ void initmission::initTasks() { #endif #if OBSW_ADD_ACS_HANDLERS == 1 - acsCtrl->startTask(); + acsTask->startTask(); #endif + sysTask->startTask(); sif::info << "Tasks started.." << std::endl; } diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index 52288d6d..5dd1698e 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -1,10 +1,16 @@ #include "ObjectFactory.h" +#include #include #include #include #include #include +#include +#include +#include +#include +#include #include "OBSWConfig.h" #include "bsp_q7s/boardtest/Q7STestTask.h" @@ -84,6 +90,7 @@ #include "mission/devices/devicedefinitions/SusDefinitions.h" #include "mission/devices/devicedefinitions/SyrlinksDefinitions.h" #include "mission/devices/devicedefinitions/payloadPcduDefinitions.h" +#include "mission/system/AcsBoardAssembly.h" #include "mission/tmtc/CCSDSHandler.h" #include "mission/tmtc/VirtualChannel.h" #include "mission/utility/TmFunnel.h" @@ -125,18 +132,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); + createSunSensorComponents(gpioComIF, spiComIF, pwrSwitcher); #if OBSW_ADD_ACS_BOARD == 1 - createAcsBoardComponents(gpioComIF, uartComIF); + createAcsBoardComponents(gpioComIF, uartComIF, pwrSwitcher); #endif createHeaterComponents(); @@ -145,7 +153,7 @@ void ObjectFactory::produce(void* args) { #if OBSW_ADD_SYRLINKS == 1 createSyrlinksComponents(); #endif /* OBSW_ADD_SYRLINKS == 1 */ - createRtdComponents(gpioComIF); + createRtdComponents(gpioComIF, pwrSwitcher); #if OBSW_ADD_MGT == 1 I2cCookie* imtqI2cCookie = @@ -264,7 +272,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); @@ -279,7 +287,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 @@ -289,6 +297,9 @@ void ObjectFactory::createPcduComponents(LinuxLibgpioIF* gpioComIF) { pdu1handler->setModeNormal(); pdu2handler->setModeNormal(); acuhandler->setModeNormal(); + if (pwrSwitcher != nullptr) { + *pwrSwitcher = pcduHandler; + } } void ObjectFactory::createRadSensorComponent(LinuxLibgpioIF* gpioComIF) { @@ -310,13 +321,17 @@ void ObjectFactory::createRadSensorComponent(LinuxLibgpioIF* gpioComIF) { auto radSensor = new RadiationSensorHandler(objects::RAD_SENSOR, objects::SPI_COM_IF, spiCookieRadSensor, gpioComIF); static_cast(radSensor); -#if OBSW_TEST_RAD_SENSOR == 1 + // The radiation sensor ADC is powered by the 5V stack connector which should always be on radSensor->setStartUpImmediately(); + // It's a simple sensor, so just to to normal mode immediately radSensor->setToGoToNormalModeImmediately(); +#if OBSW_DEBUG_RAD_SENSOR == 1 + radSensor->enablePeriodicDataPrint(true); #endif } -void ObjectFactory::createSunSensorComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF) { +void ObjectFactory::createSunSensorComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF, + PowerSwitchIF* pwrSwitcher) { using namespace gpio; GpioCookie* gpioCookieSus = new GpioCookie(); GpioCallback* susgpio = nullptr; @@ -360,123 +375,118 @@ void ObjectFactory::createSunSensorComponents(LinuxLibgpioIF* gpioComIF, SpiComI gpioComIF->addGpios(gpioCookieSus); + SusFdir* fdir = nullptr; + std::array susHandlers = {}; #if OBSW_ADD_SUN_SENSORS == 1 SpiCookie* spiCookie = new SpiCookie(addresses::SUS_0, gpioIds::CS_SUS_0, q7s::SPI_DEFAULT_DEV, SUS::MAX_CMD_SIZE, - spi::DEFAULT_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); - SusHandler* susHandler0 = new SusHandler(objects::SUS_0, 0, objects::SPI_COM_IF, spiCookie); + spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); + susHandlers[0] = new SusHandler(objects::SUS_0, 0, objects::SPI_COM_IF, spiCookie); + fdir = new SusFdir(objects::SUS_0); + susHandlers[0]->setParent(objects::SUS_BOARD_ASS); + susHandlers[0]->setCustomFdir(fdir); - spiCookie = - new SpiCookie(addresses::SUS_1, gpioIds::CS_SUS_1, q7s::SPI_DEFAULT_DEV, SUS::MAX_CMD_SIZE, - spi::DEFAULT_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); - SusHandler* susHandler1 = new SusHandler(objects::SUS_1, 1, objects::SPI_COM_IF, spiCookie); + spiCookie = new SpiCookie(addresses::SUS_1, gpioIds::CS_SUS_1, q7s::SPI_DEFAULT_DEV, + SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); + susHandlers[1] = new SusHandler(objects::SUS_1, 1, objects::SPI_COM_IF, spiCookie); + fdir = new SusFdir(objects::SUS_1); + susHandlers[1]->setParent(objects::SUS_BOARD_ASS); + susHandlers[1]->setCustomFdir(fdir); - spiCookie = - new SpiCookie(addresses::SUS_2, gpioIds::CS_SUS_2, q7s::SPI_DEFAULT_DEV, SUS::MAX_CMD_SIZE, - spi::DEFAULT_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); - SusHandler* susHandler2 = new SusHandler(objects::SUS_2, 2, objects::SPI_COM_IF, spiCookie); + spiCookie = new SpiCookie(addresses::SUS_2, gpioIds::CS_SUS_2, q7s::SPI_DEFAULT_DEV, + SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); + susHandlers[2] = new SusHandler(objects::SUS_2, 2, objects::SPI_COM_IF, spiCookie); + fdir = new SusFdir(objects::SUS_2); + susHandlers[2]->setParent(objects::SUS_BOARD_ASS); + susHandlers[2]->setCustomFdir(fdir); - spiCookie = - new SpiCookie(addresses::SUS_3, gpioIds::CS_SUS_3, std::string(q7s::SPI_DEFAULT_DEV), - SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); - SusHandler* susHandler3 = new SusHandler(objects::SUS_3, 3, objects::SPI_COM_IF, spiCookie); + spiCookie = new SpiCookie(addresses::SUS_3, gpioIds::CS_SUS_3, std::string(q7s::SPI_DEFAULT_DEV), + SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); + susHandlers[3] = new SusHandler(objects::SUS_3, 3, objects::SPI_COM_IF, spiCookie); + fdir = new SusFdir(objects::SUS_3); + susHandlers[3]->setParent(objects::SUS_BOARD_ASS); + susHandlers[3]->setCustomFdir(fdir); - spiCookie = - new SpiCookie(addresses::SUS_4, gpioIds::CS_SUS_4, std::string(q7s::SPI_DEFAULT_DEV), - SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); - SusHandler* susHandler4 = new SusHandler(objects::SUS_4, 4, objects::SPI_COM_IF, spiCookie); + spiCookie = new SpiCookie(addresses::SUS_4, gpioIds::CS_SUS_4, std::string(q7s::SPI_DEFAULT_DEV), + SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); + susHandlers[4] = new SusHandler(objects::SUS_4, 4, objects::SPI_COM_IF, spiCookie); + fdir = new SusFdir(objects::SUS_4); + susHandlers[4]->setParent(objects::SUS_BOARD_ASS); + susHandlers[4]->setCustomFdir(fdir); - spiCookie = - new SpiCookie(addresses::SUS_5, gpioIds::CS_SUS_5, std::string(q7s::SPI_DEFAULT_DEV), - SUS::MAX_CMD_SIZE, spi::DEFAULT_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); - SusHandler* susHandler5 = new SusHandler(objects::SUS_5, 5, objects::SPI_COM_IF, spiCookie); + spiCookie = new SpiCookie(addresses::SUS_5, gpioIds::CS_SUS_5, std::string(q7s::SPI_DEFAULT_DEV), + SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); + susHandlers[5] = new SusHandler(objects::SUS_5, 5, objects::SPI_COM_IF, spiCookie); + fdir = new SusFdir(objects::SUS_5); + susHandlers[5]->setParent(objects::SUS_BOARD_ASS); + susHandlers[5]->setCustomFdir(fdir); - spiCookie = - new SpiCookie(addresses::SUS_6, gpioIds::CS_SUS_6, q7s::SPI_DEFAULT_DEV, SUS::MAX_CMD_SIZE, - spi::DEFAULT_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); - SusHandler* susHandler6 = new SusHandler(objects::SUS_6, 6, objects::SPI_COM_IF, spiCookie); + spiCookie = new SpiCookie(addresses::SUS_6, gpioIds::CS_SUS_6, q7s::SPI_DEFAULT_DEV, + SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); + susHandlers[6] = new SusHandler(objects::SUS_6, 6, objects::SPI_COM_IF, spiCookie); + fdir = new SusFdir(objects::SUS_6); + susHandlers[6]->setParent(objects::SUS_BOARD_ASS); + susHandlers[6]->setCustomFdir(fdir); - spiCookie = - new SpiCookie(addresses::SUS_7, gpioIds::CS_SUS_7, q7s::SPI_DEFAULT_DEV, SUS::MAX_CMD_SIZE, - spi::DEFAULT_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); - SusHandler* susHandler7 = new SusHandler(objects::SUS_7, 7, objects::SPI_COM_IF, spiCookie); + spiCookie = new SpiCookie(addresses::SUS_7, gpioIds::CS_SUS_7, q7s::SPI_DEFAULT_DEV, + SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); + susHandlers[7] = new SusHandler(objects::SUS_7, 7, objects::SPI_COM_IF, spiCookie); + fdir = new SusFdir(objects::SUS_7); + susHandlers[7]->setParent(objects::SUS_BOARD_ASS); + susHandlers[7]->setCustomFdir(fdir); - spiCookie = - new SpiCookie(addresses::SUS_8, gpioIds::CS_SUS_8, q7s::SPI_DEFAULT_DEV, SUS::MAX_CMD_SIZE, - spi::DEFAULT_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); - SusHandler* susHandler8 = new SusHandler(objects::SUS_8, 8, objects::SPI_COM_IF, spiCookie); + spiCookie = new SpiCookie(addresses::SUS_8, gpioIds::CS_SUS_8, q7s::SPI_DEFAULT_DEV, + SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); + susHandlers[8] = new SusHandler(objects::SUS_8, 8, objects::SPI_COM_IF, spiCookie); + fdir = new SusFdir(objects::SUS_8); + susHandlers[8]->setParent(objects::SUS_BOARD_ASS); + susHandlers[8]->setCustomFdir(fdir); - spiCookie = - new SpiCookie(addresses::SUS_9, gpioIds::CS_SUS_9, q7s::SPI_DEFAULT_DEV, SUS::MAX_CMD_SIZE, - spi::DEFAULT_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); - SusHandler* susHandler9 = new SusHandler(objects::SUS_9, 9, objects::SPI_COM_IF, spiCookie); + spiCookie = new SpiCookie(addresses::SUS_9, gpioIds::CS_SUS_9, q7s::SPI_DEFAULT_DEV, + SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); + susHandlers[9] = new SusHandler(objects::SUS_9, 9, objects::SPI_COM_IF, spiCookie); + fdir = new SusFdir(objects::SUS_9); + susHandlers[9]->setParent(objects::SUS_BOARD_ASS); + susHandlers[9]->setCustomFdir(fdir); - spiCookie = - new SpiCookie(addresses::SUS_10, gpioIds::CS_SUS_10, q7s::SPI_DEFAULT_DEV, SUS::MAX_CMD_SIZE, - spi::DEFAULT_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); - SusHandler* susHandler10 = new SusHandler(objects::SUS_10, 10, objects::SPI_COM_IF, spiCookie); + spiCookie = new SpiCookie(addresses::SUS_10, gpioIds::CS_SUS_10, q7s::SPI_DEFAULT_DEV, + SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); + susHandlers[10] = new SusHandler(objects::SUS_10, 10, objects::SPI_COM_IF, spiCookie); + fdir = new SusFdir(objects::SUS_10); + susHandlers[10]->setParent(objects::SUS_BOARD_ASS); + susHandlers[10]->setCustomFdir(fdir); - spiCookie = - new SpiCookie(addresses::SUS_11, gpioIds::CS_SUS_11, q7s::SPI_DEFAULT_DEV, SUS::MAX_CMD_SIZE, - spi::DEFAULT_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); - SusHandler* susHandler11 = new SusHandler(objects::SUS_11, 11, objects::SPI_COM_IF, spiCookie); - static_cast(susHandler0); - static_cast(susHandler1); - static_cast(susHandler2); - static_cast(susHandler3); - static_cast(susHandler4); - static_cast(susHandler5); - static_cast(susHandler6); - static_cast(susHandler7); - static_cast(susHandler8); - static_cast(susHandler9); - static_cast(susHandler10); - static_cast(susHandler11); + spiCookie = new SpiCookie(addresses::SUS_11, gpioIds::CS_SUS_11, q7s::SPI_DEFAULT_DEV, + SUS::MAX_CMD_SIZE, spi::SUS_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); + susHandlers[11] = new SusHandler(objects::SUS_11, 11, objects::SPI_COM_IF, spiCookie); + fdir = new SusFdir(objects::SUS_11); + susHandlers[11]->setParent(objects::SUS_BOARD_ASS); + susHandlers[11]->setCustomFdir(fdir); + + for (auto& sus : susHandlers) { + if (sus != nullptr) { #if OBSW_TEST_SUS == 1 - susHandler0->setStartUpImmediately(); - susHandler1->setStartUpImmediately(); - susHandler2->setStartUpImmediately(); - susHandler3->setStartUpImmediately(); - susHandler4->setStartUpImmediately(); - susHandler5->setStartUpImmediately(); - susHandler6->setStartUpImmediately(); - susHandler7->setStartUpImmediately(); - susHandler8->setStartUpImmediately(); - susHandler9->setStartUpImmediately(); - susHandler10->setStartUpImmediately(); - susHandler11->setStartUpImmediately(); - susHandler0->setToGoToNormalMode(true); - susHandler1->setToGoToNormalMode(true); - susHandler2->setToGoToNormalMode(true); - susHandler3->setToGoToNormalMode(true); - susHandler4->setToGoToNormalMode(true); - susHandler5->setToGoToNormalMode(true); - susHandler6->setToGoToNormalMode(true); - susHandler7->setToGoToNormalMode(true); - susHandler8->setToGoToNormalMode(true); - susHandler9->setToGoToNormalMode(true); - susHandler10->setToGoToNormalMode(true); - susHandler11->setToGoToNormalMode(true); + sus->setStartUpImmediately(); + sus->setToGoToNormalMode(true); +#endif #if OBSW_DEBUG_SUS == 1 - susHandler0->enablePeriodicPrintout(true, 3); - susHandler1->enablePeriodicPrintout(true, 3); - susHandler2->enablePeriodicPrintout(true, 3); - susHandler3->enablePeriodicPrintout(true, 3); - susHandler4->enablePeriodicPrintout(true, 3); - susHandler5->enablePeriodicPrintout(true, 3); - susHandler6->enablePeriodicPrintout(true, 3); - susHandler7->enablePeriodicPrintout(true, 3); - susHandler8->enablePeriodicPrintout(true, 3); - susHandler9->enablePeriodicPrintout(true, 3); - susHandler10->enablePeriodicPrintout(true, 3); - susHandler11->enablePeriodicPrintout(true, 3); + sus->enablePeriodicPrintout(true, 3); #endif -#endif - + } + } + std::array susIds = {objects::SUS_0, objects::SUS_1, objects::SUS_2, + objects::SUS_3, objects::SUS_4, objects::SUS_5, + objects::SUS_6, objects::SUS_7, objects::SUS_8, + objects::SUS_9, objects::SUS_10, objects::SUS_11}; + SusAssHelper susAssHelper = SusAssHelper(susIds); + auto susAss = + new SusAssembly(objects::SUS_BOARD_ASS, objects::NO_OBJECT, pwrSwitcher, susAssHelper); + static_cast(susAss); #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(); @@ -575,6 +585,8 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI Levels::LOW); gpioCookieAcsBoard->addGpio(gpioIds::GNSS_SELECT, gpio); gpioComIF->addGpios(gpioCookieAcsBoard); + AcsBoardFdir* fdir = nullptr; + static_cast(fdir); #if OBSW_ADD_ACS_HANDLERS == 1 std::string spiDev = q7s::SPI_DEFAULT_DEV; @@ -583,6 +595,8 @@ 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); + fdir = new AcsBoardFdir(objects::MGM_0_LIS3_HANDLER); + mgmLis3Handler->setCustomFdir(fdir); static_cast(mgmLis3Handler); #if OBSW_TEST_ACS == 1 mgmLis3Handler->setStartUpImmediately(); @@ -597,6 +611,9 @@ 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); + fdir = new AcsBoardFdir(objects::MGM_1_RM3100_HANDLER); + mgmRm3100Handler->setCustomFdir(fdir); + mgmRm3100Handler->setParent(objects::ACS_BOARD_ASS); static_cast(mgmRm3100Handler); #if OBSW_TEST_ACS == 1 mgmRm3100Handler->setStartUpImmediately(); @@ -611,6 +628,10 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI MGMLIS3MDL::MAX_BUFFER_SIZE, spi::DEFAULT_LIS3_MODE, spi::DEFAULT_LIS3_SPEED); mgmLis3Handler = new MgmLIS3MDLHandler(objects::MGM_2_LIS3_HANDLER, objects::SPI_COM_IF, spiCookie, spi::LIS3_TRANSITION_DELAY); + fdir = new AcsBoardFdir(objects::MGM_2_LIS3_HANDLER); + mgmLis3Handler->setCustomFdir(fdir); + mgmLis3Handler->setParent(objects::ACS_BOARD_ASS); + static_cast(mgmLis3Handler); #if OBSW_TEST_ACS == 1 mgmLis3Handler->setStartUpImmediately(); mgmLis3Handler->setToGoToNormalMode(true); @@ -618,12 +639,14 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI #if OBSW_DEBUG_ACS == 1 mgmLis3Handler->enablePeriodicPrintouts(true, 10); #endif - spiCookie = new SpiCookie(addresses::MGM_3_RM3100, gpioIds::MGM_3_RM3100_CS, spiDev, RM3100::MAX_BUFFER_SIZE, spi::DEFAULT_RM3100_MODE, spi::DEFAULT_RM3100_SPEED); mgmRm3100Handler = new MgmRM3100Handler(objects::MGM_3_RM3100_HANDLER, objects::SPI_COM_IF, spiCookie, spi::RM3100_TRANSITION_DELAY); + fdir = new AcsBoardFdir(objects::MGM_3_RM3100_HANDLER); + mgmRm3100Handler->setCustomFdir(fdir); + mgmRm3100Handler->setParent(objects::ACS_BOARD_ASS); #if OBSW_TEST_ACS == 1 mgmRm3100Handler->setStartUpImmediately(); mgmRm3100Handler->setToGoToNormalMode(true); @@ -639,6 +662,9 @@ 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); + fdir = new AcsBoardFdir(objects::GYRO_0_ADIS_HANDLER); + adisHandler->setCustomFdir(fdir); + adisHandler->setParent(objects::ACS_BOARD_ASS); static_cast(adisHandler); #if OBSW_TEST_ACS == 1 adisHandler->setStartUpImmediately(); @@ -654,6 +680,9 @@ 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); + fdir = new AcsBoardFdir(objects::GYRO_1_L3G_HANDLER); + gyroL3gHandler->setCustomFdir(fdir); + gyroL3gHandler->setParent(objects::ACS_BOARD_ASS); static_cast(gyroL3gHandler); #if OBSW_TEST_ACS == 1 gyroL3gHandler->setStartUpImmediately(); @@ -669,6 +698,9 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI spi::DEFAULT_ADIS16507_SPEED); adisHandler = new GyroADIS1650XHandler(objects::GYRO_2_ADIS_HANDLER, objects::SPI_COM_IF, spiCookie, ADIS1650X::Type::ADIS16505); + fdir = new AcsBoardFdir(objects::GYRO_2_ADIS_HANDLER); + adisHandler->setCustomFdir(fdir); + adisHandler->setParent(objects::ACS_BOARD_ASS); #if OBSW_TEST_ACS == 1 adisHandler->setStartUpImmediately(); adisHandler->setToGoToNormalModeImmediately(); @@ -679,12 +711,15 @@ void ObjectFactory::createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComI spi::DEFAULT_L3G_MODE, spi::DEFAULT_L3G_SPEED); gyroL3gHandler = new GyroHandlerL3GD20H(objects::GYRO_3_L3G_HANDLER, objects::SPI_COM_IF, spiCookie, spi::L3G_TRANSITION_DELAY); + fdir = new AcsBoardFdir(objects::GYRO_3_L3G_HANDLER); + gyroL3gHandler->setCustomFdir(fdir); + gyroL3gHandler->setParent(objects::ACS_BOARD_ASS); #if OBSW_TEST_ACS == 1 gyroL3gHandler->setStartUpImmediately(); gyroL3gHandler->setToGoToNormalMode(true); +#endif #if OBSW_DEBUG_ACS == 1 gyroL3gHandler->enablePeriodicPrintouts(true, 10); -#endif #endif bool debugGps = false; @@ -700,6 +735,23 @@ 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(acsAss); +#if OBSW_TEST_ACS_BOARD_ASS == 1 + CommandMessage msg; + ModeMessage::setModeMessage(&msg, ModeMessage::CMD_MODE_COMMAND, DeviceHandlerIF::MODE_NORMAL, + duallane::A_SIDE); + ReturnValue_t result = MessageQueueSenderIF::sendMessage(acsAss->getCommandQueue(), &msg); + if (result != HasReturnvaluesIF::RETURN_OK) { + sif::warning << "Sending mode command failed" << std::endl; + } +#endif #endif /* OBSW_ADD_ACS_HANDLERS == 1 */ } @@ -778,7 +830,7 @@ void ObjectFactory::createSyrlinksComponents() { new SyrlinksHkHandler(objects::SYRLINKS_HK_HANDLER, objects::UART_COM_IF, syrlinksUartCookie); } -void ObjectFactory::createRtdComponents(LinuxLibgpioIF* gpioComIF) { +void ObjectFactory::createRtdComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF* pwrSwitcher) { using namespace gpio; GpioCookie* rtdGpioCookie = new GpioCookie; @@ -833,142 +885,58 @@ void ObjectFactory::createRtdComponents(LinuxLibgpioIF* gpioComIF) { gpioComIF->addGpios(rtdGpioCookie); + static constexpr uint8_t NUMBER_RTDS = 16; #if OBSW_ADD_RTD_DEVICES == 1 - SpiCookie* spiRtdIc0 = - new SpiCookie(addresses::RTD_IC_3, gpioIds::RTD_IC_3, q7s::SPI_DEFAULT_DEV, - Max31865Definitions::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); - SpiCookie* spiRtdIc1 = - new SpiCookie(addresses::RTD_IC_4, gpioIds::RTD_IC_4, q7s::SPI_DEFAULT_DEV, - Max31865Definitions::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); - SpiCookie* spiRtdIc2 = - new SpiCookie(addresses::RTD_IC_5, gpioIds::RTD_IC_5, q7s::SPI_DEFAULT_DEV, - Max31865Definitions::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); - SpiCookie* spiRtdIc3 = - new SpiCookie(addresses::RTD_IC_6, gpioIds::RTD_IC_6, q7s::SPI_DEFAULT_DEV, - Max31865Definitions::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); - SpiCookie* spiRtdIc4 = - new SpiCookie(addresses::RTD_IC_7, gpioIds::RTD_IC_7, q7s::SPI_DEFAULT_DEV, - Max31865Definitions::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); - SpiCookie* spiRtdIc5 = - new SpiCookie(addresses::RTD_IC_8, gpioIds::RTD_IC_8, q7s::SPI_DEFAULT_DEV, - Max31865Definitions::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); - SpiCookie* spiRtdIc6 = - new SpiCookie(addresses::RTD_IC_9, gpioIds::RTD_IC_9, q7s::SPI_DEFAULT_DEV, - Max31865Definitions::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); - SpiCookie* spiRtdIc7 = - new SpiCookie(addresses::RTD_IC_10, gpioIds::RTD_IC_10, q7s::SPI_DEFAULT_DEV, - Max31865Definitions::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); - SpiCookie* spiRtdIc8 = - new SpiCookie(addresses::RTD_IC_11, gpioIds::RTD_IC_11, q7s::SPI_DEFAULT_DEV, - Max31865Definitions::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); - SpiCookie* spiRtdIc9 = - new SpiCookie(addresses::RTD_IC_12, gpioIds::RTD_IC_12, q7s::SPI_DEFAULT_DEV, - Max31865Definitions::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); - SpiCookie* spiRtdIc10 = - new SpiCookie(addresses::RTD_IC_13, gpioIds::RTD_IC_13, q7s::SPI_DEFAULT_DEV, - Max31865Definitions::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); - SpiCookie* spiRtdIc11 = - new SpiCookie(addresses::RTD_IC_14, gpioIds::RTD_IC_14, q7s::SPI_DEFAULT_DEV, - Max31865Definitions::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); - SpiCookie* spiRtdIc12 = - new SpiCookie(addresses::RTD_IC_15, gpioIds::RTD_IC_15, q7s::SPI_DEFAULT_DEV, - Max31865Definitions::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); - SpiCookie* spiRtdIc13 = - new SpiCookie(addresses::RTD_IC_16, gpioIds::RTD_IC_16, std::string(q7s::SPI_DEFAULT_DEV), - Max31865Definitions::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); - SpiCookie* spiRtdIc14 = - new SpiCookie(addresses::RTD_IC_17, gpioIds::RTD_IC_17, q7s::SPI_DEFAULT_DEV, - Max31865Definitions::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); - SpiCookie* spiRtdIc15 = - new SpiCookie(addresses::RTD_IC_18, gpioIds::RTD_IC_18, q7s::SPI_DEFAULT_DEV, - Max31865Definitions::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); - - Max31865PT1000Handler* rtdIc0 = - new Max31865PT1000Handler(objects::RTD_IC_3, objects::SPI_COM_IF, spiRtdIc0); - Max31865PT1000Handler* rtdIc1 = - new Max31865PT1000Handler(objects::RTD_IC_4, objects::SPI_COM_IF, spiRtdIc1); - Max31865PT1000Handler* rtdIc2 = - new Max31865PT1000Handler(objects::RTD_IC_5, objects::SPI_COM_IF, spiRtdIc2); - Max31865PT1000Handler* rtdIc3 = - new Max31865PT1000Handler(objects::RTD_IC_6, objects::SPI_COM_IF, spiRtdIc3); - Max31865PT1000Handler* rtdIc4 = - new Max31865PT1000Handler(objects::RTD_IC_7, objects::SPI_COM_IF, spiRtdIc4); - Max31865PT1000Handler* rtdIc5 = - new Max31865PT1000Handler(objects::RTD_IC_8, objects::SPI_COM_IF, spiRtdIc5); - Max31865PT1000Handler* rtdIc6 = - new Max31865PT1000Handler(objects::RTD_IC_9, objects::SPI_COM_IF, spiRtdIc6); - Max31865PT1000Handler* rtdIc7 = - new Max31865PT1000Handler(objects::RTD_IC_10, objects::SPI_COM_IF, spiRtdIc7); - Max31865PT1000Handler* rtdIc8 = - new Max31865PT1000Handler(objects::RTD_IC_11, objects::SPI_COM_IF, spiRtdIc8); - Max31865PT1000Handler* rtdIc9 = - new Max31865PT1000Handler(objects::RTD_IC_12, objects::SPI_COM_IF, spiRtdIc9); - Max31865PT1000Handler* rtdIc10 = - new Max31865PT1000Handler(objects::RTD_IC_13, objects::SPI_COM_IF, spiRtdIc10); - Max31865PT1000Handler* rtdIc11 = - new Max31865PT1000Handler(objects::RTD_IC_14, objects::SPI_COM_IF, spiRtdIc11); - Max31865PT1000Handler* rtdIc12 = - new Max31865PT1000Handler(objects::RTD_IC_15, objects::SPI_COM_IF, spiRtdIc12); - Max31865PT1000Handler* rtdIc13 = - new Max31865PT1000Handler(objects::RTD_IC_16, objects::SPI_COM_IF, spiRtdIc13); - Max31865PT1000Handler* rtdIc14 = - new Max31865PT1000Handler(objects::RTD_IC_17, objects::SPI_COM_IF, spiRtdIc14); - Max31865PT1000Handler* rtdIc15 = - new Max31865PT1000Handler(objects::RTD_IC_18, objects::SPI_COM_IF, spiRtdIc15); + std::array, NUMBER_RTDS> cookieArgs = {{ + {addresses::RTD_IC_3, gpioIds::RTD_IC_3}, + {addresses::RTD_IC_4, gpioIds::RTD_IC_4}, + {addresses::RTD_IC_5, gpioIds::RTD_IC_5}, + {addresses::RTD_IC_6, gpioIds::RTD_IC_6}, + {addresses::RTD_IC_7, gpioIds::RTD_IC_7}, + {addresses::RTD_IC_8, gpioIds::RTD_IC_8}, + {addresses::RTD_IC_9, gpioIds::RTD_IC_9}, + {addresses::RTD_IC_10, gpioIds::RTD_IC_10}, + {addresses::RTD_IC_11, gpioIds::RTD_IC_11}, + {addresses::RTD_IC_12, gpioIds::RTD_IC_12}, + {addresses::RTD_IC_13, gpioIds::RTD_IC_13}, + {addresses::RTD_IC_14, gpioIds::RTD_IC_14}, + {addresses::RTD_IC_15, gpioIds::RTD_IC_15}, + {addresses::RTD_IC_16, gpioIds::RTD_IC_16}, + {addresses::RTD_IC_17, gpioIds::RTD_IC_17}, + {addresses::RTD_IC_18, gpioIds::RTD_IC_18}, + }}; + std::array rtdIds = { + objects::RTD_IC_3, objects::RTD_IC_4, objects::RTD_IC_5, objects::RTD_IC_6, + objects::RTD_IC_7, objects::RTD_IC_8, objects::RTD_IC_9, objects::RTD_IC_10, + objects::RTD_IC_11, objects::RTD_IC_12, objects::RTD_IC_13, objects::RTD_IC_14, + objects::RTD_IC_15, objects::RTD_IC_16, objects::RTD_IC_17, objects::RTD_IC_18}; + std::array rtdCookies = {}; + std::array rtds = {}; + RtdFdir* rtdFdir = nullptr; + for (uint8_t idx = 0; idx < NUMBER_RTDS; idx++) { + rtdCookies[idx] = + new SpiCookie(cookieArgs[idx].first, cookieArgs[idx].second, q7s::SPI_DEFAULT_DEV, + Max31865Definitions::MAX_REPLY_SIZE, spi::RTD_MODE, spi::RTD_SPEED); + rtds[idx] = new Max31865PT1000Handler(rtdIds[idx], objects::SPI_COM_IF, rtdCookies[idx]); + rtds[idx]->setParent(objects::TCS_BOARD_ASS); + rtdFdir = new RtdFdir(rtdIds[idx]); + rtds[idx]->setCustomFdir(rtdFdir); + } #if OBSW_TEST_RTD == 1 - rtdIc0->setStartUpImmediately(); - rtdIc1->setStartUpImmediately(); - rtdIc2->setStartUpImmediately(); - rtdIc3->setStartUpImmediately(); - rtdIc4->setStartUpImmediately(); - rtdIc5->setStartUpImmediately(); - rtdIc6->setStartUpImmediately(); - rtdIc7->setStartUpImmediately(); - rtdIc8->setStartUpImmediately(); - rtdIc9->setStartUpImmediately(); - rtdIc10->setStartUpImmediately(); - rtdIc11->setStartUpImmediately(); - rtdIc12->setStartUpImmediately(); - rtdIc13->setStartUpImmediately(); - rtdIc14->setStartUpImmediately(); - rtdIc15->setStartUpImmediately(); - - rtdIc0->setInstantNormal(true); - rtdIc1->setInstantNormal(true); - rtdIc2->setInstantNormal(true); - rtdIc3->setInstantNormal(true); - rtdIc4->setInstantNormal(true); - rtdIc5->setInstantNormal(true); - rtdIc6->setInstantNormal(true); - rtdIc7->setInstantNormal(true); - rtdIc8->setInstantNormal(true); - rtdIc9->setInstantNormal(true); - rtdIc10->setInstantNormal(true); - rtdIc11->setInstantNormal(true); - rtdIc12->setInstantNormal(true); - rtdIc13->setInstantNormal(true); - rtdIc14->setInstantNormal(true); - rtdIc15->setInstantNormal(true); -#endif - - static_cast(rtdIc0); - static_cast(rtdIc1); - static_cast(rtdIc2); - static_cast(rtdIc3); - static_cast(rtdIc4); - static_cast(rtdIc5); - static_cast(rtdIc6); - static_cast(rtdIc7); - static_cast(rtdIc8); - static_cast(rtdIc9); - static_cast(rtdIc10); - static_cast(rtdIc11); - static_cast(rtdIc12); - static_cast(rtdIc13); - static_cast(rtdIc14); - static_cast(rtdIc15); -#endif + for (auto& rtd : rtds) { + if (rtd != nullptr) { + rtd->setStartUpImmediately(); + rtd->setInstantNormal(true); + } + } +#endif // OBSW_TEST_RTD == 1 + TcsBoardHelper helper(rtdIds); + TcsBoardAssembly* tcsBoardAss = + new TcsBoardAssembly(objects::TCS_BOARD_ASS, objects::NO_OBJECT, pwrSwitcher, + pcduSwitches::Switches::PDU1_CH0_TCS_BOARD_3V3, helper); + static_cast(tcsBoardAss); +#endif // OBSW_ADD_RTD_DEVICES == 1 } void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF) { @@ -1224,11 +1192,11 @@ void ObjectFactory::createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* // static_cast(plPcduHandler); #if OBSW_TEST_PL_PCDU == 1 plPcduHandler->setStartUpImmediately(); +#endif #if OBSW_DEBUG_PL_PCDU == 1 plPcduHandler->setToGoToNormalModeImmediately(true); plPcduHandler->enablePeriodicPrintout(true, 10); #endif -#endif } void ObjectFactory::createTestComponents(LinuxLibgpioIF* gpioComIF) { diff --git a/bsp_q7s/core/ObjectFactory.h b/bsp_q7s/core/ObjectFactory.h index ecc92f01..ff88db8e 100644 --- a/bsp_q7s/core/ObjectFactory.h +++ b/bsp_q7s/core/ObjectFactory.h @@ -5,6 +5,7 @@ class LinuxLibgpioIF; class UartComIF; class SpiComIF; class I2cComIF; +class PowerSwitchIF; namespace ObjectFactory { @@ -13,17 +14,18 @@ void produce(void* args); void createCommunicationInterfaces(LinuxLibgpioIF** gpioComIF, UartComIF** uartComIF, SpiComIF** spiComIF, I2cComIF** i2cComIF); - +void createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF** pwrSwitcher); void createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF); void createTmpComponents(); -void createPcduComponents(LinuxLibgpioIF* gpioComIF); void createRadSensorComponent(LinuxLibgpioIF* gpioComIF); -void createSunSensorComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF); -void createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF); +void createSunSensorComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF, + PowerSwitchIF* pwrSwitcher); +void createAcsBoardComponents(LinuxLibgpioIF* gpioComIF, UartComIF* uartComIF, + PowerSwitchIF* pwrSwitcher); void createHeaterComponents(); void createSolarArrayDeploymentComponents(); void createSyrlinksComponents(); -void createRtdComponents(LinuxLibgpioIF* gpioComIF); +void createRtdComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF* pwrSwitcher); void createReactionWheelComponents(LinuxLibgpioIF* gpioComIF); void createCcsdsComponents(LinuxLibgpioIF* gpioComIF); void createTestComponents(LinuxLibgpioIF* gpioComIF); diff --git a/common/config/commonObjects.h b/common/config/commonObjects.h index 579947b4..a4f3319e 100644 --- a/common/config/commonObjects.h +++ b/common/config/commonObjects.h @@ -93,6 +93,11 @@ enum commonObjects: uint32_t { PLOC_MPSOC_HELPER = 0x44330003, AXI_PTME_CONFIG = 44330004, PTME_CONFIG = 44330005, + + // 0x73 ('s') for assemblies and system/subsystem components + ACS_BOARD_ASS = 0x73000001, + SUS_BOARD_ASS = 0x73000002, + TCS_BOARD_ASS = 0x73000003 }; } diff --git a/common/config/commonSubsystemIds.h b/common/config/commonSubsystemIds.h index e3b22759..24d6298f 100644 --- a/common/config/commonSubsystemIds.h +++ b/common/config/commonSubsystemIds.h @@ -21,6 +21,9 @@ enum: uint8_t { STR_HELPER = 120, PLOC_MPSOC_HELPER = 121, PL_PCDU_HANDLER = 121, + ACS_BOARD_ASS = 122, + SUS_BOARD_ASS = 123, + TCS_BOARD_ASS = 124, COMMON_SUBSYSTEM_ID_END }; } diff --git a/common/config/devConf.h b/common/config/devConf.h index d779e7bb..7e09b50f 100644 --- a/common/config/devConf.h +++ b/common/config/devConf.h @@ -28,6 +28,7 @@ static constexpr spi::SpiModes DEFAULT_L3G_MODE = spi::SpiModes::MODE_3; * the decoder and buffer circuits. Thus frequency is here defined to 1 MHz. */ static const uint32_t SUS_MAX1227_SPI_FREQ = 976'000; +static constexpr spi::SpiModes SUS_MAX_1227_MODE = spi::SpiModes::MODE_3; static constexpr uint32_t DEFAULT_MAX_1227_SPEED = 976'000; static constexpr spi::SpiModes DEFAULT_MAX_1227_MODE = spi::SpiModes::MODE_3; diff --git a/fsfw b/fsfw index bac8b408..79615e47 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit bac8b4088009a71afbb0225e634dabcbff0d9ec1 +Subproject commit 79615e47e427a42435ca0c25ded27418850d5022 diff --git a/generators/.gitignore b/generators/.gitignore index 181d655f..889fd273 100644 --- a/generators/.gitignore +++ b/generators/.gitignore @@ -1 +1,2 @@ .~lock* +/venv diff --git a/generators/.run/events.run.xml b/generators/.run/events.run.xml index 18f71033..6bc73c96 100644 --- a/generators/.run/events.run.xml +++ b/generators/.run/events.run.xml @@ -12,7 +12,7 @@