DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
WIB.cpp
Go to the documentation of this file.
1#include "wibmod/WIB1/WIB.hh"
4#include <iostream>
5#include <stdio.h> //snprintf
6
7WIB::WIB(std::string const& address,
8 std::string const& WIBAddressTable,
9 std::string const& FEMBAddressTable,
10 bool fullStart)
11 : WIBBase(address, WIBAddressTable, FEMBAddressTable)
14 , FEMBCDACount(2)
19{
20
21 if (fullStart) {
22 // Figure out what kind of WIB firmware we are dealing with
23 FEMBCount = Read("SYSTEM.FEMB_COUNT");
24 DAQLinkCount = Read("SYSTEM.DAQ_LINK_COUNT");
25 // Hardcoded lookup for RCE and FELIX
26 if ((FEMBCount == 4) && (DAQLinkCount == 4)) {
27 DAQMode = RCE;
28 } else if ((FEMBCount == 4) && (DAQLinkCount == 2)) {
29 DAQMode = FELIX;
30 }
31 // TODO check FEMBStreamCount and FEMCDACount from registers on the WIB
32 // TODO create those registers
33 Write("POWER.ENABLE.MASTER_BIAS", 1);
34 started = true;
35 }
36}
37
39
40void
42{
43 // Figure out what kind of WIB firmware we are dealing with
44 FEMBCount = Read("SYSTEM.FEMB_COUNT");
45 DAQLinkCount = Read("SYSTEM.DAQ_LINK_COUNT");
46 // Hardcoded lookup for RCE and FELIX
47 if ((FEMBCount == 4) && (DAQLinkCount == 4)) {
48 DAQMode = RCE;
49 } else if ((FEMBCount == 4) && (DAQLinkCount == 2)) {
50 DAQMode = FELIX;
51 }
52 // TODO check FEMBStreamCount and FEMCDACount from registers on the WIB
53 // TODO create those registers
54 Write("POWER.ENABLE.MASTER_BIAS", 1);
55 started = true;
56}
57
58void
59WIB::EnableDAQLink(uint8_t iDAQLink)
60{
61 // CHeck if we know how to dael with this firmware
62 if (!((DAQMode == RCE) || (DAQMode == FELIX))) {
63 // Not RCE or FELIX firmware, return
64 BUException::WIB_FEATURE_NOT_SUPPORTED e;
65 e.Append("Automatic DAQLink configuration not supported with this firmware.\n");
66 throw e;
67 }
68
69 // Build the base string for this DAQLINK
70 std::string base("DAQ_LINK_");
71 base.push_back(GetDAQLinkChar(iDAQLink));
72 base.append(".CONTROL.");
73 printf("%s\n", base.c_str());
74
75 // set the CD stream enable mask from that
76 uint32_t enable_mask = 0;
77 for (size_t iStream = 0; iStream < (4 * FEMBCount / DAQLinkCount); iStream++) {
78 enable_mask <<= 0x1;
79 }
80
81 Write(base + "ENABLE_CDA_STREAM", enable_mask);
82
83 Write(base + "ENABLE", 0x1);
84}
85
86void
87WIB::EnableDAQLink_Lite(uint8_t iDAQLink, uint8_t enable)
88{
89 // CHeck if we know how to dael with this firmware
90 if (!((DAQMode == RCE) || (DAQMode == FELIX))) {
91 // Not RCE or FELIX firmware, return
92 BUException::WIB_FEATURE_NOT_SUPPORTED e;
93 e.Append("Automatic DAQLink configuration not supported with this firmware.\n");
94 throw e;
95 }
96
97 // Build the base string for this DAQLINK
98 std::string base("DAQ_LINK_");
99 base.push_back(GetDAQLinkChar(iDAQLink));
100 base.append(".CONTROL.");
101
102 uint8_t stream = 0;
103 if (enable) {
104 if (DAQMode == RCE)
105 stream = 0xF;
106 else
107 stream = 0xFF;
108 }
109
110 Write(base + "ENABLE_CDA_STREAM", stream);
111 Write(base + "ENABLE", enable);
112}
113
114/*void WIB::DisableDAQLink_Lite(uint8_t iDAQLink, uint8_t enable){
115 //CHeck if we know how to dael with this firmware
116 if(!((DAQMode == RCE)||(DAQMode == FELIX))){
117 //Not RCE or FELIX firmware, return
118 BUException::WIB_FEATURE_NOT_SUPPORTED e;
119 e.Append("Automatic DAQLink configuration not supported with this firmware.\n");
120 throw e;
121 }
122
123 //Build the base string for this DAQLINK
124 std::string base("DAQ_LINK_");
125 base.push_back(GetDAQLinkChar(iDAQLink));
126 base.append(".CONTROL.");
127
128 uint8_t stream = 0;
129 if(DAQMode == RCE) stream = 0xF;
130 else stream = 0xFF;
131
132 if(enable){
133 Write(base+"ENABLE_CDA_STREAM",stream);
134
135 Write(base+"ENABLE",enable);
136 }
137 else{
138 Write(base+"ENABLE_CDA_STREAM",0);
139 Write(base+"ENABLE",0);
140 }
141}*/
142
143void
145{
146 // run resets
147 Write("SYSTEM.RESET", 0xFF);
148 // Set clock settings
149 Write("POWER.ENABLE.MASTER_BIAS", 0x1); // Turn on DC/DC converter
150}
151
152// void WIB::ResetWIB(bool cntrlRegister=true, bool global=false, bool daq_path=false, bool udp=false){
153void
154WIB::ResetWIB(bool reset_udp)
155{
156
157 if (reset_udp) {
158 // Resetting the UDP will stop the reply packet which will cause an error.
159 try {
160 Write("SYSTEM.RESET.UDP_RESET", 1);
161 } catch (BUException::BAD_REPLY& e) {
162 // do nothing
163 }
164 // Since we don't know this happened since we lack a udp response, do it again.
165 // This could be extended to read register REG
166 usleep(10000);
167 try {
168 Write("SYSTEM.RESET.UDP_RESET", 1);
169 } catch (BUException::BAD_REPLY& e) {
170 // do nothing
171 }
172 usleep(10000);
173 }
174
175 // Reset the control register
176 WriteWithRetry("SYSTEM.RESET.CONTROL_REGISTER_RESET", 1);
177 usleep(1000);
178
179 // If this is felix, make sure we configure the SI5342
180 if (DAQMode == FELIX) {
181 Write("DAQ.SI5342.RESET", 1);
182 usleep(10000);
183 Write("DAQ.SI5342.RESET", 0);
184 usleep(10000);
185 printf("Configuring SI5342 for FELIX\n");
186 LoadConfigDAQ_SI5342("default"); // use the default config file for the SI5342
187 usleep(10000); // Wait for
188 SelectSI5342(1, // Set input to be local oscillator for FELIX clock
189 1); // enable the output of the SI5342
190 }
191
192 // Reset the Eventbuilder PLL
193 Write("SYSTEM.RESET.EB_PLL_RESET", 1);
194 usleep(10000);
195
196 // Reset the DAQ path
197 Write("SYSTEM.RESET.DAQ_PATH_RESET", 1);
198
199 usleep(10000);
200
201 // Set clock settings
202 Write("DTS.CMD_COUNT_RESET", 0xFFFFFFFF);
203 Write("DTS.CMD_COUNT_RESET", 0);
204
205 // Halt signals
206 Write("DTS.CONVERT_CONTROL.HALT", 1);
207 Write("DTS.CONVERT_CONTROL.ENABLE", 0);
208
209 // Make sure DC/DC is on
210 Write("POWER.ENABLE.MASTER_BIAS", 1);
211}
212
213void
214WIB::ResetWIBAndCfgDTS(uint8_t localClock, uint8_t PDTS_TGRP, uint8_t PDTSsource, uint32_t PDTSAlignment_timeout)
215{
216 if (DAQMode == UNKNOWN) {
217 BUException::WIB_DAQMODE_UNKNOWN e;
218 throw e;
219 }
220 if (localClock > 1) {
221 BUException::WIB_BAD_ARGS e;
222 e.Append("localClock > 1; must be 0 (for DTS) or 1 (for local clock)\n");
223 throw e;
224 }
225 if (PDTSsource > 1) {
226 BUException::WIB_BAD_ARGS e;
227 e.Append("PDTSsource > 1; must be 0 (for backplane) or 1 (for front panel)\n");
228 throw e;
229 }
230 if (16 <= PDTS_TGRP) {
231 BUException::WIB_BAD_ARGS e;
232 e.Append("PDTS TGRP > 15; must be 0 to 15\n");
233 throw e;
234 }
235
236 // get this register so we can leave it in the state it started in
237 uint32_t slow_control_dnd = Read("SYSTEM.SLOW_CONTROL_DND");
238
239 ResetWIB();
240 Write("SYSTEM.SLOW_CONTROL_DND", 1);
241 sleep(1);
242
243 for (size_t iFEMB = 1; iFEMB <= 4; iFEMB++) {
244 FEMBPower(iFEMB, 0);
245 }
246
247 // make sure everything DTS is off
248 Write("DTS.CONVERT_CONTROL.HALT", 1);
249 Write("DTS.CONVERT_CONTROL.ENABLE", 0);
250 Write("DTS.CONVERT_CONTROL.START_SYNC", 0);
251 sleep(1);
252
253 if (localClock > 0) {
254 printf("Configuring local clock\n");
255 // Configure the SI5344 to use the local oscillator instead of the PDTS
256 LoadConfigDTS_SI5344("default");
257 sleep(1);
258 SelectSI5344(1, 1);
259 sleep(1);
260 Write("DTS.CONVERT_CONTROL.EN_FAKE", 1);
261 Write("DTS.CONVERT_CONTROL.LOCAL_TIMESTAMP", 1);
262 Write("FEMB_CNC.CNC_CLOCK_SELECT", 1);
263 // Write("FEMB_CNC.ENABLE_DTS_CMDS",1);
264 sleep(1);
265 } else {
266 // Configure the clocking for the PDTS (assumes the PDTS is sending idle or something)
267 printf("Configuring DTS\n");
268 Write("DTS.PDTS_TGRP", PDTS_TGRP);
269 printf("Using timing group 0x%X\n", PDTS_TGRP);
270 InitializeDTS(PDTSsource, 0, PDTSAlignment_timeout);
271 sleep(1);
272 Write("FEMB_CNC.CNC_CLOCK_SELECT", 1);
273 sleep(1);
274 // We are ready for the PDTS, start searching
275 Write("DTS.PDTS_ENABLE", 1);
276 sleep(1);
277 }
278
279 // Now we have the 128MHz clock
280 Write("FEMB1.DAQ.ENABLE", 0);
281 Write("FEMB2.DAQ.ENABLE", 0);
282 Write("FEMB3.DAQ.ENABLE", 0);
283 Write("FEMB4.DAQ.ENABLE", 0);
284
285 Write("SYSTEM.SLOW_CONTROL_DND", slow_control_dnd);
286}
287
288void
289WIB::CheckedResetWIBAndCfgDTS(uint8_t localClock, uint8_t PDTS_TGRP, uint8_t PDTSsource, uint32_t PDTSAlignment_timeout)
290{
291 if (DAQMode == UNKNOWN) {
292 BUException::WIB_DAQMODE_UNKNOWN e;
293 throw e;
294 }
295 if (localClock > 1) {
296 BUException::WIB_BAD_ARGS e;
297 e.Append("localClock > 1; must be 0 (for DTS) or 1 (for local clock)\n");
298 throw e;
299 }
300 if (PDTSsource > 1) {
301 BUException::WIB_BAD_ARGS e;
302 e.Append("PDTSsource > 1; must be 0 (for backplane) or 1 (for front panel)\n");
303 throw e;
304 }
305 if (16 <= PDTS_TGRP) {
306 BUException::WIB_BAD_ARGS e;
307 e.Append("PDTS TGRP > 15; must be 0 to 15\n");
308 throw e;
309 }
310
311 bool reset_check = false;
312 // Check if we are already in a good state
313 if (localClock > 0) {
314 printf("Checking if locked on local clock\n");
315 reset_check = ((Read("DTS.CONVERT_CONTROL.EN_FAKE") != 1) || (Read("DTS.CCONVERT_CONTROL.LOCAL_TIMESTAMP") != 1) ||
316 (Read("FEMB_CNC.CNC_CLOCK_SELECT") != 1)
317 // || (Read("FEMB_CNC.ENABLE_DTS_CMDS") != 1)
318 || (Read("DTS.SI5344.INPUT_SELECT") != 1) || (Read("DTS.SI5344.ENABLE") != 1));
319 if (!reset_check) {
320 printf("Already in a good state\n");
321 } else {
322 printf("Need to reset for local clocking\n");
323 }
324 } else {
325 printf("Checking if locked on PDTS\n");
326 reset_check = ((Read("DTS.PDTS_TGRP") != PDTS_TGRP) || (Read("FEMB_CNC.CNC_CLOCK_SELECT") != 1) ||
327 (Read("DTS.PDTS_ENABLE") != 1) || (Read("DTS.CDS.LOL") != 0) || (Read("DTS.CDS.LOS") != 0) ||
328 (ReadWithRetry("DTS.SI5344.INPUT_SELECT") != 0) || (ReadWithRetry("DTS.SI5344.LOS") != 0) ||
329 (ReadWithRetry("DTS.SI5344.LOL") != 0) || (ReadWithRetry("DTS.SI5344.ENABLE") != 1) ||
330 (ReadWithRetry("DTS.PDTS_STATE") != 0x8));
331 if (!reset_check) {
332 printf("Already in a good state\n");
333 } else {
334 printf("Need to reset for PDTS\n");
335 }
336 }
337
338 // Check the SI5342 if we're attached to FELIX
339 if (DAQMode == FELIX) {
340
341 if ((Read("DAQ.SI5342.ENABLE") == 0) || (Read("DAQ.SI5342.INPUT_SELECT") != 1) || (Read("DAQ.SI5342.LOL") == 1) ||
342 (Read("DAQ.SI5342.LOS_XAXB") == 1) || (Read("DAQ.SI5342.LOS_2") == 1)) {
343 printf("Need to reset for SI5342\n");
344 reset_check = true;
345 } else {
346 printf("SI5342 in good state\n");
347 }
348 }
349
350 if (reset_check) {
351 // get this register so we can leave it in the state it started in
352 uint32_t slow_control_dnd = Read("SYSTEM.SLOW_CONTROL_DND");
353
354 ResetWIB();
355 Write("SYSTEM.SLOW_CONTROL_DND", 1);
356
357 for (size_t iFEMB = 1; iFEMB <= 4; iFEMB++) {
358 FEMBPower(iFEMB, 0);
359 }
360
361 // make sure everything DTS is off
362 Write("DTS.CONVERT_CONTROL.HALT", 1);
363 Write("DTS.CONVERT_CONTROL.ENABLE", 0);
364 Write("DTS.CONVERT_CONTROL.START_SYNC", 0);
365 sleep(1);
366
367 if (localClock > 0) {
368 printf("Configuring local clock\n");
369 // Configure the SI5344 to use the local oscillator instead of the PDTS
370 LoadConfigDTS_SI5344("default");
371 sleep(1);
372 SelectSI5344(1, 1);
373 sleep(1);
374 Write("DTS.CONVERT_CONTROL.EN_FAKE", 1);
375 Write("DTS.CONVERT_CONTROL.LOCAL_TIMESTAMP", 1);
376 Write("FEMB_CNC.CNC_CLOCK_SELECT", 1);
377 // Write("FEMB_CNC.ENABLE_DTS_CMDS",1);
378 sleep(1);
379 } else {
380 // Configure the clocking for the PDTS (assumes the PDTS is sending idle or something)
381 printf("Configuring DTS\n");
382 Write("DTS.PDTS_TGRP", PDTS_TGRP);
383 printf("Using timing group 0x%X\n", PDTS_TGRP);
384 InitializeDTS(PDTSsource, 0, PDTSAlignment_timeout);
385 sleep(1);
386 Write("FEMB_CNC.CNC_CLOCK_SELECT", 1);
387 sleep(1);
388 // We are ready for the PDTS, start searching
389 Write("DTS.PDTS_ENABLE", 1);
390 sleep(1);
391 }
392
393 Write("SYSTEM.SLOW_CONTROL_DND", slow_control_dnd);
394 }
395 // Now we have the 128MHz clock
396 std::cout << "Resetting DAQ Links" << std::endl;
397 size_t nLinks = 4;
398 if (DAQMode == FELIX) {
399 nLinks = 2;
400 }
401 for (size_t iLink = 1; iLink <= nLinks; ++iLink) {
402 std::cout << iLink << std::endl;
403 EnableDAQLink_Lite(iLink, 0);
404 }
405
406 Write("FEMB1.DAQ.ENABLE", 0);
407 Write("FEMB2.DAQ.ENABLE", 0);
408 Write("FEMB3.DAQ.ENABLE", 0);
409 Write("FEMB4.DAQ.ENABLE", 0);
410}
411
412void
413WIB::StartStreamToDAQ(bool link1_enabled, bool link2_enabled, bool link3_enabled, bool link4_enabled)
414{
415 if (DAQMode == UNKNOWN) {
416 BUException::WIB_DAQMODE_UNKNOWN e;
417 throw e;
418 }
419 WriteWithRetry("DTS.CONVERT_CONTROL.HALT", 1);
420 WriteWithRetry("DTS.CONVERT_CONTROL.ENABLE", 0);
421
422 // get this register so we can leave it in the state it started in
423 uint32_t slow_control_dnd = Read("SYSTEM.SLOW_CONTROL_DND");
424 Write("SYSTEM.SLOW_CONTROL_DND", 1);
425
426 sleep(1);
427 Write("FEMB_CNC.FEMB_STOP", 1);
428 sleep(1);
429 Write("SYSTEM.RESET.DAQ_PATH_RESET", 1);
430 sleep(1);
431
432 // Enable DAQ links
433 if (DAQMode == FELIX) {
434 if (link1_enabled)
435 EnableDAQLink_Lite(1, 1);
436 if (link2_enabled)
437 EnableDAQLink_Lite(2, 1);
438 } else {
439 if (link3_enabled)
440 EnableDAQLink_Lite(3, 1);
441 if (link4_enabled)
442 EnableDAQLink_Lite(4, 1);
443 }
444
445 // Enable the FEMB to align to idle and wait for convert
446 Write("FEMB1.DAQ.ENABLE", 0xF);
447 Write("FEMB2.DAQ.ENABLE", 0xF);
448 Write("FEMB3.DAQ.ENABLE", 0xF);
449 Write("FEMB4.DAQ.ENABLE", 0xF);
450
451 // Start sending characters from the FEMB
452 Write("FEMB_CNC.ENABLE_DTS_CMDS", 1);
453 StartSyncDTS();
454 // Write("FEMB_CNC.TIMESTAMP_RESET",1);
455 // Write("FEMB_CNC.FEMB_START",1);
456 // Write("SYSTEM.RESET.FEMB_COUNTER_RESET",1);
457
458 Write("SYSTEM.SLOW_CONTROL_DND", slow_control_dnd);
459}
460
461void
462WIB::FEMBPower(uint8_t iFEMB, bool turnOn)
463{
464 std::string reg = "POWER.ENABLE.FEMB";
465 reg.push_back(GetFEMBChar(iFEMB));
466 if (turnOn) {
467 Write(reg, 0x1F);
468 } else {
469 Write(reg, 0x0);
470 }
471}
472
473// void WIB::PowerOnFEMB(uint8_t iFEMB){
474// //Turn on power
475// std::string reg = "POWER.ENABLE.FEMB";
476// reg.push_back(GetFEMBChar(iFEMB));
477//
478//
479// const int REG_COUNT = 6;
480// uint8_t mon_reg_val = 0x1+REG_COUNT*(iFEMB-1); // starts at 0x1 and there are 6 per FEMB
481//
482// for(uint8_t iReg=0;iReg < REG_COUNT;iReg++){
483// //Go measure the reg value
484// // int iTries = 0;
485// // const int NUM_TRIES = 100;
486// //Set the value to be read
487// Write("POWER.MON_CONTROL.ADDRESS",mon_reg_val+iReg);
488// //Wait till the output is valid
498// uint32_t reg_val = Read("POWER.MON_VALUE.MEASUREMENT");
499// printf("Reg %u 0x%04X 0x%04X\n",iReg,reg_val >> 16,reg_val&0xFFFF);
500// // }
501// }
502//
503//}
504//
505void
507{
508 // Enable the clock and control stream to the FEMBs
509 Write("FEMB_CNC.CNC_CLOCK_SELECT", 1);
510 Write("FEMB_CNC.CNC_COMMAND_SELECT", 1);
511}
512void
514{
515 // Enable the clock and control stream to the FEMBs
516 Write("FEMB_CNC.CNC_CLOCK_SELECT", 0);
517 Write("FEMB_CNC.CNC_COMMAND_SELECT", 0);
518}
519
520bool
522{
523 if (!((iDAQLink > 0) && (iDAQLink <= DAQLinkCount))) {
524 BUException::WIB_INDEX_OUT_OF_RANGE e;
525 e.Append("DAQ Link\n");
526 throw e;
527 }
528 return true;
529}
530
531char
532WIB::GetDAQLinkChar(uint8_t iDAQLink)
533{
534 char c = '0';
535 // Check if the link is in range given DAQLinkCount (throws)
536 CheckDAQLinkInRange(iDAQLink);
537 // Convert the numeric daq link number to a char
538 switch (iDAQLink) {
539 case 1:
540 c = '1';
541 break;
542 case 2:
543 c = '2';
544 break;
545 case 3:
546 c = '3';
547 break;
548 case 4:
549 c = '4';
550 break;
551 default:
552 BUException::WIB_INDEX_OUT_OF_RANGE e;
553 e.Append("DAQ Link\n");
554 char estr[] = "0";
555 estr[0] = c;
556 e.Append(estr);
557 throw e;
558 }
559 return c;
560}
561
562bool
564{
565 if (!((iFEMB > 0) && (iFEMB <= FEMBCount))) {
566 BUException::WIB_INDEX_OUT_OF_RANGE e;
567 e.Append("FEMB\n");
568 throw e;
569 }
570 return true;
571}
572
573char
574WIB::GetFEMBChar(uint8_t iFEMB)
575{
576 char c = '0';
577 // Check if the link is in range given FEMBCount (throws)
578 CheckFEMBInRange(iFEMB);
579 // Convert the numeric daq link number to a char
580 switch (iFEMB) {
581 case 1:
582 c = '1';
583 break;
584 case 2:
585 c = '2';
586 break;
587 case 3:
588 c = '3';
589 break;
590 case 4:
591 c = '4';
592 break;
593 default:
594 BUException::WIB_INDEX_OUT_OF_RANGE e;
595 e.Append("FEMB\n");
596 char estr[] = "0";
597 estr[0] = c;
598 e.Append(estr);
599 throw e;
600 }
601 return c;
602}
603
604bool
606{
607 if (!((iStream > 0) && (iStream <= FEMBStreamCount))) {
608 BUException::WIB_INDEX_OUT_OF_RANGE e;
609 e.Append("FEMB Stream");
610 throw e;
611 }
612 return true;
613}
614
615bool
617{
618 if (!((iCDA > 0) && (iCDA <= FEMBCDACount))) {
619 BUException::WIB_INDEX_OUT_OF_RANGE e;
620 e.Append("FEMB CDA");
621 throw e;
622 }
623 return true;
624}
625
626char
628{
629 char c = '0';
630 // Check if the link is in range given FEMBCount (throws)
632 // Convert the numeric daq link number to a char
633 switch (iCD) {
634 case 1:
635 c = '1';
636 break;
637 case 2:
638 c = '2';
639 break;
640 default:
641 BUException::WIB_INDEX_OUT_OF_RANGE e;
642 e.Append("FEMB CDA\n");
643 char estr[] = "0";
644 estr[0] = c;
645 e.Append(estr);
646 throw e;
647 }
648 return c;
649}
650
651void
652WIB::SourceFEMB(uint64_t iFEMB, uint64_t real)
653{
654 if (iFEMB < 1) {
655 printf("FEMB index out of range < 1\n");
656 return;
657 }
658
659 /* if(DAQMode == RCE && iFEMB > 4){
660 printf("FEMB index out of range > 4 (RCE) \n");
661 return;}
662 if(DAQMode == FELIX && iFEMB > 2){
663 printf("FEMB index out of range > 2 (FELIX) \n");
664 return;}
665 */
666 std::string address("FEMB");
667 address.push_back(GetFEMBChar(iFEMB));
668 address.append(".DAQ.FAKE_CD.FAKE_SOURCE");
669 Write(address, real);
670}
#define sleep(x)
Definition WIB_FEMB.cpp:12
WIBBase(std::string const &address, std::string const &WIBAddressTable, std::string const &FEMBAddressTable)
Definition WIBBase.cpp:5
void WriteWithRetry(uint16_t address, uint32_t value)
Definition WIBBase.cpp:163
uint32_t ReadWithRetry(uint16_t address)
Definition WIBBase.cpp:142
uint32_t Read(uint16_t address)
Definition WIBBase.cpp:147
void Write(uint16_t address, uint32_t value)
Definition WIBBase.cpp:168
void EnableFEMBCNC()
Definition WIB.cpp:506
bool CheckFEMBStreamInRange(uint8_t iStream)
Definition WIB.cpp:605
bool ContinueOnFEMBRegReadError
Definition WIB.hh:237
void ResetWIB(bool reset_udp=false)
Definition WIB.cpp:154
@ UNKNOWN
Definition WIB.hh:208
@ FELIX
Definition WIB.hh:208
@ RCE
Definition WIB.hh:208
void EnableDAQLink(uint8_t iDAQLink)
Definition WIB.cpp:59
void LoadConfigDTS_SI5344(std::string const &fileName)
void DisableFEMBCNC()
Definition WIB.cpp:513
uint8_t FEMBCDACount
Definition WIB.hh:234
void CheckedResetWIBAndCfgDTS(uint8_t localClock, uint8_t PDTS_TGRP, uint8_t PDTSsource=0, uint32_t PDTSAlignment_timeout=0)
Definition WIB.cpp:289
bool ContinueOnFEMBSyncError
Definition WIB.hh:239
char GetFEMBCDChar(uint8_t iCD)
Definition WIB.cpp:627
void InitializeDTS(uint8_t PDTSsource=0, uint8_t clockSource=0, uint32_t PDTSAlignment_timeout=0)
Definition WIB_DTS.cpp:12
bool ContinueOnFEMBSPIError
Definition WIB.hh:238
void StartSyncDTS()
Definition WIB_DTS.cpp:143
void ResetWIBAndCfgDTS(uint8_t localClock, uint8_t PDTS_TGRP, uint8_t PDTSsource=0, uint32_t PDTSAlignment_timeout=0)
Definition WIB.cpp:214
char GetDAQLinkChar(uint8_t iDAQLink)
Definition WIB.cpp:532
uint8_t FEMBStreamCount
Definition WIB.hh:233
void EnableDAQLink_Lite(uint8_t iDAQLink, uint8_t enable)
Definition WIB.cpp:87
void SelectSI5344(uint64_t input, bool enable)
void SelectSI5342(uint64_t input, bool enable)
void FEMBPower(uint8_t iFEMB, bool turnOn)
Definition WIB.cpp:462
WIB_DAQ_t DAQMode
Definition WIB.hh:231
void SourceFEMB(uint64_t iDAQLink, uint64_t real)
Definition WIB.cpp:652
bool ContinueIfListOfFEMBClockPhasesDontSync
Definition WIB.hh:240
bool started
Definition WIB.hh:33
bool CheckFEMBCDInRange(uint8_t iCD)
Definition WIB.cpp:616
bool CheckDAQLinkInRange(uint8_t iDAQLink)
Definition WIB.cpp:521
uint8_t FEMBCount
Definition WIB.hh:232
uint8_t DAQLinkCount
Definition WIB.hh:235
void LoadConfigDAQ_SI5342(std::string const &fileName)
void InitializeWIB()
Definition WIB.cpp:144
char GetFEMBChar(uint8_t iFEMB)
Definition WIB.cpp:574
void FullStart()
Definition WIB.cpp:41
void StartStreamToDAQ(bool l1=true, bool l2=true, bool l3=false, bool l4=false)
Definition WIB.cpp:413
~WIB()
Definition WIB.cpp:38
bool CheckFEMBInRange(uint8_t iFEMB)
Definition WIB.cpp:563