-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathafc_timing.h
More file actions
56 lines (39 loc) · 1.09 KB
/
afc_timing.h
File metadata and controls
56 lines (39 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef AFC_TIMING_H
#define AFC_TIMING_H
#include <memory>
#include <string>
#include <vector>
#include "controllers.h"
#include "decoders.h"
namespace afc_timing {
/* forward declaration */
struct afc_timing;
class Core: public RegisterDecoder {
std::unique_ptr<struct afc_timing> regs_storage;
struct afc_timing ®s;
void decode() override;
public:
Core(struct pcie_bars &);
~Core() override;
};
class Controller: public RegisterDecoderController {
std::unique_ptr<struct afc_timing> regs_storage;
struct afc_timing ®s;
Core dec;
void encode_params() override;
void unset_commands() override;
/** Configuration values for RTM and AFC reference clocks */
struct clock {
uint64_t rfreq;
uint8_t n1, hs_div;
} rtm_clock = {}, afc_clock = {};
static bool set_freq(double, struct Controller::clock &);
public:
Controller(struct pcie_bars &);
~Controller();
static const std::vector<std::string> sources_list;
bool set_rtm_freq(double);
bool set_afc_freq(double);
};
} /* namespace afc_timing */
#endif