eive-obsw/linux/obc/PtmeRateSetter.h

49 lines
1.6 KiB
C
Raw Normal View History

2021-11-21 18:07:05 +01:00
#ifndef LINUX_OBC_PTMERATESETTER_H_
#define LINUX_OBC_PTMERATESETTER_H_
#include "TxRateSetterIF.h"
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
2022-01-24 07:43:14 +01:00
#include "linux/obc/PtmeAxiConfig.h"
#include "linux/obc/PtmeConfig.h"
#include "fsfw/objectmanager/SystemObject.h"
2021-11-21 18:07:05 +01:00
/**
2022-01-24 07:43:14 +01:00
* @brief Class to set the downlink bit rate by writing to the AXI configuration interface of the
* PTME IP core.
2021-11-21 18:07:05 +01:00
*
2022-01-24 07:43:14 +01:00
* @details This is the bitrate of the CADU clock and not the downlink which has twice the bitrate
* of the CADU clock due to the convolutional code added by the s-Band transceiver.
2021-11-21 18:07:05 +01:00
*
* @author J. Meier
*/
class PtmeRateSetter : public TxRateSetterIF, public SystemObject, public HasReturnvaluesIF {
public:
/**
* @brief Constructor
*
* objectId Object id of system object
* ptmeAxiConfig Pointer to object providing access to PTME configuration registers.
*/
PtmeRateSetter(object_id_t objectId, PtmeAxiConfig* ptmeAxiConfig);
virtual ~PtmeRateSetter();
virtual ReturnValue_t initialize() override;
virtual ReturnValue_t setRate(uint32_t bitRate);
private:
static const uint8_t INTERFACE_ID = CLASS_ID::RATE_SETTER;
//! [EXPORT] : [COMMENT] The commanded rate is not supported by the current FPGA design
static const ReturnValue_t RATE_NOT_SUPPORTED = MAKE_RETURN_CODE(0xA0);
//! [EXPORT] : [COMMENT] Bad bitrate has been commanded (e.g. 0)
static const ReturnValue_t BAD_BIT_RATE = MAKE_RETURN_CODE(0xA1);
// Bitrate register field is only 8 bit wide
static const uint32_t MAX_BITRATE = 0xFF;
PtmeAxiConfig* ptmeAxiConfig = nullptr;
2021-11-21 18:07:05 +01:00
};
#endif /* LINUX_OBC_PTMERATESETTER_H_ */