Files
archive
arduino
automation
bsp_egse
bsp_hosted
bsp_linux_board
bsp_q7s
bsp_te0720_1cfa
cmake
common
doc
fsfw
generators
linux
boardtest
callbacks
csp
devices
fsfwconfig
obc
AxiPtmeConfig.cpp
AxiPtmeConfig.h
CMakeLists.txt
PapbVcInterface.cpp
PapbVcInterface.h
PdecConfig.cpp
PdecConfig.h
PdecHandler.cpp
PdecHandler.h
Ptme.cpp
Ptme.h
PtmeConfig.cpp
PtmeConfig.h
PtmeIF.h
VcInterfaceIF.h
utility
CMakeLists.txt
ObjectFactory.cpp
ObjectFactory.h
misc
mission
scripts
test
thirdparty
tmtc
unittest
watchdog
.clang-format
.dockerignore
.gitignore
.gitmodules
CMakeLists.txt
Justfile
LICENSE
NOTICE
README.md
docker-compose.yml
eive-obsw/linux/obc/PdecConfig.cpp
2022-01-17 15:58:27 +01:00

34 lines
858 B
C++

#include "PdecConfig.h"
#include "fsfw/serviceinterface/ServiceInterface.h"
PdecConfig::PdecConfig() { initialize(); }
PdecConfig::~PdecConfig() {}
void PdecConfig::initialize() {
uint32_t word = 0;
word |= (VERSION_ID << 30);
word |= (BYPASS_FLAG << 29);
word |= (CONTROL_COMMAND_FLAG << 28);
word |= (RESERVED_FIELD_A << 26);
word |= (SPACECRAFT_ID << 16);
word |= (VIRTUAL_CHANNEL << 10);
word |= (DUMMY_BITS << 8);
word |= POSITIVE_WINDOW;
configWords[0] = word;
word = 0;
word |= (NEGATIVE_WINDOW << 24);
word |= (HIGH_AU_MAP_ID << 16);
word |= (ENABLE_DERANDOMIZER << 8);
configWords[1] = word;
}
uint32_t PdecConfig::getConfigWord(uint8_t wordNo) {
if (wordNo >= CONFIG_WORDS_NUM) {
sif::error << "PdecConfig::getConfigWord: Invalid word number" << std::endl;
return 0;
}
return configWords[wordNo];
}