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
11#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 {
22class FelixInterface;
23class FelixDataSender;
24}
25namespace flxlibs {
26
28{
29public:
33 CardControllerWrapper(uint32_t device_id,
34 const appmodel::FelixInterface* flx_cfg,
35 const std::vector<const appmodel::FelixDataSender*>& flx_senders);
41
42 using data_t = nlohmann::json;
43 void init();
44 void configure(uint16_t super_chunk_size, bool emu_fanout);
45
46 uint64_t get_register(std::string key); // NOLINT(build/unsigned)
47 void set_register(std::string key, uint64_t value); // NOLINT(build/unsigned)
48 uint64_t get_bitfield(std::string key); // NOLINT(build/unsigned)
49 void set_bitfield(std::string key, uint64_t value); // NOLINT(build/unsigned)
50 void gth_reset();
51 void check_alignment(uint64_t aligned);
52
53protected:
54 void generate_opmon_data() override;
55
56private:
57 // Card
58 void open_card();
59 void close_card();
60
61 // Card object
62 uint32_t m_device_id;
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.
The DUNE-DAQ namespace.