diff --git a/bsp_q7s/CMakeLists.txt b/bsp_q7s/CMakeLists.txt index 0a8cffe8..17e4ba2d 100644 --- a/bsp_q7s/CMakeLists.txt +++ b/bsp_q7s/CMakeLists.txt @@ -11,7 +11,6 @@ target_link_libraries(${SIMPLE_OBSW_NAME} PUBLIC target_compile_definitions(${SIMPLE_OBSW_NAME} PRIVATE "Q7S_SIMPLE_MODE") add_subdirectory(simple) - target_sources(${OBSW_NAME} PUBLIC main.cpp ) diff --git a/bsp_q7s/core/ObjectFactory.cpp b/bsp_q7s/core/ObjectFactory.cpp index f9e893c4..f9814c20 100644 --- a/bsp_q7s/core/ObjectFactory.cpp +++ b/bsp_q7s/core/ObjectFactory.cpp @@ -1,9 +1,10 @@ #include "ObjectFactory.h" -#include -#include - -#include +#include +#include +#include +#include +#include #include "OBSWConfig.h" #include "bsp_q7s/boardtest/Q7STestTask.h" @@ -25,6 +26,20 @@ #include "devices/addresses.h" #include "devices/gpioIds.h" #include "devices/powerSwitcherList.h" +#include "linux/boardtest/I2cTestClass.h" +#include "linux/boardtest/SpiTestClass.h" +#include "linux/boardtest/UartTestClass.h" +#include "linux/csp/CspComIF.h" +#include "linux/csp/CspCookie.h" +#include "linux/devices/SolarArrayDeploymentHandler.h" +#include "tmtc/apid.h" +#include "tmtc/pusIds.h" +#if OBSW_TEST_LIBGPIOD == 1 +#include "linux/boardtest/LibgpiodTest.h" +#endif + +#include + #include "fsfw/datapoollocal/LocalDataPoolManager.h" #include "fsfw/tmtcpacket/pus/tm.h" #include "fsfw/tmtcservices/CommandingServiceBase.h" @@ -40,16 +55,10 @@ #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 "mission/devices/SolarArrayDeploymentHandler.h" -#include "mission/devices/SusHandler.h" -#include "mission/devices/devicedefinitions/SusDefinitions.h" +#include "linux/devices/GPSHyperionLinuxController.h" #include "mission/core/GenericFactory.h" #include "mission/devices/ACUHandler.h" #include "mission/devices/BpxBatteryHandler.h" -#include "linux/devices/GPSHyperionLinuxController.h" #include "mission/devices/GyroADIS1650XHandler.h" #include "mission/devices/HeaterHandler.h" #include "mission/devices/IMTQHandler.h" @@ -62,7 +71,6 @@ #include "mission/devices/PlocMPSoCHandler.h" #include "mission/devices/RadiationSensorHandler.h" #include "mission/devices/RwHandler.h" -#include "mission/devices/SolarArrayDeploymentHandler.h" #include "mission/devices/SusHandler.h" #include "mission/devices/SyrlinksHkHandler.h" #include "mission/devices/Tmp1075Handler.h" @@ -77,18 +85,6 @@ #include "mission/tmtc/CCSDSHandler.h" #include "mission/tmtc/VirtualChannel.h" #include "mission/utility/TmFunnel.h" -#include "tmtc/apid.h" -#include "tmtc/pusIds.h" - -#if OBSW_TEST_LIBGPIOD == 1 -#include "linux/boardtest/LibgpiodTest.h" -#endif - -#include -#include -#include -#include -#include ResetArgs resetArgsGnss0; ResetArgs resetArgsGnss1; @@ -361,38 +357,32 @@ void ObjectFactory::createSunSensorComponents(LinuxLibgpioIF* gpioComIF, SpiComI 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, - gpioComIF, gpioIds::CS_SUS_0); + SusHandler* susHandler0 = new SusHandler(objects::SUS_0, 0, objects::SPI_COM_IF, spiCookie); 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, - gpioComIF, gpioIds::CS_SUS_1); + SusHandler* susHandler1 = new SusHandler(objects::SUS_1, 1, objects::SPI_COM_IF, spiCookie); 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, - gpioComIF, gpioIds::CS_SUS_2); + SusHandler* susHandler2 = new SusHandler(objects::SUS_2, 2, 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::DEFAULT_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); - SusHandler* susHandler3 = new SusHandler(objects::SUS_3, 3, objects::SPI_COM_IF, spiCookie, - gpioComIF, gpioIds::CS_SUS_3); + SusHandler* susHandler3 = new SusHandler(objects::SUS_3, 3, 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::DEFAULT_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); - SusHandler* susHandler4 = new SusHandler(objects::SUS_4, 4, objects::SPI_COM_IF, spiCookie, - gpioComIF, gpioIds::CS_SUS_4); + SusHandler* susHandler4 = new SusHandler(objects::SUS_4, 4, 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::DEFAULT_MAX_1227_MODE, spi::SUS_MAX1227_SPI_FREQ); - SusHandler* susHandler5 = new SusHandler(objects::SUS_5, 5, objects::SPI_COM_IF, spiCookie, - gpioComIF, gpioIds::CS_SUS_5); + SusHandler* susHandler5 = new SusHandler(objects::SUS_5, 5, objects::SPI_COM_IF, spiCookie); spiCookie = new SpiCookie(addresses::SUS_6, gpioIds::CS_SUS_6, q7s::SPI_DEFAULT_DEV, SUS::MAX_CMD_SIZE, @@ -403,32 +393,27 @@ void ObjectFactory::createSunSensorComponents(LinuxLibgpioIF* gpioComIF, SpiComI 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, - gpioComIF, gpioIds::CS_SUS_7); + SusHandler* susHandler7 = new SusHandler(objects::SUS_7, 7, objects::SPI_COM_IF, spiCookie); 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, - gpioComIF, gpioIds::CS_SUS_8); + SusHandler* susHandler8 = new SusHandler(objects::SUS_8, 8, objects::SPI_COM_IF, spiCookie); 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, - gpioComIF, gpioIds::CS_SUS_9); + SusHandler* susHandler9 = new SusHandler(objects::SUS_9, 9, objects::SPI_COM_IF, spiCookie); 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, - gpioComIF, gpioIds::CS_SUS_10); + SusHandler* susHandler10 = new SusHandler(objects::SUS_10, 10, objects::SPI_COM_IF, spiCookie); 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, - gpioComIF, gpioIds::CS_SUS_11); + SusHandler* susHandler11 = new SusHandler(objects::SUS_11, 11, objects::SPI_COM_IF, spiCookie); static_cast(susHandler0); static_cast(susHandler1); static_cast(susHandler2); diff --git a/bsp_q7s/gpio/CMakeLists.txt b/bsp_q7s/gpio/CMakeLists.txt deleted file mode 100644 index 89bb24bb..00000000 --- a/bsp_q7s/gpio/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -target_sources(${OBSW_NAME} PRIVATE - gpioCallbacks.cpp -) diff --git a/common/config/commonObjects.h b/common/config/commonObjects.h index c97bdd41..6cc90be9 100644 --- a/common/config/commonObjects.h +++ b/common/config/commonObjects.h @@ -11,6 +11,7 @@ enum commonObjects: uint32_t { TMTC_BRIDGE = 0x50000300, TMTC_POLLING_TASK = 0x50000400, FILE_SYSTEM_HANDLER = 0x50000500, + SDC_MANAGER = 0x50000550, PTME = 0x50000600, PDEC_HANDLER = 0x50000700, CCSDS_HANDLER = 0x50000800, diff --git a/linux/devices/GPSHyperionLinuxController.h b/linux/devices/GPSHyperionLinuxController.h index b6ad8770..3615cebd 100644 --- a/linux/devices/GPSHyperionLinuxController.h +++ b/linux/devices/GPSHyperionLinuxController.h @@ -2,7 +2,6 @@ #define MISSION_DEVICES_GPSHYPERIONHANDLER_H_ #include "fsfw/FSFW.h" -#include "mission/devices/devicedefinitions/GPSDefinitions.h" #include "fsfw/controller/ExtendedControllerBase.h" #include "fsfw/devicehandlers/DeviceHandlerBase.h" #include "mission/devices/devicedefinitions/GPSDefinitions.h" diff --git a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp index e35a77b3..172c3916 100644 --- a/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp +++ b/linux/fsfwconfig/pollingsequence/pollingSequenceFactory.cpp @@ -1,6 +1,4 @@ #include "pollingSequenceFactory.h" -#include "OBSWConfig.h" -#include "objects/systemObjectList.h" #include #include diff --git a/mission/devices/PayloadPcduHandler.h b/mission/devices/PayloadPcduHandler.h index adcd4349..32e972e7 100644 --- a/mission/devices/PayloadPcduHandler.h +++ b/mission/devices/PayloadPcduHandler.h @@ -32,7 +32,8 @@ class SpiCookie; class PayloadPcduHandler : public DeviceHandlerBase { public: static constexpr uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::PL_PCDU_HANDLER; - static constexpr Event TRANSITION_BACK_TO_OFF = event::makeEvent(SUBSYSTEM_ID, 0, severity::MEDIUM); + static constexpr Event TRANSITION_BACK_TO_OFF = + event::makeEvent(SUBSYSTEM_ID, 0, severity::MEDIUM); PayloadPcduHandler(object_id_t objectId, object_id_t comIF, CookieIF* cookie, GpioIF* gpioIF, bool periodicPrintout); @@ -49,7 +50,7 @@ class PayloadPcduHandler : public DeviceHandlerBase { #endif private: - enum class States: uint8_t { + enum class States : uint8_t { PCDU_OFF, // Solid State Relay, enable battery voltages VBAT0 and VBAT1. This will also switch on // the ADC diff --git a/mission/devices/devicedefinitions/payloadPcduDefinitions.h b/mission/devices/devicedefinitions/payloadPcduDefinitions.h index 8a57e6b4..805b38c7 100644 --- a/mission/devices/devicedefinitions/payloadPcduDefinitions.h +++ b/mission/devices/devicedefinitions/payloadPcduDefinitions.h @@ -12,7 +12,7 @@ namespace plpcdu { using namespace max1227; -enum PlPcduAdcChannels: uint8_t { +enum PlPcduAdcChannels : uint8_t { U_BAT_DIV_6 = 0, // According to schematic, will be 2.2158V for Vneg = +0V and 0.2446V for Vneg = -6V // Full Forumula: V_neg = V_post - (R1 + R2) / R1 * (V_pos - V_out) with R1 being 27.4k