-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtrigger_iface.h
More file actions
50 lines (36 loc) · 1.08 KB
/
trigger_iface.h
File metadata and controls
50 lines (36 loc) · 1.08 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
#ifndef TRIGGER_IFACE_H
#define TRIGGER_IFACE_H
#include <memory>
#include <optional>
#include <vector>
#include "controllers.h"
#include "decoders.h"
namespace trigger_iface {
/* forward declaration */
struct trigger_iface_regs;
class Core: public RegisterDecoder {
std::unique_ptr<struct trigger_iface_regs> regs_storage;
struct trigger_iface_regs ®s;
void decode() override;
public:
Core(struct pcie_bars &);
~Core() override;
};
class Controller: public RegisterController {
protected:
std::unique_ptr<struct trigger_iface_regs> regs_storage;
struct trigger_iface_regs ®s;
void encode_params() override;
public:
Controller(struct pcie_bars &);
~Controller();
void write_params() override;
struct parameters {
/* rcv_count_rst and transm_count_rst are cleared automatically */
std::optional<bool> direction, direction_polarity, rcv_count_rst, transm_count_rst;
std::optional<uint8_t> rcv_len, transm_len;
};
std::vector<struct parameters> parameters;
};
} /* namespace trigger_iface */
#endif