DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
WIB_History.cpp
Go to the documentation of this file.
1#include "wibmod/WIB1/WIB.hh"
2
3std::vector<uint32_t>
4WIB::CaptureHistory(std::string const& address)
5{
6 std::vector<uint32_t> ret;
7 uint32_t val;
8 while ((val = Read(address)) & 0x1) {
9 ret.push_back(val);
10 }
11 return ret;
12}
13
14std::vector<uint128_t>
15WIB::CaptureHistory(std::string const& address, size_t wordCount)
16{
17 std::vector<uint128_t> ret;
18 bool capture = true;
19 uint16_t addr = GetItem(address)->address;
20 while (capture) {
21 uint128_t val = 0;
22 // Read address last since it causes the incr.
23 for (size_t offset = wordCount; offset > 0; offset--) {
24 val |= uint128_t(Read(addr + (offset - 1)) << 32 * (offset - 1));
25 }
26 ret.push_back(val);
27 if (!(val & 0x1)) {
28 break;
29 }
30 }
31 return ret;
32}
unsigned __int128 uint128_t
Definition WIB.hh:14
uint16_t address
Item const * GetItem(std::string const &)
Definition WIBBase.cpp:125
uint32_t Read(uint16_t address)
Definition WIBBase.cpp:147
std::vector< uint32_t > CaptureHistory(std::string const &address)
double offset