eive-obsw/bsp_q7s/em/emObjectFactory.cpp

72 lines
2.3 KiB
C++
Raw Normal View History

2022-05-19 15:28:02 +02:00
#include <fsfw/health/HealthTableIF.h>
2022-05-23 18:37:04 +02:00
2021-05-17 16:53:06 +02:00
#include "OBSWConfig.h"
2022-01-17 13:48:55 +01:00
#include "bsp_q7s/core/CoreController.h"
2022-05-03 11:53:10 +02:00
#include "bsp_q7s/core/ObjectFactory.h"
2021-08-17 17:11:59 +02:00
#include "busConf.h"
#include "commonObjects.h"
2022-01-17 13:48:55 +01:00
#include "devConf.h"
#include "fsfw_hal/linux/gpio/LinuxLibgpioIF.h"
2022-03-26 16:38:42 +01:00
#include "linux/ObjectFactory.h"
#include "linux/callbacks/gpioCallbacks.h"
2021-07-19 12:44:43 +02:00
#include "mission/core/GenericFactory.h"
2020-09-30 17:17:01 +02:00
2021-09-20 17:47:29 +02:00
void ObjectFactory::produce(void* args) {
2022-01-17 13:48:55 +01:00
ObjectFactory::setStatics();
2022-05-19 15:28:02 +02:00
HealthTableIF* healthTable = nullptr;
ObjectFactory::produceGenericObjects(&healthTable);
2022-01-17 13:48:55 +01:00
LinuxLibgpioIF* gpioComIF = nullptr;
UartComIF* uartComIF = nullptr;
SpiComIF* spiMainComIF = nullptr;
2022-02-02 17:36:40 +01:00
I2cComIF* i2cComIF = nullptr;
2022-03-04 16:03:57 +01:00
PowerSwitchIF* pwrSwitcher = nullptr;
SpiComIF* spiRwComIF = nullptr;
createCommunicationInterfaces(&gpioComIF, &uartComIF, &spiMainComIF, &i2cComIF, &spiRwComIF);
2022-01-17 13:48:55 +01:00
createTmpComponents();
new CoreController(objects::CORE_CONTROLLER);
2021-07-19 12:44:43 +02:00
2022-03-26 16:38:42 +01:00
gpioCallbacks::disableAllDecoder(gpioComIF);
2022-03-04 16:03:57 +01:00
createPcduComponents(gpioComIF, &pwrSwitcher);
2022-01-17 13:48:55 +01:00
createRadSensorComponent(gpioComIF);
createSunSensorComponents(gpioComIF, spiMainComIF, pwrSwitcher, q7s::SPI_DEFAULT_DEV);
2021-09-13 18:07:07 +02:00
2021-07-19 12:44:43 +02:00
#if OBSW_ADD_ACS_BOARD == 1
2022-03-04 16:03:57 +01:00
createAcsBoardComponents(gpioComIF, uartComIF, pwrSwitcher);
2022-01-19 18:05:17 +01:00
#endif
2022-05-19 15:28:02 +02:00
createHeaterComponents(gpioComIF, pwrSwitcher, healthTable);
2022-01-17 13:48:55 +01:00
createSolarArrayDeploymentComponents();
createPlPcduComponents(gpioComIF, spiMainComIF, pwrSwitcher);
2021-09-22 11:45:25 +02:00
#if OBSW_ADD_SYRLINKS == 1
2022-05-27 16:24:41 +02:00
#if OBSW_Q7S_EM == 1
2022-05-27 13:44:40 +02:00
createSyrlinksComponents(nullptr);
#else
2022-04-27 16:44:03 +02:00
createSyrlinksComponents(pwrSwitcher);
2022-05-27 16:24:41 +02:00
#endif /* OBSW_Q7S_EM == 1 */
2021-09-22 11:45:25 +02:00
#endif /* OBSW_ADD_SYRLINKS == 1 */
2022-05-27 13:44:40 +02:00
createRtdComponents(q7s::SPI_DEFAULT_DEV, gpioComIF, pwrSwitcher, spiMainComIF);
2022-03-28 09:08:11 +02:00
createPayloadComponents(gpioComIF);
2021-05-26 14:16:16 +02:00
2022-01-27 15:26:07 +01:00
#if OBSW_ADD_MGT == 1
createImtqComponents(pwrSwitcher);
2022-01-27 15:26:07 +01:00
#endif
createReactionWheelComponents(gpioComIF, pwrSwitcher);
2020-09-30 17:17:01 +02:00
2022-02-02 17:36:40 +01:00
#if OBSW_ADD_BPX_BATTERY_HANDLER == 1
createBpxBatteryComponent();
2022-04-26 10:37:25 +02:00
#endif
2021-07-23 17:48:11 +02:00
2021-08-17 19:50:48 +02:00
#if OBSW_ADD_STAR_TRACKER == 1
createStrComponents(pwrSwitcher);
#endif /* OBSW_ADD_STAR_TRACKER == 1 */
2021-09-22 16:54:55 +02:00
#if OBSW_USE_CCSDS_IP_CORE == 1
2022-01-17 13:48:55 +01:00
createCcsdsComponents(gpioComIF);
2021-09-22 16:54:55 +02:00
#endif /* OBSW_USE_CCSDS_IP_CORE == 1 */
2022-01-17 13:48:55 +01:00
/* Test Task */
#if OBSW_ADD_TEST_CODE == 1
2022-01-17 13:48:55 +01:00
createTestComponents(gpioComIF);
#endif /* OBSW_ADD_TEST_CODE == 1 */
createMiscComponents();
}