eive-obsw/linux/obc/PtmeRateSetter.cpp
Robin Mueller 77c45c0de9
Some checks failed
EIVE/eive-obsw/pipeline/head Build queued...
EIVE/eive-obsw/pipeline/pr-develop There was a failure building this commit
applied formatting
2022-01-17 15:58:27 +01:00

26 lines
697 B
C++

#include "PtmeRateSetter.h"
#include "fsfw/serviceinterface/ServiceInterface.h"
PtmeRateSetter::PtmeRateSetter(gpioId_t bitrateSel, GpioIF* gpioif)
: bitrateSel(bitrateSel), gpioif(gpioif) {}
PtmeRateSetter::~PtmeRateSetter() {}
ReturnValue_t PtmeRateSetter::setRate(BitRates rate) {
ReturnValue_t result = HasReturnvaluesIF::RETURN_OK;
switch (rate) {
case RATE_2000KHZ:
result = gpioif->pullHigh(bitrateSel);
break;
case RATE_400KHZ:
result = gpioif->pullLow(bitrateSel);
break;
default:
sif::debug << "PtmeRateSetter::setRate: Invalid rate" << std::endl;
result = HasReturnvaluesIF::RETURN_FAILED;
break;
}
return result;
}