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