CCSDS Handler Improvements #268
@ -89,8 +89,8 @@
|
|||||||
#include "mission/devices/devicedefinitions/payloadPcduDefinitions.h"
|
#include "mission/devices/devicedefinitions/payloadPcduDefinitions.h"
|
||||||
#include "mission/system/AcsBoardAssembly.h"
|
#include "mission/system/AcsBoardAssembly.h"
|
||||||
#include "mission/tmtc/CCSDSHandler.h"
|
#include "mission/tmtc/CCSDSHandler.h"
|
||||||
#include "mission/tmtc/VirtualChannel.h"
|
|
||||||
#include "mission/tmtc/TmFunnel.h"
|
#include "mission/tmtc/TmFunnel.h"
|
||||||
|
#include "mission/tmtc/VirtualChannel.h"
|
||||||
|
|
||||||
ResetArgs RESET_ARGS_GNSS;
|
ResetArgs RESET_ARGS_GNSS;
|
||||||
|
|
||||||
@ -696,6 +696,108 @@ void ObjectFactory::createReactionWheelComponents(LinuxLibgpioIF* gpioComIF,
|
|||||||
#endif /* OBSW_ADD_RW == 1 */
|
#endif /* OBSW_ADD_RW == 1 */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ObjectFactory::createCcsdsComponents(LinuxLibgpioIF* gpioComIF) {
|
||||||
|
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());
|
||||||
|
gpioCookiePtmeIp->addGpio(gpioIds::VC0_PAPB_BUSY, gpio);
|
||||||
|
consumer.str("PAPB VC0");
|
||||||
|
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_EMPTY_SIGNAL_VC0, consumer.str());
|
||||||
|
gpioCookiePtmeIp->addGpio(gpioIds::VC0_PAPB_EMPTY, gpio);
|
||||||
|
consumer.str("PAPB VC 1");
|
||||||
|
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_BUSY_SIGNAL_VC1, consumer.str());
|
||||||
|
gpioCookiePtmeIp->addGpio(gpioIds::VC1_PAPB_BUSY, gpio);
|
||||||
|
consumer.str("");
|
||||||
|
consumer.str("PAPB VC 1");
|
||||||
|
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());
|
||||||
|
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());
|
||||||
|
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());
|
||||||
|
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());
|
||||||
|
gpioCookiePtmeIp->addGpio(gpioIds::VC3_PAPB_EMPTY, gpio);
|
||||||
|
gpioChecker(gpioComIF->addGpios(gpioCookiePtmeIp), "PTME PAPB VCs");
|
||||||
|
// Creating virtual channel interfaces
|
||||||
|
VcInterfaceIF* vc0 =
|
||||||
|
new PapbVcInterface(gpioComIF, gpioIds::VC0_PAPB_BUSY, gpioIds::VC0_PAPB_EMPTY, q7s::UIO_PTME,
|
||||||
|
q7s::uiomapids::PTME_VC0);
|
||||||
|
VcInterfaceIF* vc1 =
|
||||||
|
new PapbVcInterface(gpioComIF, gpioIds::VC1_PAPB_BUSY, gpioIds::VC1_PAPB_EMPTY, q7s::UIO_PTME,
|
||||||
|
q7s::uiomapids::PTME_VC1);
|
||||||
|
VcInterfaceIF* vc2 =
|
||||||
|
new PapbVcInterface(gpioComIF, gpioIds::VC2_PAPB_BUSY, gpioIds::VC2_PAPB_EMPTY, q7s::UIO_PTME,
|
||||||
|
q7s::uiomapids::PTME_VC2);
|
||||||
|
VcInterfaceIF* vc3 =
|
||||||
|
new PapbVcInterface(gpioComIF, gpioIds::VC3_PAPB_BUSY, gpioIds::VC3_PAPB_EMPTY, q7s::UIO_PTME,
|
||||||
|
q7s::uiomapids::PTME_VC3);
|
||||||
|
// Creating ptme object and adding virtual channel interfaces
|
||||||
|
Ptme* ptme = new Ptme(objects::PTME);
|
||||||
|
ptme->addVcInterface(ccsds::VC0, vc0);
|
||||||
|
ptme->addVcInterface(ccsds::VC1, vc1);
|
||||||
|
ptme->addVcInterface(ccsds::VC2, vc2);
|
||||||
|
ptme->addVcInterface(ccsds::VC3, vc3);
|
||||||
|
AxiPtmeConfig* axiPtmeConfig =
|
||||||
|
new AxiPtmeConfig(objects::AXI_PTME_CONFIG, q7s::UIO_PTME, q7s::uiomapids::PTME_CONFIG);
|
||||||
|
PtmeConfig* ptmeConfig = new PtmeConfig(objects::PTME_CONFIG, axiPtmeConfig);
|
||||||
|
#if OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT == 1
|
||||||
|
// Set to high value when not sending via syrlinks
|
||||||
|
static const uint32_t TRANSMITTER_TIMEOUT = 86400000; // 1 day
|
||||||
|
#else
|
||||||
|
static const uint32_t TRANSMITTER_TIMEOUT = 900000; // 15 minutes
|
||||||
|
#endif
|
||||||
|
CCSDSHandler* ccsdsHandler = new CCSDSHandler(
|
||||||
|
objects::CCSDS_HANDLER, objects::PTME, objects::CCSDS_PACKET_DISTRIBUTOR, ptmeConfig,
|
||||||
|
gpioComIF, gpioIds::RS485_EN_TX_CLOCK, gpioIds::RS485_EN_TX_DATA, TRANSMITTER_TIMEOUT);
|
||||||
|
VirtualChannel* vc = nullptr;
|
||||||
|
vc = new VirtualChannel(ccsds::VC0, common::VC0_QUEUE_SIZE, objects::CCSDS_HANDLER);
|
||||||
|
ccsdsHandler->addVirtualChannel(ccsds::VC0, vc);
|
||||||
|
vc = new VirtualChannel(ccsds::VC1, common::VC1_QUEUE_SIZE, objects::CCSDS_HANDLER);
|
||||||
|
ccsdsHandler->addVirtualChannel(ccsds::VC1, vc);
|
||||||
|
vc = new VirtualChannel(ccsds::VC2, common::VC2_QUEUE_SIZE, objects::CCSDS_HANDLER);
|
||||||
|
ccsdsHandler->addVirtualChannel(ccsds::VC2, vc);
|
||||||
|
vc = new VirtualChannel(ccsds::VC3, common::VC3_QUEUE_SIZE, objects::CCSDS_HANDLER);
|
||||||
|
ccsdsHandler->addVirtualChannel(ccsds::VC3, vc);
|
||||||
|
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,
|
||||||
|
Levels::LOW);
|
||||||
|
gpioCookiePdec->addGpio(gpioIds::PDEC_RESET, gpio);
|
||||||
|
gpioChecker(gpioComIF->addGpios(gpioCookiePdec), "PDEC");
|
||||||
|
new PdecHandler(objects::PDEC_HANDLER, objects::CCSDS_HANDLER, gpioComIF, gpioIds::PDEC_RESET,
|
||||||
|
q7s::UIO_PDEC_CONFIG_MEMORY, q7s::UIO_PDEC_RAM, q7s::UIO_PDEC_REGISTERS);
|
||||||
|
GpioCookie* gpioRS485Chip = new GpioCookie;
|
||||||
|
gpio = new GpiodRegularByLineName(q7s::gpioNames::RS485_EN_TX_CLOCK, "RS485 Transceiver",
|
||||||
|
Direction::OUT, Levels::LOW);
|
||||||
|
gpioRS485Chip->addGpio(gpioIds::RS485_EN_TX_CLOCK, gpio);
|
||||||
|
gpio = new GpiodRegularByLineName(q7s::gpioNames::RS485_EN_TX_DATA, "RS485 Transceiver",
|
||||||
|
Direction::OUT, Levels::LOW);
|
||||||
|
gpioRS485Chip->addGpio(gpioIds::RS485_EN_TX_DATA, gpio);
|
||||||
|
// Default configuration enables RX channels (RXEN = LOW)
|
||||||
|
gpio = new GpiodRegularByLineName(q7s::gpioNames::RS485_EN_RX_CLOCK, "RS485 Transceiver",
|
||||||
|
Direction::OUT, Levels::LOW);
|
||||||
|
gpioRS485Chip->addGpio(gpioIds::RS485_EN_RX_CLOCK, gpio);
|
||||||
|
gpio = new GpiodRegularByLineName(q7s::gpioNames::RS485_EN_RX_DATA, "RS485 Transceiver",
|
||||||
|
Direction::OUT, Levels::LOW);
|
||||||
|
gpioRS485Chip->addGpio(gpioIds::RS485_EN_RX_DATA, gpio);
|
||||||
|
gpioChecker(gpioComIF->addGpios(gpioRS485Chip), "RS485 Transceiver");
|
||||||
|
}
|
||||||
|
|
||||||
void ObjectFactory::createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF,
|
void ObjectFactory::createPlPcduComponents(LinuxLibgpioIF* gpioComIF, SpiComIF* spiComIF,
|
||||||
PowerSwitchIF* pwrSwitcher) {
|
PowerSwitchIF* pwrSwitcher) {
|
||||||
using namespace gpio;
|
using namespace gpio;
|
||||||
|
@ -64,116 +64,3 @@ void ObjectFactory::produce(void* args) {
|
|||||||
createMiscComponents();
|
createMiscComponents();
|
||||||
createThermalController();
|
createThermalController();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectFactory::createCcsdsComponents(LinuxLibgpioIF* gpioComIF) {
|
|
||||||
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());
|
|
||||||
gpioCookiePtmeIp->addGpio(gpioIds::VC0_PAPB_BUSY, gpio);
|
|
||||||
consumer.str("PAPB VC0");
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_EMPTY_SIGNAL_VC0, consumer.str());
|
|
||||||
gpioCookiePtmeIp->addGpio(gpioIds::VC0_PAPB_EMPTY, gpio);
|
|
||||||
consumer.str("PAPB VC 1");
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::PAPB_BUSY_SIGNAL_VC1, consumer.str());
|
|
||||||
gpioCookiePtmeIp->addGpio(gpioIds::VC1_PAPB_BUSY, gpio);
|
|
||||||
consumer.str("");
|
|
||||||
consumer.str("PAPB VC 1");
|
|
||||||
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());
|
|
||||||
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());
|
|
||||||
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());
|
|
||||||
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());
|
|
||||||
gpioCookiePtmeIp->addGpio(gpioIds::VC3_PAPB_EMPTY, gpio);
|
|
||||||
|
|
||||||
gpioChecker(gpioComIF->addGpios(gpioCookiePtmeIp), "PTME PAPB VCs");
|
|
||||||
|
|
||||||
// Creating virtual channel interfaces
|
|
||||||
VcInterfaceIF* vc0 =
|
|
||||||
new PapbVcInterface(gpioComIF, gpioIds::VC0_PAPB_BUSY, gpioIds::VC0_PAPB_EMPTY, q7s::UIO_PTME,
|
|
||||||
q7s::uiomapids::PTME_VC0);
|
|
||||||
VcInterfaceIF* vc1 =
|
|
||||||
new PapbVcInterface(gpioComIF, gpioIds::VC1_PAPB_BUSY, gpioIds::VC1_PAPB_EMPTY, q7s::UIO_PTME,
|
|
||||||
q7s::uiomapids::PTME_VC1);
|
|
||||||
VcInterfaceIF* vc2 =
|
|
||||||
new PapbVcInterface(gpioComIF, gpioIds::VC2_PAPB_BUSY, gpioIds::VC2_PAPB_EMPTY, q7s::UIO_PTME,
|
|
||||||
q7s::uiomapids::PTME_VC2);
|
|
||||||
VcInterfaceIF* vc3 =
|
|
||||||
new PapbVcInterface(gpioComIF, gpioIds::VC3_PAPB_BUSY, gpioIds::VC3_PAPB_EMPTY, q7s::UIO_PTME,
|
|
||||||
q7s::uiomapids::PTME_VC3);
|
|
||||||
|
|
||||||
// Creating ptme object and adding virtual channel interfaces
|
|
||||||
Ptme* ptme = new Ptme(objects::PTME);
|
|
||||||
ptme->addVcInterface(ccsds::VC0, vc0);
|
|
||||||
ptme->addVcInterface(ccsds::VC1, vc1);
|
|
||||||
ptme->addVcInterface(ccsds::VC2, vc2);
|
|
||||||
ptme->addVcInterface(ccsds::VC3, vc3);
|
|
||||||
|
|
||||||
AxiPtmeConfig* axiPtmeConfig =
|
|
||||||
new AxiPtmeConfig(objects::AXI_PTME_CONFIG, q7s::UIO_PTME, q7s::uiomapids::PTME_CONFIG);
|
|
||||||
PtmeConfig* ptmeConfig = new PtmeConfig(objects::PTME_CONFIG, axiPtmeConfig);
|
|
||||||
#if OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT == 0
|
|
||||||
// Set to high value when not sending via syrlinks
|
|
||||||
static const uint32_t TRANSMITTER_TIMEOUT = 86400000; // 1 day
|
|
||||||
#else
|
|
||||||
static const uint32_t TRANSMITTER_TIMEOUT = 900000; // 15 minutes
|
|
||||||
#endif
|
|
||||||
CCSDSHandler* ccsdsHandler = new CCSDSHandler(
|
|
||||||
objects::CCSDS_HANDLER, objects::PTME, objects::CCSDS_PACKET_DISTRIBUTOR, ptmeConfig,
|
|
||||||
gpioComIF, gpioIds::RS485_EN_TX_CLOCK, gpioIds::RS485_EN_TX_DATA, TRANSMITTER_TIMEOUT);
|
|
||||||
|
|
||||||
VirtualChannel* vc = nullptr;
|
|
||||||
vc = new VirtualChannel(ccsds::VC0, common::VC0_QUEUE_SIZE, objects::CCSDS_HANDLER);
|
|
||||||
ccsdsHandler->addVirtualChannel(ccsds::VC0, vc);
|
|
||||||
vc = new VirtualChannel(ccsds::VC1, common::VC1_QUEUE_SIZE, objects::CCSDS_HANDLER);
|
|
||||||
ccsdsHandler->addVirtualChannel(ccsds::VC1, vc);
|
|
||||||
vc = new VirtualChannel(ccsds::VC2, common::VC2_QUEUE_SIZE, objects::CCSDS_HANDLER);
|
|
||||||
ccsdsHandler->addVirtualChannel(ccsds::VC2, vc);
|
|
||||||
vc = new VirtualChannel(ccsds::VC3, common::VC3_QUEUE_SIZE, objects::CCSDS_HANDLER);
|
|
||||||
ccsdsHandler->addVirtualChannel(ccsds::VC3, vc);
|
|
||||||
|
|
||||||
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,
|
|
||||||
Levels::LOW);
|
|
||||||
gpioCookiePdec->addGpio(gpioIds::PDEC_RESET, gpio);
|
|
||||||
|
|
||||||
gpioChecker(gpioComIF->addGpios(gpioCookiePdec), "PDEC");
|
|
||||||
|
|
||||||
new PdecHandler(objects::PDEC_HANDLER, objects::CCSDS_HANDLER, gpioComIF, gpioIds::PDEC_RESET,
|
|
||||||
q7s::UIO_PDEC_CONFIG_MEMORY, q7s::UIO_PDEC_RAM, q7s::UIO_PDEC_REGISTERS);
|
|
||||||
|
|
||||||
GpioCookie* gpioRS485Chip = new GpioCookie;
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::RS485_EN_TX_CLOCK, "RS485 Transceiver",
|
|
||||||
Direction::OUT, Levels::LOW);
|
|
||||||
gpioRS485Chip->addGpio(gpioIds::RS485_EN_TX_CLOCK, gpio);
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::RS485_EN_TX_DATA, "RS485 Transceiver",
|
|
||||||
Direction::OUT, Levels::LOW);
|
|
||||||
gpioRS485Chip->addGpio(gpioIds::RS485_EN_TX_DATA, gpio);
|
|
||||||
|
|
||||||
// Default configuration enables RX channels (RXEN = LOW)
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::RS485_EN_RX_CLOCK, "RS485 Transceiver",
|
|
||||||
Direction::OUT, Levels::LOW);
|
|
||||||
gpioRS485Chip->addGpio(gpioIds::RS485_EN_RX_CLOCK, gpio);
|
|
||||||
gpio = new GpiodRegularByLineName(q7s::gpioNames::RS485_EN_RX_DATA, "RS485 Transceiver",
|
|
||||||
Direction::OUT, Levels::LOW);
|
|
||||||
gpioRS485Chip->addGpio(gpioIds::RS485_EN_RX_DATA, gpio);
|
|
||||||
|
|
||||||
gpioChecker(gpioComIF->addGpios(gpioRS485Chip), "RS485 Transceiver");
|
|
||||||
}
|
|
||||||
|
@ -155,107 +155,5 @@ void ObjectFactory::produce(void* args) {
|
|||||||
new Tmp1075Handler(objects::TMP1075_HANDLER_1, objects::I2C_COM_IF, i2cCookieTmp1075tcs1);
|
new Tmp1075Handler(objects::TMP1075_HANDLER_1, objects::I2C_COM_IF, i2cCookieTmp1075tcs1);
|
||||||
new Tmp1075Handler(objects::TMP1075_HANDLER_2, objects::I2C_COM_IF, i2cCookieTmp1075tcs2);
|
new Tmp1075Handler(objects::TMP1075_HANDLER_2, objects::I2C_COM_IF, i2cCookieTmp1075tcs2);
|
||||||
|
|
||||||
#if OBSW_USE_CCSDS_IP_CORE == 1
|
|
||||||
createCcsdsComponents(gpioComIF);
|
|
||||||
#endif /* OBSW_USE_CCSDS_IP_CORE == 1 */
|
|
||||||
static_cast<void>(gpioComIF);
|
static_cast<void>(gpioComIF);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectFactory::createCcsdsComponents(LinuxLibgpioIF* gpioComIF) {
|
|
||||||
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(te0720_1cfa::gpioNames::PAPB_BUSY_SIGNAL_VC0, consumer.str());
|
|
||||||
gpioCookiePtmeIp->addGpio(gpioIds::VC0_PAPB_BUSY, gpio);
|
|
||||||
consumer.str("PAPB VC0");
|
|
||||||
gpio = new GpiodRegularByLineName(te0720_1cfa::gpioNames::PAPB_EMPTY_SIGNAL_VC0, consumer.str());
|
|
||||||
gpioCookiePtmeIp->addGpio(gpioIds::VC0_PAPB_EMPTY, gpio);
|
|
||||||
consumer.str("PAPB VC 1");
|
|
||||||
gpio = new GpiodRegularByLineName(te0720_1cfa::gpioNames::PAPB_BUSY_SIGNAL_VC1, consumer.str());
|
|
||||||
gpioCookiePtmeIp->addGpio(gpioIds::VC1_PAPB_BUSY, gpio);
|
|
||||||
consumer.str("");
|
|
||||||
consumer.str("PAPB VC 1");
|
|
||||||
gpioCookiePtmeIp->addGpio(gpioIds::VC1_PAPB_EMPTY, gpio);
|
|
||||||
consumer.str("");
|
|
||||||
consumer.str("PAPB VC 2");
|
|
||||||
gpio = new GpiodRegularByLineName(te0720_1cfa::gpioNames::PAPB_BUSY_SIGNAL_VC2, consumer.str());
|
|
||||||
gpioCookiePtmeIp->addGpio(gpioIds::VC2_PAPB_BUSY, gpio);
|
|
||||||
consumer.str("");
|
|
||||||
consumer.str("PAPB VC 2");
|
|
||||||
gpio = new GpiodRegularByLineName(te0720_1cfa::gpioNames::PAPB_EMPTY_SIGNAL_VC2, consumer.str());
|
|
||||||
gpioCookiePtmeIp->addGpio(gpioIds::VC2_PAPB_EMPTY, gpio);
|
|
||||||
consumer.str("");
|
|
||||||
consumer.str("PAPB VC 3");
|
|
||||||
gpio = new GpiodRegularByLineName(te0720_1cfa::gpioNames::PAPB_BUSY_SIGNAL_VC3, consumer.str());
|
|
||||||
gpioCookiePtmeIp->addGpio(gpioIds::VC3_PAPB_BUSY, gpio);
|
|
||||||
consumer.str("");
|
|
||||||
consumer.str("PAPB VC 3");
|
|
||||||
gpio = new GpiodRegularByLineName(te0720_1cfa::gpioNames::PAPB_EMPTY_SIGNAL_VC3, consumer.str());
|
|
||||||
gpioCookiePtmeIp->addGpio(gpioIds::VC3_PAPB_EMPTY, gpio);
|
|
||||||
|
|
||||||
gpioChecker(gpioComIF->addGpios(gpioCookiePtmeIp), "PTME PAPB VCs");
|
|
||||||
|
|
||||||
// Creating virtual channel interfaces
|
|
||||||
VcInterfaceIF* vc0 =
|
|
||||||
new PapbVcInterface(gpioComIF, gpioIds::VC0_PAPB_BUSY, gpioIds::VC0_PAPB_EMPTY, te0720_1cfa::UIO_PTME,
|
|
||||||
te0720_1cfa::uiomapids::PTME_VC0);
|
|
||||||
VcInterfaceIF* vc1 =
|
|
||||||
new PapbVcInterface(gpioComIF, gpioIds::VC1_PAPB_BUSY, gpioIds::VC1_PAPB_EMPTY, te0720_1cfa::UIO_PTME,
|
|
||||||
te0720_1cfa::uiomapids::PTME_VC1);
|
|
||||||
VcInterfaceIF* vc2 =
|
|
||||||
new PapbVcInterface(gpioComIF, gpioIds::VC2_PAPB_BUSY, gpioIds::VC2_PAPB_EMPTY, te0720_1cfa::UIO_PTME,
|
|
||||||
te0720_1cfa::uiomapids::PTME_VC2);
|
|
||||||
VcInterfaceIF* vc3 =
|
|
||||||
new PapbVcInterface(gpioComIF, gpioIds::VC3_PAPB_BUSY, gpioIds::VC3_PAPB_EMPTY, te0720_1cfa::UIO_PTME,
|
|
||||||
te0720_1cfa::uiomapids::PTME_VC3);
|
|
||||||
|
|
||||||
// Creating ptme object and adding virtual channel interfaces
|
|
||||||
Ptme* ptme = new Ptme(objects::PTME);
|
|
||||||
ptme->addVcInterface(ccsds::VC0, vc0);
|
|
||||||
ptme->addVcInterface(ccsds::VC1, vc1);
|
|
||||||
ptme->addVcInterface(ccsds::VC2, vc2);
|
|
||||||
ptme->addVcInterface(ccsds::VC3, vc3);
|
|
||||||
|
|
||||||
AxiPtmeConfig* axiPtmeConfig =
|
|
||||||
new AxiPtmeConfig(objects::AXI_PTME_CONFIG, te0720_1cfa::UIO_PTME, te0720_1cfa::uiomapids::PTME_CONFIG);
|
|
||||||
PtmeConfig* ptmeConfig = new PtmeConfig(objects::PTME_CONFIG, axiPtmeConfig);
|
|
||||||
#if OBSW_ENABLE_SYRLINKS_TRANSMIT_TIMEOUT == 1
|
|
||||||
// Set to high value when not sending via syrlinks
|
|
||||||
static const uint32_t TRANSMITTER_TIMEOUT = 86400000; // 1 day
|
|
||||||
#else
|
|
||||||
static const uint32_t TRANSMITTER_TIMEOUT = 900000; // 15 minutes
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// The DummyGpioIF is used here because there are no RS485 chips on the TE7020-1CFA
|
|
||||||
auto dummyGpioIF = new DummyGpioIF();
|
|
||||||
CCSDSHandler* ccsdsHandler = new CCSDSHandler(
|
|
||||||
objects::CCSDS_HANDLER, objects::PTME, objects::CCSDS_PACKET_DISTRIBUTOR, ptmeConfig,
|
|
||||||
dummyGpioIF, gpioIds::RS485_EN_TX_CLOCK, gpioIds::RS485_EN_TX_DATA, TRANSMITTER_TIMEOUT);
|
|
||||||
|
|
||||||
VirtualChannel* vc = nullptr;
|
|
||||||
vc = new VirtualChannel(ccsds::VC0, common::VC0_QUEUE_SIZE, objects::CCSDS_HANDLER);
|
|
||||||
ccsdsHandler->addVirtualChannel(ccsds::VC0, vc);
|
|
||||||
vc = new VirtualChannel(ccsds::VC1, common::VC1_QUEUE_SIZE, objects::CCSDS_HANDLER);
|
|
||||||
ccsdsHandler->addVirtualChannel(ccsds::VC1, vc);
|
|
||||||
vc = new VirtualChannel(ccsds::VC2, common::VC2_QUEUE_SIZE, objects::CCSDS_HANDLER);
|
|
||||||
ccsdsHandler->addVirtualChannel(ccsds::VC2, vc);
|
|
||||||
vc = new VirtualChannel(ccsds::VC3, common::VC3_QUEUE_SIZE, objects::CCSDS_HANDLER);
|
|
||||||
ccsdsHandler->addVirtualChannel(ccsds::VC3, vc);
|
|
||||||
|
|
||||||
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(te0720_1cfa::gpioNames::PDEC_RESET, consumer.str(),
|
|
||||||
Direction::OUT, Levels::LOW);
|
|
||||||
gpioCookiePdec->addGpio(gpioIds::PDEC_RESET, gpio);
|
|
||||||
|
|
||||||
gpioChecker(gpioComIF->addGpios(gpioCookiePdec), "PDEC");
|
|
||||||
|
|
||||||
new PdecHandler(objects::PDEC_HANDLER, objects::CCSDS_HANDLER, gpioComIF, gpioIds::PDEC_RESET,
|
|
||||||
te0720_1cfa::UIO_PDEC_CONFIG_MEMORY, te0720_1cfa::UIO_PDEC_RAM,
|
|
||||||
te0720_1cfa::UIO_PDEC_REGISTERS);
|
|
||||||
}
|
|
||||||
|
@ -7,7 +7,6 @@
|
|||||||
namespace ObjectFactory {
|
namespace ObjectFactory {
|
||||||
static const uint32_t TRANSMITTER_TIMEOUT = 86400000; // 1 day
|
static const uint32_t TRANSMITTER_TIMEOUT = 86400000; // 1 day
|
||||||
void produce(void* args);
|
void produce(void* args);
|
||||||
void createCcsdsComponents(LinuxLibgpioIF* gpioComIF);
|
|
||||||
}; // namespace ObjectFactory
|
}; // namespace ObjectFactory
|
||||||
|
|
||||||
#endif /* BSP_LINUX_OBJECTFACTORY_H_ */
|
#endif /* BSP_LINUX_OBJECTFACTORY_H_ */
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
|
||||||
#include <fsfw/hal/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h>
|
#include <fsfw/hal/src/fsfw_hal/linux/gpio/LinuxLibgpioIF.h>
|
||||||
|
#include <fsfw/returnvalues/HasReturnvaluesIF.h>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
@ -190,19 +190,17 @@ bool PdecHandler::newTcReceived() {
|
|||||||
|
|
||||||
void PdecHandler::checkLocks() {
|
void PdecHandler::checkLocks() {
|
||||||
uint32_t clcw = getClcw();
|
uint32_t clcw = getClcw();
|
||||||
if (not (clcw & NO_RF_MASK) && not carrierLock) {
|
if (not(clcw & NO_RF_MASK) && not carrierLock) {
|
||||||
triggerEvent(CARRIER_LOCK);
|
triggerEvent(CARRIER_LOCK);
|
||||||
carrierLock = true;
|
carrierLock = true;
|
||||||
}
|
} else if ((clcw & NO_RF_MASK) && carrierLock) {
|
||||||
else if ((clcw & NO_RF_MASK) && carrierLock) {
|
|
||||||
carrierLock = false;
|
carrierLock = false;
|
||||||
triggerEvent(LOST_CARRIER_LOCK_PDEC);
|
triggerEvent(LOST_CARRIER_LOCK_PDEC);
|
||||||
}
|
}
|
||||||
if (not (clcw & NO_BITLOCK_MASK) && not bitLock) {
|
if (not(clcw & NO_BITLOCK_MASK) && not bitLock) {
|
||||||
triggerEvent(BIT_LOCK_PDEC);
|
triggerEvent(BIT_LOCK_PDEC);
|
||||||
bitLock = true;
|
bitLock = true;
|
||||||
}
|
} else if ((clcw & NO_BITLOCK_MASK) && bitLock) {
|
||||||
else if ((clcw & NO_BITLOCK_MASK) && bitLock) {
|
|
||||||
bitLock = false;
|
bitLock = false;
|
||||||
triggerEvent(LOST_BIT_LOCK_PDEC);
|
triggerEvent(LOST_BIT_LOCK_PDEC);
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
#include <bsp_q7s/core/CoreDefinitions.h>
|
#include <bsp_q7s/core/CoreDefinitions.h>
|
||||||
#include <fsfw/datapool/PoolReadGuard.h>
|
#include <fsfw/datapool/PoolReadGuard.h>
|
||||||
#include <objects/systemObjectList.h>
|
|
||||||
#include <fsfw_hal/devicehandlers/devicedefinitions/MgmLIS3HandlerDefs.h>
|
#include <fsfw_hal/devicehandlers/devicedefinitions/MgmLIS3HandlerDefs.h>
|
||||||
#include <linux/devices/devicedefinitions/StarTrackerDefinitions.h>
|
#include <linux/devices/devicedefinitions/StarTrackerDefinitions.h>
|
||||||
#include <mission/devices/devicedefinitions/BpxBatteryDefinitions.h>
|
#include <mission/devices/devicedefinitions/BpxBatteryDefinitions.h>
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#define MISSION_DEVICES_DEVICEDEFINITIONS_SYRLINKSDEFINITIONS_H_
|
#define MISSION_DEVICES_DEVICEDEFINITIONS_SYRLINKSDEFINITIONS_H_
|
||||||
|
|
||||||
#include <commonSubsystemIds.h>
|
#include <commonSubsystemIds.h>
|
||||||
|
|
||||||
#include "fsfw/devicehandlers/DeviceHandlerBase.h"
|
#include "fsfw/devicehandlers/DeviceHandlerBase.h"
|
||||||
|
|
||||||
namespace syrlinks {
|
namespace syrlinks {
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
#include "fsfw/serialize/SerializeAdapter.h"
|
#include "fsfw/serialize/SerializeAdapter.h"
|
||||||
#include "fsfw/serviceinterface/ServiceInterface.h"
|
#include "fsfw/serviceinterface/ServiceInterface.h"
|
||||||
#include "fsfw/serviceinterface/serviceInterfaceDefintions.h"
|
#include "fsfw/serviceinterface/serviceInterfaceDefintions.h"
|
||||||
|
|
||||||
#include "mission/devices/devicedefinitions/SyrlinksDefinitions.h"
|
#include "mission/devices/devicedefinitions/SyrlinksDefinitions.h"
|
||||||
|
|
||||||
CCSDSHandler::CCSDSHandler(object_id_t objectId, object_id_t ptmeId, object_id_t tcDestination,
|
CCSDSHandler::CCSDSHandler(object_id_t objectId, object_id_t ptmeId, object_id_t tcDestination,
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
#include "fsfw/tmtcservices/AcceptsTelemetryIF.h"
|
#include "fsfw/tmtcservices/AcceptsTelemetryIF.h"
|
||||||
#include "fsfw_hal/common/gpio/GpioIF.h"
|
#include "fsfw_hal/common/gpio/GpioIF.h"
|
||||||
#include "fsfw_hal/common/gpio/gpioDefinitions.h"
|
#include "fsfw_hal/common/gpio/gpioDefinitions.h"
|
||||||
#include "fsfw/action/CommandsActionsIF.h"
|
|
||||||
#include "linux/obc/PtmeConfig.h"
|
#include "linux/obc/PtmeConfig.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -35,8 +34,7 @@ class CCSDSHandler : public SystemObject,
|
|||||||
public AcceptsTelecommandsIF,
|
public AcceptsTelecommandsIF,
|
||||||
public HasReturnvaluesIF,
|
public HasReturnvaluesIF,
|
||||||
public ReceivesParameterMessagesIF,
|
public ReceivesParameterMessagesIF,
|
||||||
public HasActionsIF,
|
public HasActionsIF {
|
||||||
public CommandsActionsIF {
|
|
||||||
public:
|
public:
|
||||||
using VcId_t = uint8_t;
|
using VcId_t = uint8_t;
|
||||||
|
|
||||||
@ -81,13 +79,6 @@ class CCSDSHandler : public SystemObject,
|
|||||||
virtual ReturnValue_t executeAction(ActionId_t actionId, MessageQueueId_t commandedBy,
|
virtual ReturnValue_t executeAction(ActionId_t actionId, MessageQueueId_t commandedBy,
|
||||||
const uint8_t* data, size_t size);
|
const uint8_t* data, size_t size);
|
||||||
|
|
||||||
MessageQueueIF* getCommandQueuePtr() override;
|
|
||||||
void stepSuccessfulReceived(ActionId_t actionId, uint8_t step) override;
|
|
||||||
void stepFailedReceived(ActionId_t actionId, uint8_t step, ReturnValue_t returnCode) override;
|
|
||||||
void dataReceived(ActionId_t actionId, const uint8_t* data, uint32_t size) override;
|
|
||||||
void completionSuccessfulReceived(ActionId_t actionId) override;
|
|
||||||
void completionFailedReceived(ActionId_t actionId, ReturnValue_t returnCode) override;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const uint8_t INTERFACE_ID = CLASS_ID::CCSDS_HANDLER;
|
static const uint8_t INTERFACE_ID = CLASS_ID::CCSDS_HANDLER;
|
||||||
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::PLOC_MPSOC_HANDLER;
|
static const uint8_t SUBSYSTEM_ID = SUBSYSTEM_ID::PLOC_MPSOC_HANDLER;
|
||||||
|
@ -64,6 +64,4 @@ void VirtualChannel::setPtmeObject(PtmeIF* ptme_) {
|
|||||||
ptme = ptme_;
|
ptme = ptme_;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VirtualChannel::setLinkState(bool linkIsUp_) {
|
void VirtualChannel::setLinkState(bool linkIsUp_) { linkIsUp = linkIsUp_; }
|
||||||
linkIsUp = linkIsUp_;
|
|
||||||
}
|
|
||||||
|
@ -38,37 +38,18 @@
|
|||||||
|
|
||||||
// Custom "glue logic" to convert the month name to a usable number
|
// Custom "glue logic" to convert the month name to a usable number
|
||||||
#define GET_MONTH(str, i) \
|
#define GET_MONTH(str, i) \
|
||||||
(str[i] == 'J' && str[i + 1] == 'a' && str[i + 2] == 'n' \
|
(str[i] == 'J' && str[i + 1] == 'a' && str[i + 2] == 'n' ? 1 \
|
||||||
? 1 \
|
: str[i] == 'F' && str[i + 1] == 'e' && str[i + 2] == 'b' ? 2 \
|
||||||
: str[i] == 'F' && str[i + 1] == 'e' && str[i + 2] == 'b' \
|
: str[i] == 'M' && str[i + 1] == 'a' && str[i + 2] == 'r' ? 3 \
|
||||||
? 2 \
|
: str[i] == 'A' && str[i + 1] == 'p' && str[i + 2] == 'r' ? 4 \
|
||||||
: str[i] == 'M' && str[i + 1] == 'a' && str[i + 2] == 'r' \
|
: str[i] == 'M' && str[i + 1] == 'a' && str[i + 2] == 'y' ? 5 \
|
||||||
? 3 \
|
: str[i] == 'J' && str[i + 1] == 'u' && str[i + 2] == 'n' ? 6 \
|
||||||
: str[i] == 'A' && str[i + 1] == 'p' && str[i + 2] == 'r' \
|
: str[i] == 'J' && str[i + 1] == 'u' && str[i + 2] == 'l' ? 7 \
|
||||||
? 4 \
|
: str[i] == 'A' && str[i + 1] == 'u' && str[i + 2] == 'g' ? 8 \
|
||||||
: str[i] == 'M' && str[i + 1] == 'a' && str[i + 2] == 'y' \
|
: str[i] == 'S' && str[i + 1] == 'e' && str[i + 2] == 'p' ? 9 \
|
||||||
? 5 \
|
: str[i] == 'O' && str[i + 1] == 'c' && str[i + 2] == 't' ? 10 \
|
||||||
: str[i] == 'J' && str[i + 1] == 'u' && str[i + 2] == 'n' \
|
: str[i] == 'N' && str[i + 1] == 'o' && str[i + 2] == 'v' ? 11 \
|
||||||
? 6 \
|
: str[i] == 'D' && str[i + 1] == 'e' && str[i + 2] == 'c' ? 12 \
|
||||||
: str[i] == 'J' && str[i + 1] == 'u' && str[i + 2] == 'l' \
|
|
||||||
? 7 \
|
|
||||||
: str[i] == 'A' && str[i + 1] == 'u' && \
|
|
||||||
str[i + 2] == 'g' \
|
|
||||||
? 8 \
|
|
||||||
: str[i] == 'S' && str[i + 1] == 'e' && \
|
|
||||||
str[i + 2] == 'p' \
|
|
||||||
? 9 \
|
|
||||||
: str[i] == 'O' && str[i + 1] == 'c' && \
|
|
||||||
str[i + 2] == 't' \
|
|
||||||
? 10 \
|
|
||||||
: str[i] == 'N' && \
|
|
||||||
str[i + 1] == 'o' && \
|
|
||||||
str[i + 2] == 'v' \
|
|
||||||
? 11 \
|
|
||||||
: str[i] == 'D' && \
|
|
||||||
str[i + 1] == 'e' && \
|
|
||||||
str[i + 2] == 'c' \
|
|
||||||
? 12 \
|
|
||||||
: 0)
|
: 0)
|
||||||
|
|
||||||
// extract the information from the time string given by __TIME__ and __DATE__
|
// extract the information from the time string given by __TIME__ and __DATE__
|
||||||
|
Loading…
Reference in New Issue
Block a user