eive-obsw/linux/obc/PtmeRateSetter.cpp
Robin Mueller 5cc7331e90
Some checks failed
EIVE/eive-obsw/pipeline/head There was a failure building this commit
applied clang formatting
2022-01-18 11:41:19 +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;
}