2021-11-01 12:41:20 +01:00
|
|
|
#ifndef LINUX_OBC_PDECCONFIG_H_
|
|
|
|
#define LINUX_OBC_PDECCONFIG_H_
|
|
|
|
|
|
|
|
#include "fsfw/returnvalues/HasReturnvaluesIF.h"
|
|
|
|
#include <cstring>
|
|
|
|
|
|
|
|
/**
|
2021-11-02 11:11:38 +01:00
|
|
|
* @brief This class generates the configuration words for the configuration memory of the PDEC
|
|
|
|
* IP Cores.
|
|
|
|
*
|
|
|
|
* @details Fields are initialized according to pecification in PDEC datasheet section 6.11.3.1
|
|
|
|
* PROM usage.
|
2021-11-01 12:41:20 +01:00
|
|
|
*
|
|
|
|
* @author J. Meier
|
|
|
|
*/
|
2021-11-02 11:11:38 +01:00
|
|
|
class PdecConfig {
|
|
|
|
|
|
|
|
public:
|
|
|
|
PdecConfig();
|
|
|
|
virtual ~PdecConfig();
|
2021-11-01 12:41:20 +01:00
|
|
|
|
2021-11-02 11:11:38 +01:00
|
|
|
/**
|
|
|
|
* @brief Returns the configuration word by specifying the position.
|
|
|
|
*/
|
|
|
|
uint32_t getConfigWord(uint8_t wordNo);
|
2021-11-01 12:41:20 +01:00
|
|
|
|
2021-11-02 11:11:38 +01:00
|
|
|
private:
|
2021-11-01 12:41:20 +01:00
|
|
|
// TC transfer frame configuration parameters
|
|
|
|
static const uint8_t VERSION_ID = 0;
|
2021-11-02 11:11:38 +01:00
|
|
|
// BD Frames
|
|
|
|
static const uint8_t BYPASS_FLAG = 1;
|
2021-11-01 18:11:29 +01:00
|
|
|
static const uint8_t CONTROL_COMMAND_FLAG = 0;
|
2021-11-02 11:11:38 +01:00
|
|
|
|
2021-11-01 12:41:20 +01:00
|
|
|
static const uint8_t VIRTUAL_CHANNEL = 0;
|
|
|
|
static const uint8_t RESERVED_FIELD_A = 0;
|
|
|
|
static const uint16_t SPACECRAFT_ID = 0x274;
|
2021-11-02 11:11:38 +01:00
|
|
|
static const uint16_t DUMMY_BITS = 0;
|
2021-11-01 12:41:20 +01:00
|
|
|
// Parameters to control the FARM for AD frames
|
2021-11-02 11:11:38 +01:00
|
|
|
// Set here for future use
|
2021-11-01 12:41:20 +01:00
|
|
|
static const uint8_t POSITIVE_WINDOW = 10;
|
|
|
|
static const uint8_t NEGATIVE_WINDOW = 151;
|
2021-11-03 18:19:36 +01:00
|
|
|
static const uint8_t HIGH_AU_MAP_ID = 0xF;
|
|
|
|
static const uint8_t ENABLE_DERANDOMIZER = 1;
|
2021-11-02 11:11:38 +01:00
|
|
|
|
|
|
|
static const uint8_t CONFIG_WORDS_NUM = 2;
|
|
|
|
|
|
|
|
uint32_t configWords[CONFIG_WORDS_NUM];
|
|
|
|
|
|
|
|
void initialize();
|
2021-11-01 12:41:20 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* LINUX_OBC_PDECCONFIG_H_ */
|