2020-12-29 13:59:31 +01:00
|
|
|
#ifndef BSP_Q7S_OBJECTFACTORY_H_
|
|
|
|
#define BSP_Q7S_OBJECTFACTORY_H_
|
|
|
|
|
2022-08-24 17:27:47 +02:00
|
|
|
#include <fsfw/returnvalues/returnvalue.h>
|
2023-02-26 14:55:33 +01:00
|
|
|
#include <fsfw_hal/linux/spi/SpiComIF.h>
|
2023-03-09 19:42:20 +01:00
|
|
|
#include <mission/core/GenericFactory.h>
|
2022-11-25 11:01:06 +01:00
|
|
|
#include <mission/devices/HeaterHandler.h>
|
2022-12-21 14:11:31 +01:00
|
|
|
#include <mission/system/objects/Stack5VHandler.h>
|
2022-11-02 10:26:45 +01:00
|
|
|
#include <mission/tmtc/CcsdsIpCoreHandler.h>
|
|
|
|
#include <mission/tmtc/CfdpTmFunnel.h>
|
2023-03-09 19:42:20 +01:00
|
|
|
#include <mission/tmtc/PersistentLogTmStoreTask.h>
|
2022-11-02 10:26:45 +01:00
|
|
|
#include <mission/tmtc/PusTmFunnel.h>
|
2022-04-28 18:38:38 +02:00
|
|
|
|
|
|
|
#include <string>
|
2023-03-13 09:49:35 +01:00
|
|
|
#include <atomic>
|
2022-04-28 18:38:38 +02:00
|
|
|
|
2021-07-19 12:44:43 +02:00
|
|
|
class LinuxLibgpioIF;
|
2022-11-10 18:07:59 +01:00
|
|
|
class SerialComIF;
|
2021-08-17 19:50:48 +02:00
|
|
|
class SpiComIF;
|
2022-02-02 17:36:40 +01:00
|
|
|
class I2cComIF;
|
2022-03-04 16:03:57 +01:00
|
|
|
class PowerSwitchIF;
|
2022-05-02 17:37:00 +02:00
|
|
|
class HealthTableIF;
|
2022-04-01 14:13:37 +02:00
|
|
|
class AcsBoardAssembly;
|
2022-05-02 22:45:27 +02:00
|
|
|
class GpioIF;
|
2021-07-19 12:44:43 +02:00
|
|
|
|
2023-03-13 09:49:35 +01:00
|
|
|
extern std::atomic_uint16_t I2C_FATAL_ERRORS;
|
|
|
|
|
2020-12-29 13:59:31 +01:00
|
|
|
namespace ObjectFactory {
|
2021-07-19 12:44:43 +02:00
|
|
|
|
2023-03-09 19:42:20 +01:00
|
|
|
struct CcsdsComponentArgs {
|
2023-03-09 19:52:13 +01:00
|
|
|
CcsdsComponentArgs(LinuxLibgpioIF& gpioIF, StorageManagerIF& ipcStore, StorageManagerIF& tmStore,
|
2023-03-10 02:05:51 +01:00
|
|
|
PersistentTmStores& stores, PusTmFunnel& pusFunnel, CfdpTmFunnel& cfdpFunnel,
|
|
|
|
CcsdsIpCoreHandler** ipCoreHandler)
|
2023-03-09 19:42:20 +01:00
|
|
|
: gpioComIF(gpioIF),
|
|
|
|
ipcStore(ipcStore),
|
|
|
|
tmStore(tmStore),
|
|
|
|
stores(stores),
|
2023-03-10 02:05:51 +01:00
|
|
|
pusFunnel(pusFunnel),
|
|
|
|
cfdpFunnel(cfdpFunnel),
|
2023-03-09 19:42:20 +01:00
|
|
|
ipCoreHandler(ipCoreHandler) {}
|
|
|
|
LinuxLibgpioIF& gpioComIF;
|
|
|
|
StorageManagerIF& ipcStore;
|
|
|
|
StorageManagerIF& tmStore;
|
|
|
|
PersistentTmStores& stores;
|
2023-03-10 02:05:51 +01:00
|
|
|
PusTmFunnel& pusFunnel;
|
|
|
|
CfdpTmFunnel& cfdpFunnel;
|
2023-03-09 19:42:20 +01:00
|
|
|
CcsdsIpCoreHandler** ipCoreHandler;
|
2023-03-09 19:52:13 +01:00
|
|
|
AcceptsTelemetryIF* liveDestination = nullptr;
|
2023-03-09 19:42:20 +01:00
|
|
|
};
|
|
|
|
|
2021-02-14 14:59:43 +01:00
|
|
|
void setStatics();
|
2021-06-08 16:45:25 +02:00
|
|
|
void produce(void* args);
|
2021-07-19 12:44:43 +02:00
|
|
|
|
2022-11-10 18:07:59 +01:00
|
|
|
void createCommunicationInterfaces(LinuxLibgpioIF** gpioComIF, SerialComIF** uartComIF,
|
2023-02-16 16:08:17 +01:00
|
|
|
SpiComIF** spiMainComIF, I2cComIF** i2cComIF);
|
2022-03-04 16:03:57 +01:00
|
|
|
void createPcduComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF** pwrSwitcher);
|
2022-03-25 15:56:44 +01:00
|
|
|
void createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF,
|
2022-12-22 11:10:55 +01:00
|
|
|
PowerSwitchIF* pwrSwitcher, Stack5VHandler& stackHandler);
|
2021-07-19 12:44:43 +02:00
|
|
|
void createTmpComponents();
|
2022-12-21 14:11:31 +01:00
|
|
|
ReturnValue_t createRadSensorComponent(LinuxLibgpioIF* gpioComIF, Stack5VHandler& handler);
|
2023-03-14 10:54:44 +01:00
|
|
|
void createAcsBoardGpios(GpioCookie& cookie);
|
2023-02-26 14:55:33 +01:00
|
|
|
void createAcsBoardComponents(SpiComIF& spiComIF, LinuxLibgpioIF* gpioComIF, SerialComIF* uartComIF,
|
2023-02-13 13:53:13 +01:00
|
|
|
PowerSwitchIF& pwrSwitcher);
|
2022-11-25 11:01:06 +01:00
|
|
|
void createHeaterComponents(GpioIF* gpioIF, PowerSwitchIF* pwrSwitcher, HealthTableIF* healthTable,
|
|
|
|
HeaterHandler*& heaterHandler);
|
2022-05-11 01:48:26 +02:00
|
|
|
void createImtqComponents(PowerSwitchIF* pwrSwitcher);
|
|
|
|
void createBpxBatteryComponent();
|
|
|
|
void createStrComponents(PowerSwitchIF* pwrSwitcher);
|
2022-10-12 13:56:25 +02:00
|
|
|
void createSolarArrayDeploymentComponents(PowerSwitchIF& pwrSwitcher, GpioIF& gpioIF);
|
2022-04-14 11:17:07 +02:00
|
|
|
void createSyrlinksComponents(PowerSwitchIF* pwrSwitcher);
|
2022-11-10 13:09:31 +01:00
|
|
|
void createPayloadComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF& pwrSwitcher);
|
2022-05-11 00:54:29 +02:00
|
|
|
void createReactionWheelComponents(LinuxLibgpioIF* gpioComIF, PowerSwitchIF* pwrSwitcher);
|
2023-03-09 19:42:20 +01:00
|
|
|
ReturnValue_t createCcsdsComponents(CcsdsComponentArgs& args);
|
2022-05-11 01:48:26 +02:00
|
|
|
void createMiscComponents();
|
|
|
|
|
2021-09-13 18:07:07 +02:00
|
|
|
void createTestComponents(LinuxLibgpioIF* gpioComIF);
|
2021-07-19 12:44:43 +02:00
|
|
|
|
2022-04-01 14:13:37 +02:00
|
|
|
void testAcsBrdAss(AcsBoardAssembly* assAss);
|
|
|
|
|
2022-01-18 11:41:19 +01:00
|
|
|
}; // namespace ObjectFactory
|
2020-12-29 13:59:31 +01:00
|
|
|
|
|
|
|
#endif /* BSP_Q7S_OBJECTFACTORY_H_ */
|