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> WIB::CaptureHistory(std::string const & address){
4 std::vector<uint32_t> ret;
5 uint32_t val;
6 while( (val = Read(address)) & 0x1){
7 ret.push_back(val);
8 }
9 return ret;
10}
11
12std::vector<uint128_t> WIB::CaptureHistory(std::string const & address,size_t wordCount){
13 std::vector<uint128_t> ret;
14 bool capture = true;
15 uint16_t addr = GetItem(address)->address;
16 while(capture){
17 uint128_t val = 0;
18 //Read address last since it causes the incr.
19 for(size_t offset = wordCount;offset > 0;offset--){
20 val |= uint128_t(Read(addr+(offset-1)) << 32*(offset-1));
21 }
22 ret.push_back(val);
23 if(!(val & 0x1)){
24 break;
25 }
26 }
27 return ret;
28}
unsigned __int128 uint128_t
Definition WIB.hh:14
uint16_t address
Item const * GetItem(std::string const &)
Definition WIBBase.cpp:103
uint32_t Read(uint16_t address)
Definition WIBBase.cpp:119
std::vector< uint32_t > CaptureHistory(std::string const &address)
double offset