diff --git a/bsp_hosted/fsfwconfig/devices/gpioIds.h b/bsp_hosted/fsfwconfig/devices/gpioIds.h deleted file mode 100644 index 0c426ccd..00000000 --- a/bsp_hosted/fsfwconfig/devices/gpioIds.h +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef FSFWCONFIG_DEVICES_GPIOIDS_H_ -#define FSFWCONFIG_DEVICES_GPIOIDS_H_ - -namespace gpioIds { -enum gpioId_t { - HEATER_0, - HEATER_1, - HEATER_2, - HEATER_3, - HEATER_4, - HEATER_5, - HEATER_6, - HEATER_7, - DEPLSA1, - DEPLSA2, - - MGM_0_LIS3_CS, - MGM_1_RM3100_CS, - GYRO_0_ADIS_CS, - GYRO_1_L3G_CS, - GYRO_2_L3G_CS, - MGM_2_LIS3_CS, - MGM_3_RM3100_CS, - - TEST_ID_0, - TEST_ID_1, - - RTD_IC_3, - RTD_IC_4, - RTD_IC_5, - RTD_IC_6, - RTD_IC_7, - RTD_IC_8, - RTD_IC_9, - RTD_IC_10, - RTD_IC_11, - RTD_IC_12, - RTD_IC_13, - RTD_IC_14, - RTD_IC_15, - RTD_IC_16, - RTD_IC_17, - RTD_IC_18, - - SPI_MUX_BIT_1, - SPI_MUX_BIT_2, - SPI_MUX_BIT_3, - SPI_MUX_BIT_4, - SPI_MUX_BIT_5, - SPI_MUX_BIT_6, - - CS_RAD_SENSOR, - ENABLE_RADFET -}; -} - -#endif /* FSFWCONFIG_DEVICES_GPIOIDS_H_ */ diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index bcf5a50f..519dec8f 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -28,8 +28,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 @@ -51,13 +56,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" @@ -69,6 +67,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" @@ -83,6 +82,7 @@ #include "mission/devices/devicedefinitions/RwDefinitions.h" #include "mission/devices/devicedefinitions/SusDefinitions.h" #include "mission/devices/devicedefinitions/SyrlinksDefinitions.h" +#include "mission/devices/devicedefinitions/payloadPcduDefinitions.h" #include "mission/tmtc/CCSDSHandler.h" #include "mission/tmtc/VirtualChannel.h" #include "mission/utility/TmFunnel.h" @@ -390,8 +390,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, @@ -1181,15 +1180,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); @@ -1198,6 +1188,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"; @@ -1205,6 +1203,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/linux/fsfwconfig/devices/gpioIds.h b/common/config/devices/gpioIds.h similarity index 100% rename from linux/fsfwconfig/devices/gpioIds.h rename to common/config/devices/gpioIds.h diff --git a/fsfw b/fsfw index 75c56280..d6c10411 160000 --- a/fsfw +++ b/fsfw @@ -1 +1 @@ -Subproject commit 75c56280ad139640d2c12ac4ab78ce66c25fb495 +Subproject commit d6c1041133822903c123e4efd890b1320e1157c9 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 @@ -