DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
CardControllerWrapper.hpp
Go to the documentation of this file.
1
8#ifndef FLXLIBS_SRC_CARDCONTROLLERWRAPPER_HPP_
9#define FLXLIBS_SRC_CARDCONTROLLERWRAPPER_HPP_
10
12#include "flxcard/FlxCard.h"
13
14#include <nlohmann/json.hpp>
15
16#include <memory>
17#include <mutex>
18#include <string>
19
20namespace dunedaq {
21namespace appmodel {
22 class FelixInterface;
23 class FelixDataSender;
24}
25namespace flxlibs {
26
28{
29public:
33 CardControllerWrapper(uint32_t device_id, const appmodel::FelixInterface * flx_cfg, const std::vector<const appmodel::FelixDataSender*>& flx_senders);
39
40 using data_t = nlohmann::json;
41 void init();
42 void configure(uint16_t super_chunk_size, bool emu_fanout);
43
44 uint64_t get_register(std::string key); // NOLINT(build/unsigned)
45 void set_register(std::string key, uint64_t value); // NOLINT(build/unsigned)
46 uint64_t get_bitfield(std::string key); // NOLINT(build/unsigned)
47 void set_bitfield(std::string key, uint64_t value); // NOLINT(build/unsigned)
48 void gth_reset();
49 void check_alignment(uint64_t aligned);
50
51protected:
52 void generate_opmon_data() override;
53
54private:
55
56 // Card
57 void open_card();
58 void close_card();
59
60 // Card object
61 uint32_t m_device_id;
62
63
64 using UniqueFlxCard = std::unique_ptr<FlxCard>;
65
67 const std::vector<const appmodel::FelixDataSender*> m_flx_senders;
68
70 std::mutex m_card_mutex;
71};
72
73} // namespace flxlibs
74} // namespace dunedaq
75
76#endif // FLXLIBS_SRC_CARDCONTROLLERWRAPPER_HPP_
CardControllerWrapper & operator=(CardControllerWrapper &&)=delete
Not move-assignable.
void configure(uint16_t super_chunk_size, bool emu_fanout)
const std::vector< const appmodel::FelixDataSender * > m_flx_senders
CardControllerWrapper(uint32_t device_id, const appmodel::FelixInterface *flx_cfg, const std::vector< const appmodel::FelixDataSender * > &flx_senders)
CardControllerWrapper Constructor.
const appmodel::FelixInterface * m_flx_cfg
CardControllerWrapper(const CardControllerWrapper &)=delete
Not copy-constructible.
void set_register(std::string key, uint64_t value)
void set_bitfield(std::string key, uint64_t value)
CardControllerWrapper & operator=(const CardControllerWrapper &)=delete
Not copy-assignable.
CardControllerWrapper(CardControllerWrapper &&)=delete
Not move-constructible.
Including Qt Headers.