eive-obsw/linux/obc/PtmeRateSetter.h
2021-11-21 18:07:05 +01:00

41 lines
1.1 KiB
C++

#ifndef LINUX_OBC_PTMERATESETTER_H_
#define LINUX_OBC_PTMERATESETTER_H_
#include "TxRateSetterIF.h"
#include "fsfw_hal/common/gpio/gpioDefinitions.h"
#include "fsfw_hal/common/gpio/GpioIF.h"
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
/**
* @brief Class to set the downlink bit rate by using the cadu_rate_switcher implemented in
* the programmable logic.
*
* @details The cadu_rate_switcher module sets the input rate to the syrlinks transceiver either
* to 2000 kHz (bitrateSel = 1) or 400 kHz (bitrate = 0).
*
* @author J. Meier
*/
class PtmeRateSetter: public TxRateSetterIF {
public:
/**
* @brief Constructor
*
* @param bitrateSel GPIO ID of the GPIO connected to the bitrate_sel input of the
* cadu_rate_switcher.
* @param gpioif GPIO interface to drive the bitrateSel GPIO
*/
PtmeRateSetter(gpioId_t bitrateSel, GpioIF* gpioif);
virtual ~PtmeRateSetter();
virtual ReturnValue_t setRate(BitRates rate);
private:
gpioId_t bitrateSel = gpio::NO_GPIO;
GpioIF* gpioif = nullptr;
};
#endif /* LINUX_OBC_PTMERATESETTER_H_ */