only reset PTME on rate change init
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
EIVE/eive-obsw/pipeline/pr-main There was a failure building this commit

This commit is contained in:
Robin Müller 2023-06-26 14:39:03 +02:00
parent 91106feb82
commit 1cc62238c2
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
5 changed files with 14 additions and 0 deletions

View File

@ -41,6 +41,12 @@ ReturnValue_t AxiPtmeConfig::writeCaduRateReg(uint8_t rateVal) {
return returnvalue::OK;
}
uint8_t AxiPtmeConfig::readCaduRateReg() {
ReturnValue_t result = returnvalue::OK;
MutexGuard mg(mutex);
return static_cast<uint8_t>(*(baseAddress + CADU_BITRATE_REG));
}
void AxiPtmeConfig::enableTxclockManipulator() {
writeBit(COMMON_CONFIG_REG, true, BitPos::EN_TX_CLK_MANIPULATOR);
}

View File

@ -38,6 +38,7 @@ class AxiPtmeConfig : public SystemObject {
* frequency of the clock connected to the bit clock input of PTME.
*/
ReturnValue_t writeCaduRateReg(uint8_t rateVal);
uint8_t readCaduRateReg();
/**
* @brief Next to functions control the tx clock manipulator component

View File

@ -26,6 +26,11 @@ ReturnValue_t PtmeConfig::setRate(uint32_t bitRate) {
return axiPtmeConfig->writeCaduRateReg(static_cast<uint8_t>(rateVal));
}
uint32_t PtmeConfig::getRate() {
uint8_t rateReg = axiPtmeConfig->readCaduRateReg();
return (BIT_CLK_FREQ / (rateReg + 1));
}
void PtmeConfig::invertTxClock(bool invert) {
if (invert) {
axiPtmeConfig->enableTxclockInversion();

View File

@ -32,6 +32,7 @@ class PtmeConfig : public SystemObject {
* of the CADU clock due to the convolutional code added by the s-Band transceiver.
*/
ReturnValue_t setRate(uint32_t bitRate);
uint32_t getRate();
/**
* @brief Will change the time the tx data signal is updated with respect to the tx clock

View File

@ -255,6 +255,7 @@ void CcsdsIpCoreHandler::startTransition(Mode_t mode, Submode_t submode) {
updateContext.setModeAfterUpdate = true;
return;
}
if(ptmeConfig.setRate(bitRate))
// No rate change, so enable transmitter right away.
enableTransmit();
} else if (mode == HasModesIF::MODE_OFF) {