diff --git a/automation/Jenkinsfile b/automation/Jenkinsfile index 300a7749..fe79dc73 100644 --- a/automation/Jenkinsfile +++ b/automation/Jenkinsfile @@ -20,7 +20,7 @@ pipeline { steps { dir(BUILDDIR_Q7) { sh 'cmake -DTGT_BSP="arm/q7s" -DCMAKE_BUILD_TYPE=Debug ..' - sh 'cmake --build . -j' + sh 'cmake --build . -j4' } } } @@ -28,7 +28,7 @@ pipeline { steps { dir(BUILDDIR_LINUX) { sh 'cmake ..' - sh 'cmake --build . -t eive-unittest -j' + sh 'cmake --build . -t eive-unittest -j4' sh './eive-unittest' } } diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index bcef64b9..cdf95aa2 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -29,8 +29,13 @@ #include "linux/boardtest/UartTestClass.h" #include "linux/csp/CspComIF.h" #include "linux/csp/CspCookie.h" +#include "linux/devices/GPSHyperionLinuxController.h" +#include "linux/devices/devicedefinitions/StarTrackerDefinitions.h" +#include "linux/devices/startracker/StarTrackerHandler.h" +#include "linux/devices/startracker/StrHelper.h" #include "tmtc/apid.h" #include "tmtc/pusIds.h" + #if OBSW_TEST_LIBGPIOD == 1 #include "linux/boardtest/LibgpiodTest.h" #endif @@ -52,13 +57,6 @@ #include "fsfw_hal/linux/spi/SpiCookie.h" #include "fsfw_hal/linux/uart/UartComIF.h" #include "fsfw_hal/linux/uart/UartCookie.h" -#include "linux/boardtest/SpiTestClass.h" -#include "linux/csp/CspComIF.h" -#include "linux/csp/CspCookie.h" -#include "linux/devices/GPSHyperionLinuxController.h" -#include "linux/devices/devicedefinitions/StarTrackerDefinitions.h" -#include "linux/devices/startracker/StarTrackerHandler.h" -#include "linux/devices/startracker/StrHelper.h" #include "mission/core/GenericFactory.h" #include "mission/devices/ACUHandler.h" #include "mission/devices/BpxBatteryHandler.h" @@ -70,6 +68,7 @@ #include "mission/devices/PCDUHandler.h" #include "mission/devices/PDU1Handler.h" #include "mission/devices/PDU2Handler.h" +#include "mission/devices/PayloadPcduHandler.h" #include "mission/devices/PlocMPSoCHandler.h" #include "mission/devices/RadiationSensorHandler.h" #include "mission/devices/RwHandler.h" @@ -85,6 +84,7 @@ #include "mission/devices/devicedefinitions/SusDefinitions.h" #include "mission/devices/devicedefinitions/SyrlinksDefinitions.h" #include "mission/system/AcsBoardAssembly.h" +#include "mission/devices/devicedefinitions/payloadPcduDefinitions.h" #include "mission/tmtc/CCSDSHandler.h" #include "mission/tmtc/VirtualChannel.h" #include "mission/utility/TmFunnel.h" @@ -396,8 +396,7 @@ void ObjectFactory::createSunSensorComponents(LinuxLibgpioIF* gpioComIF, SpiComI 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, - gpioComIF, gpioIds::CS_SUS_6); + SusHandler* susHandler6 = new SusHandler(objects::SUS_6, 6, objects::SPI_COM_IF, spiCookie); spiCookie = new SpiCookie(addresses::SUS_7, gpioIds::CS_SUS_7, q7s::SPI_DEFAULT_DEV, SUS::MAX_CMD_SIZE, @@ -1207,15 +1206,6 @@ void ObjectFactory::createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* gpio = new GpiodRegularByLineName(q7s::gpioNames::PL_PCDU_ENABLE_DRO, consumer, Direction::OUT, gpio::Levels::LOW); plPcduGpios->addGpio(gpioIds::PLPCDU_ENB_DRO, gpio); - consumer = "PLPCDU_ENB_HPA"; - gpio = new GpiodRegularByLineName(q7s::gpioNames::PL_PCDU_ENABLE_HPA, consumer, Direction::OUT, - gpio::Levels::LOW); - plPcduGpios->addGpio(gpioIds::PLPCDU_ENB_HPA, gpio); - consumer = "PLPCDU_ENB_MPA"; - gpio = new GpiodRegularByLineName(q7s::gpioNames::PL_PCDU_ENABLE_MPA, consumer, Direction::OUT, - gpio::Levels::LOW); - plPcduGpios->addGpio(gpioIds::PLPCDU_ENB_MPA, gpio); - consumer = "PLPCDU_ENB_X8"; gpio = new GpiodRegularByLineName(q7s::gpioNames::PL_PCDU_ENABLE_X8, consumer, Direction::OUT, gpio::Levels::LOW); @@ -1224,6 +1214,14 @@ void ObjectFactory::createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* gpio = new GpiodRegularByLineName(q7s::gpioNames::PL_PCDU_ENABLE_TX, consumer, Direction::OUT, gpio::Levels::LOW); plPcduGpios->addGpio(gpioIds::PLPCDU_ENB_TX, gpio); + consumer = "PLPCDU_ENB_MPA"; + gpio = new GpiodRegularByLineName(q7s::gpioNames::PL_PCDU_ENABLE_MPA, consumer, Direction::OUT, + gpio::Levels::LOW); + plPcduGpios->addGpio(gpioIds::PLPCDU_ENB_MPA, gpio); + consumer = "PLPCDU_ENB_HPA"; + gpio = new GpiodRegularByLineName(q7s::gpioNames::PL_PCDU_ENABLE_HPA, consumer, Direction::OUT, + gpio::Levels::LOW); + plPcduGpios->addGpio(gpioIds::PLPCDU_ENB_HPA, gpio); // Chip select pin is active low consumer = "PLPCDU_ADC_CS"; @@ -1231,6 +1229,22 @@ void ObjectFactory::createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* gpio::Levels::HIGH); plPcduGpios->addGpio(gpioIds::PLPCDU_ADC_CS, gpio); gpioComIF->addGpios(plPcduGpios); + SpiCookie* spiCookie = new SpiCookie(addresses::PLPCDU_ADC, gpioIds::PLPCDU_ADC_CS, + q7s::SPI_DEFAULT_DEV, plpcdu::MAX_ADC_REPLY_SIZE, + spi::DEFAULT_MAX_1227_MODE, spi::PL_PCDU_MAX_1227_SPEED); + // Create device handler components + auto plPcduHandler = + new PayloadPcduHandler(objects::PLPCDU_HANDLER, objects::SPI_COM_IF, spiCookie, gpioComIF, + SdCardManager::instance(), false); + spiCookie->setCallbackMode(PayloadPcduHandler::extConvAsTwoCallback, plPcduHandler); + static_cast(plPcduHandler); +#if OBSW_TEST_PL_PCDU == 1 + plPcduHandler->setStartUpImmediately(); +#if OBSW_DEBUG_PL_PCDU == 1 + plPcduHandler->setToGoToNormalModeImmediately(true); + plPcduHandler->enablePeriodicPrintout(true, 5); +#endif +#endif } void ObjectFactory::createTestComponents(LinuxLibgpioIF* gpioComIF) { diff --git a/common/config/devConf.h b/common/config/devConf.h index ae730e46..8a35a0fa 100644 --- a/common/config/devConf.h +++ b/common/config/devConf.h @@ -32,6 +32,8 @@ static const uint32_t SUS_MAX1227_SPI_FREQ = 976'000; static constexpr uint32_t DEFAULT_MAX_1227_SPEED = 976'000; static constexpr spi::SpiModes DEFAULT_MAX_1227_MODE = spi::SpiModes::MODE_3; +static constexpr uint32_t PL_PCDU_MAX_1227_SPEED = 976'000; + static constexpr uint32_t DEFAULT_ADIS16507_SPEED = 976'000; static constexpr spi::SpiModes DEFAULT_ADIS16507_MODE = spi::SpiModes::MODE_3; diff --git a/generators/.run/events.run.xml b/generators/.run/events.run.xml index f495007e..18f71033 100644 --- a/generators/.run/events.run.xml +++ b/generators/.run/events.run.xml @@ -6,9 +6,9 @@ -