μ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
21 public:
22 Core(struct pcie_bars &);
23 ~Core() override;
24};
25
27 protected:
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
34 public:
35 Controller(struct pcie_bars &);
37
38 /* err_clr, toa_rd_str, rcb_rd_str are cleared automatically */
39 std::optional<bool>
40 err_clr, cc_enable, tfs_override,
41 toa_rd_en, toa_rd_str, rcb_rd_en, rcb_rd_str;
42
43 std::optional<uint16_t> bpm_id, time_frame_len;
44 std::optional<bool> mgt_powerdown, mgt_loopback;
45 std::optional<uint16_t> time_frame_delay;
46 std::optional<bool> rx_polarity;
47 std::optional<uint32_t> payload_sel, fofb_data_sel;
48
49 void write_params() override;
50};
51
52} /* namespace fofb_cc */
53
54#endif
Definition: controllers.h:7
Definition: decoders.h:97
Definition: fofb_cc.h:26
void encode_params() override
Definition: fofb_cc.cc:185
void write_params() override
Definition: fofb_cc.cc:229
Definition: fofb_cc.h:14
void decode() override
Definition: fofb_cc.cc:123
void read() override
Definition: fofb_cc.cc:112
Definition: pcie-defs.h:19