refactored TM funnels to allow multiple TM recipients
This commit is contained in:
50
linux/ipcore/PtmeConfig.cpp
Normal file
50
linux/ipcore/PtmeConfig.cpp
Normal file
@ -0,0 +1,50 @@
|
||||
#include "PtmeConfig.h"
|
||||
|
||||
#include "fsfw/serviceinterface/ServiceInterface.h"
|
||||
|
||||
PtmeConfig::PtmeConfig(object_id_t objectId, AxiPtmeConfig* axiPtmeConfig)
|
||||
: SystemObject(objectId), axiPtmeConfig(axiPtmeConfig) {}
|
||||
|
||||
PtmeConfig::~PtmeConfig() {}
|
||||
|
||||
ReturnValue_t PtmeConfig::initialize() {
|
||||
if (axiPtmeConfig == nullptr) {
|
||||
sif::warning << "PtmeConfig::initialize: Invalid AxiPtmeConfig object" << std::endl;
|
||||
return returnvalue::FAILED;
|
||||
}
|
||||
return returnvalue::OK;
|
||||
}
|
||||
|
||||
ReturnValue_t PtmeConfig::setRate(uint32_t bitRate) {
|
||||
if (bitRate == 0) {
|
||||
return BAD_BIT_RATE;
|
||||
}
|
||||
uint32_t rateVal = BIT_CLK_FREQ / bitRate - 1;
|
||||
if (rateVal > 0xFF) {
|
||||
return RATE_NOT_SUPPORTED;
|
||||
}
|
||||
return axiPtmeConfig->writeCaduRateReg(static_cast<uint8_t>(rateVal));
|
||||
}
|
||||
|
||||
ReturnValue_t PtmeConfig::invertTxClock(bool invert) {
|
||||
ReturnValue_t result = returnvalue::OK;
|
||||
if (invert) {
|
||||
result = axiPtmeConfig->enableTxclockInversion();
|
||||
} else {
|
||||
result = axiPtmeConfig->disableTxclockInversion();
|
||||
}
|
||||
if (result != returnvalue::OK) {
|
||||
return CLK_INVERSION_FAILED;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
ReturnValue_t PtmeConfig::configTxManipulator(bool enable) {
|
||||
ReturnValue_t result = returnvalue::OK;
|
||||
if (enable) {
|
||||
result = axiPtmeConfig->enableTxclockManipulator();
|
||||
} else {
|
||||
result = axiPtmeConfig->disableTxclockManipulator();
|
||||
}
|
||||
return result;
|
||||
}
|
Reference in New Issue
Block a user