|
|
|
@ -62,6 +62,7 @@
|
|
|
|
|
#include "mission/system/tree/comModeTree.h"
|
|
|
|
|
#include "mission/system/tree/payloadModeTree.h"
|
|
|
|
|
#include "mission/system/tree/tcsModeTree.h"
|
|
|
|
|
#include "mission/tmtc/tmFilters.h"
|
|
|
|
|
#include "mission/utility/GlobalConfigHandler.h"
|
|
|
|
|
#include "tmtc/pusIds.h"
|
|
|
|
|
#if OBSW_TEST_LIBGPIOD == 1
|
|
|
|
@ -715,39 +716,27 @@ void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ReturnValue_t ObjectFactory::createCcsdsComponents(LinuxLibgpioIF* gpioComIF,
|
|
|
|
|
PusTmFunnel& pusFunnel,
|
|
|
|
|
CcsdsIpCoreHandler** ipCoreHandler) {
|
|
|
|
|
using namespace gpio;
|
|
|
|
|
// GPIO definitions of signals connected to the virtual channel interfaces of the PTME IP Core
|
|
|
|
|
GpioCookie* gpioCookiePtmeIp = new GpioCookie;
|
|
|
|
|
GpiodRegularByLineName* gpio = nullptr;
|
|
|
|
|
std::stringstream consumer;
|
|
|
|
|
consumer.str("PAPB VC0");
|
|
|
|
|
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_BUSY_SIGNAL_VC0, consumer.str());
|
|
|
|
|
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_BUSY_SIGNAL_VC0, "PAPB VC0");
|
|
|
|
|
gpioCookiePtmeIp->addGpio(gpioIds::VC0_PAPB_BUSY, gpio);
|
|
|
|
|
consumer.str("PAPB VC0");
|
|
|
|
|
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_EMPTY_SIGNAL_VC0, consumer.str());
|
|
|
|
|
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_EMPTY_SIGNAL_VC0, "PAPB VC0");
|
|
|
|
|
gpioCookiePtmeIp->addGpio(gpioIds::VC0_PAPB_EMPTY, gpio);
|
|
|
|
|
consumer.str("PAPB VC 1");
|
|
|
|
|
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_BUSY_SIGNAL_VC1, consumer.str());
|
|
|
|
|
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_BUSY_SIGNAL_VC1, "PAPB VC1");
|
|
|
|
|
gpioCookiePtmeIp->addGpio(gpioIds::VC1_PAPB_BUSY, gpio);
|
|
|
|
|
consumer.str("");
|
|
|
|
|
consumer.str("PAPB VC 1");
|
|
|
|
|
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_EMPTY_SIGNAL_VC1, "PAPB VC1");
|
|
|
|
|
gpioCookiePtmeIp->addGpio(gpioIds::VC1_PAPB_EMPTY, gpio);
|
|
|
|
|
consumer.str("");
|
|
|
|
|
consumer.str("PAPB VC 2");
|
|
|
|
|
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_BUSY_SIGNAL_VC2, consumer.str());
|
|
|
|
|
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_BUSY_SIGNAL_VC2, "PAPB VC2");
|
|
|
|
|
gpioCookiePtmeIp->addGpio(gpioIds::VC2_PAPB_BUSY, gpio);
|
|
|
|
|
consumer.str("");
|
|
|
|
|
consumer.str("PAPB VC 2");
|
|
|
|
|
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_EMPTY_SIGNAL_VC2, consumer.str());
|
|
|
|
|
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_EMPTY_SIGNAL_VC2, "PAPB VC2");
|
|
|
|
|
gpioCookiePtmeIp->addGpio(gpioIds::VC2_PAPB_EMPTY, gpio);
|
|
|
|
|
consumer.str("");
|
|
|
|
|
consumer.str("PAPB VC 3");
|
|
|
|
|
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_BUSY_SIGNAL_VC3, consumer.str());
|
|
|
|
|
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_BUSY_SIGNAL_VC3, "PAPB VC3");
|
|
|
|
|
gpioCookiePtmeIp->addGpio(gpioIds::VC3_PAPB_BUSY, gpio);
|
|
|
|
|
consumer.str("");
|
|
|
|
|
consumer.str("PAPB VC 3");
|
|
|
|
|
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_EMPTY_SIGNAL_VC3, consumer.str());
|
|
|
|
|
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_EMPTY_SIGNAL_VC3, "PAPB VC3");
|
|
|
|
|
gpioCookiePtmeIp->addGpio(gpioIds::VC3_PAPB_EMPTY, gpio);
|
|
|
|
|
gpioChecker(gpioComIF->addGpios(gpioCookiePtmeIp), "PTME PAPB VCs");
|
|
|
|
|
// Creating virtual channel interfaces
|
|
|
|
@ -773,17 +762,26 @@ ReturnValue_t ObjectFactory::createCcsdsComponents(LinuxLibgpioIF* gpioComIF,
|
|
|
|
|
new AxiPtmeConfig(objects::AXI_PTME_CONFIG, q7s::UIO_PTME, q7s::uiomapids::PTME_CONFIG);
|
|
|
|
|
PtmeConfig* ptmeConfig = new PtmeConfig(objects::PTME_CONFIG, axiPtmeConfig);
|
|
|
|
|
|
|
|
|
|
*ipCoreHandler = new CcsdsIpCoreHandler(objects::CCSDS_HANDLER, objects::PTME,
|
|
|
|
|
objects::CCSDS_PACKET_DISTRIBUTOR, ptmeConfig, gpioComIF,
|
|
|
|
|
gpioIds::RS485_EN_TX_CLOCK, gpioIds::RS485_EN_TX_DATA);
|
|
|
|
|
*ipCoreHandler = new CcsdsIpCoreHandler(objects::CCSDS_HANDLER, objects::CCSDS_PACKET_DISTRIBUTOR,
|
|
|
|
|
*ptme, *ptmeConfig, gpioComIF, gpioIds::RS485_EN_TX_CLOCK,
|
|
|
|
|
gpioIds::RS485_EN_TX_DATA);
|
|
|
|
|
VirtualChannel* vc = nullptr;
|
|
|
|
|
vc = new VirtualChannel(ccsds::VC0, config::VC0_QUEUE_SIZE, objects::CCSDS_HANDLER);
|
|
|
|
|
vc = new VirtualChannel(objects::PTME_VC0_LIVE_TM, ccsds::VC0, "PTME VC0 LIVE TM",
|
|
|
|
|
config::VC0_QUEUE_SIZE);
|
|
|
|
|
(*ipCoreHandler)->addVirtualChannel(ccsds::VC0, vc);
|
|
|
|
|
vc = new VirtualChannel(ccsds::VC1, config::VC1_QUEUE_SIZE, objects::CCSDS_HANDLER);
|
|
|
|
|
vc = new VirtualChannel(objects::PTME_VC1_LOG_TM, ccsds::VC1, "PTME VC1 LOG TM",
|
|
|
|
|
config::VC1_QUEUE_SIZE);
|
|
|
|
|
pusFunnel.addPersistentTmStoreRouting(filters::okFilter(), vc->getReportReceptionQueue());
|
|
|
|
|
pusFunnel.addPersistentTmStoreRouting(filters::notOkFilter(), vc->getReportReceptionQueue());
|
|
|
|
|
pusFunnel.addPersistentTmStoreRouting(filters::miscFilter(), vc->getReportReceptionQueue());
|
|
|
|
|
(*ipCoreHandler)->addVirtualChannel(ccsds::VC1, vc);
|
|
|
|
|
vc = new VirtualChannel(ccsds::VC2, config::VC2_QUEUE_SIZE, objects::CCSDS_HANDLER);
|
|
|
|
|
vc = new VirtualChannel(objects::PTME_VC2_HK_TM, ccsds::VC2, "PTME VC2 HK TM",
|
|
|
|
|
config::VC2_QUEUE_SIZE);
|
|
|
|
|
pusFunnel.addPersistentTmStoreRouting(filters::hkFilter(), vc->getReportReceptionQueue());
|
|
|
|
|
(*ipCoreHandler)->addVirtualChannel(ccsds::VC2, vc);
|
|
|
|
|
vc = new VirtualChannel(ccsds::VC3, config::VC3_QUEUE_SIZE, objects::CCSDS_HANDLER);
|
|
|
|
|
vc = new VirtualChannel(objects::PTME_VC3_CFDP_TM, ccsds::VC3, "PTME VC3 CFDP TM",
|
|
|
|
|
config::VC3_QUEUE_SIZE);
|
|
|
|
|
// TODO: Set VC destination in CFDP funnel.
|
|
|
|
|
(*ipCoreHandler)->addVirtualChannel(ccsds::VC3, vc);
|
|
|
|
|
|
|
|
|
|
ReturnValue_t result = (*ipCoreHandler)->connectModeTreeParent(satsystem::com::SUBSYSTEM);
|
|
|
|
@ -794,10 +792,8 @@ ReturnValue_t ObjectFactory::createCcsdsComponents(LinuxLibgpioIF* gpioComIF,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GpioCookie* gpioCookiePdec = new GpioCookie;
|
|
|
|
|
consumer.str("");
|
|
|
|
|
consumer << "0x" << std::hex << objects::PDEC_HANDLER;
|
|
|
|
|
// GPIO also low after linux boot (specified by device-tree)
|
|
|
|
|
gpio = new GpiodRegularByLineName(q7s::gpioNames::PDEC_RESET, consumer.str(), Direction::OUT,
|
|
|
|
|
gpio = new GpiodRegularByLineName(q7s::gpioNames::PDEC_RESET, "PDEC Handler", Direction::OUT,
|
|
|
|
|
Levels::LOW);
|
|
|
|
|
gpioCookiePdec->addGpio(gpioIds::PDEC_RESET, gpio);
|
|
|
|
|
gpioChecker(gpioComIF->addGpios(gpioCookiePdec), "PDEC");
|
|
|
|
|