μHAL
fofb_cc.h
1#ifndef FOFB_CC_H
2#define FOFB_CC_H
3
4#include <memory>
5
6#include "controllers.h"
7#include "decoders.h"
8
9namespace fofb_cc {
10
11/* forward declaration */
12struct fofb_cc_regs;
13
14class Core : public RegisterDecoder {
15 std::unique_ptr<struct fofb_cc_regs> regs_storage;
16 struct fofb_cc_regs &regs;
17
18 void read() override;
19 void decode() override;
20
21public:
22 Core(struct pcie_bars &);
23 ~Core() override;
24};
25
27protected:
28 std::unique_ptr<struct fofb_cc_regs> regs_storage;
29 struct fofb_cc_regs &regs;
30
31 void get_internal_values();
32 void encode_params() override;
33
34public:
35 Controller(struct pcie_bars &);
37
38 /* err_clr, toa_rd_str, rcb_rd_str are cleared automatically */
39 std::optional<bool> err_clr, cc_enable, tfs_override, toa_rd_en, toa_rd_str,
40 rcb_rd_en, rcb_rd_str;
41
42 std::optional<uint16_t> bpm_id, time_frame_len;
43 std::optional<bool> mgt_powerdown, mgt_loopback;
44 std::optional<uint16_t> time_frame_delay;
45 std::optional<bool> rx_polarity;
46 std::optional<uint32_t> payload_sel, fofb_data_sel;
47
48 void write_params() override;
49};
50
51} /* namespace fofb_cc */
52
53#endif
Definition: controllers.h:7
Definition: decoders.h:97
Definition: fofb_cc.h:26
void encode_params() override
Definition: fofb_cc.cc:199
void write_params() override
Definition: fofb_cc.cc:243
Definition: fofb_cc.h:14
void decode() override
Definition: fofb_cc.cc:137
void read() override
Definition: fofb_cc.cc:125
Definition: pcie-defs.h:19