class to generate pdec config words

This commit is contained in:
Jakob Meier
2021-11-02 11:11:38 +01:00
parent 9191d1ec33
commit 3e2f4e7a10
7 changed files with 89 additions and 50 deletions

View File

@ -5,29 +5,46 @@
#include <cstring>
/**
* @brief PDEC specific configuration parameters.
* @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.
*
* @author J. Meier
*/
namespace PdecConfig {
class PdecConfig {
// Access to register space of PDEC via the AXI to AHB bridge
static const char UIO_PDEC_REGISTERS[] = "/dev/uio0";
// Direct access to memory area in DDR assigned to PDEC
static const char UIO_PDEC_MEMORY[] = "/dev/uio2";
public:
PdecConfig();
virtual ~PdecConfig();
/**
* @brief Returns the configuration word by specifying the position.
*/
uint32_t getConfigWord(uint8_t wordNo);
private:
// TC transfer frame configuration parameters
static const uint8_t VERSION_ID = 0;
// static const uint8_t BYPASS_FLAG = 1;
// static const uint8_t CONTROL_COMMAND_FLAG = 1;
static const uint8_t BYPASS_FLAG = 0;
// BD Frames
static const uint8_t BYPASS_FLAG = 1;
static const uint8_t CONTROL_COMMAND_FLAG = 0;
static const uint8_t VIRTUAL_CHANNEL = 0;
static const uint8_t RESERVED_FIELD_A = 0;
static const uint16_t SPACECRAFT_ID = 0x274;
static const uint16_t DUMMY_BITS = 0;
// Parameters to control the FARM for AD frames
// Set here for future use
static const uint8_t POSITIVE_WINDOW = 10;
static const uint8_t NEGATIVE_WINDOW = 151;
static const uint8_t CONFIG_WORDS_NUM = 2;
uint32_t configWords[CONFIG_WORDS_NUM];
void initialize();
};
#endif /* LINUX_OBC_PDECCONFIG_H_ */