μHAL
fofb_processing.h
1#ifndef FOFB_PROCESSING_H
2#define FOFB_PROCESSING_H
3
4#include <memory>
5#include <vector>
6
7#include "controllers.h"
8#include "decoders.h"
9
10namespace fofb_processing {
11
12/* forward declaration */
13struct wb_fofb_processing_regs;
14
15class Core: public RegisterDecoder {
16 std::unique_ptr<struct wb_fofb_processing_regs> regs_storage;
17 struct wb_fofb_processing_regs &regs;
18
19 void decode() override;
20 void read_monitors() override;
21 void print(FILE *, bool) const override;
22
23 public:
24 Core(struct pcie_bars &);
25 ~Core();
26
27 std::vector<int32_t> ref_orb_x, ref_orb_y;
28 std::vector<std::vector<double>> coefficients_x, coefficients_y;
29};
30
32 protected:
33 std::unique_ptr<struct wb_fofb_processing_regs> regs_storage;
34 struct wb_fofb_processing_regs &regs;
35
36 void set_devinfo_callback() override;
37 void encode_params() override;
38
39 unsigned fixed_point_coeff, fixed_point_gains;
40
41 public:
42 Controller(struct pcie_bars &);
44
45 bool intlk_sta_clr = false, intlk_en_orb_distort = false, intlk_en_packet_loss = false;
46 unsigned orb_distort_limit = 0, min_num_packets = 0;
47
48 std::vector<int32_t> ref_orb_x, ref_orb_y;
49
50 struct parameters {
51 std::vector<double> coefficients_x, coefficients_y;
52 bool acc_clear = false, acc_freeze = false;
53 double acc_gain = 0;
54 uint32_t sp_limit_max = 0, sp_limit_min = 0;
56 uint32_t sp_decim_ratio = 1;
57 };
58 std::vector<struct parameters> parameters;
59
60 void write_params() override;
61};
62
63} /* namespace fofb_processing */
64
65#endif
Definition: controllers.h:7
Definition: decoders.h:97
Definition: fofb_processing.h:31
void set_devinfo_callback() override
Definition: fofb_processing.cc:168
void encode_params() override
Definition: fofb_processing.cc:175
void write_params() override
Definition: fofb_processing.cc:208
Definition: fofb_processing.h:15
void read_monitors() override
Definition: fofb_processing.cc:59
void decode() override
Definition: fofb_processing.cc:74
Definition: fofb_processing.h:50
uint32_t sp_decim_ratio
Definition: fofb_processing.h:56
Definition: pcie-defs.h:19