Changeset 11375
- Timestamp:
- 07/13/11 14:57:18 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/HeadersFAD.h
r11210 r11375 17 17 enum Enable 18 18 { 19 kCmdDrsEnable = 0x0600, // CMD_DENABLE/CMD_DISABLE20 kCmdDwrite = 0x0800, // CMD_DWRITE_RUN/CMD_DWRITE_STOP21 kCmdSclk = 0x1000, // CMD_SCLK_ON/OFF22 kCmdSrclk = 0x1500, // CMD_SRCLK_ON/OFF23 kCmdTriggerLine = 0x1800, // CMD_TRIGGERS_ON/CMD_TRIGGERS_OFF24 kCmdContTrigger = 0x1f00,25 kCmdRun = 0x2200, // CMD_Start/Stop26 kCmdBusy = 0x2400, //27 kCmdReset TriggerId= 0x2A00, //28 kCmdSocket = 0x3000, // CMD_mode_command/CMD_mode_all_sockets29 kCmdSingleTrigger = 0xA000, // CMD_Trigger19 kCmdDrsEnable = 0x0600, // CMD_DENABLE/CMD_DISABLE 20 kCmdDwrite = 0x0800, // CMD_DWRITE_RUN/CMD_DWRITE_STOP 21 kCmdSclk = 0x1000, // CMD_SCLK_ON/OFF 22 kCmdSrclk = 0x1500, // CMD_SRCLK_ON/OFF 23 kCmdTriggerLine = 0x1800, // CMD_TRIGGERS_ON/CMD_TRIGGERS_OFF 24 kCmdContTrigger = 0x1f00, 25 kCmdRun = 0x2200, // CMD_Start/Stop 26 kCmdBusy = 0x2400, // 27 kCmdResetEventCounter = 0x2A00, // 28 kCmdSocket = 0x3000, // CMD_mode_command/CMD_mode_all_sockets 29 kCmdSingleTrigger = 0xA000, // CMD_Trigger 30 30 }; 31 31 … … 60 60 kDisconnected, 61 61 kConnecting, 62 kConnected 62 kConnected, 63 kConfiguring, 64 kConfigured 63 65 }; 64 66 … … 267 269 } 268 270 271 bool operator==(const EventHeader &h) const 272 { 273 return 274 fStatus == h.fStatus && 275 fRunNumber == h.fRunNumber && 276 fEventCounter == h.fEventCounter && 277 fAdcClockPhaseShift == h.fAdcClockPhaseShift && 278 fTriggerGeneratorPrescaler == h.fTriggerGeneratorPrescaler && 279 memcmp(fDac, h.fDac, sizeof(fDac))==0; 280 } 281 269 282 float GetTemp(int i) const { return fTempDrs[i]/16.; } 270 283 … … 276 289 : (fTempDrs[i]&0x007fff))>>3)/16.; }*/ 277 290 278 uint8_t PLLLCK() const { return 291 uint8_t PLLLCK() const { return fStatus>>12; } 279 292 280 293 bool HasDenable() const { return fStatus&kDenable; } … … 342 355 // 0x4242 343 356 // 0x04fe 344 /* 345 struct DimPassport 346 { 347 uint32_t fTimeStamp; 348 349 uint16_t fVersion; 350 uint16_t fBoardId; 351 uint64_t fDNA; // Xilinx DNA 352 353 DimPassport(const EventHeader &h) : 354 fTimeStamp(h.fTimeStamp), 355 fVersion(h.fVersion), 356 fBoardId(h.fBoardId), 357 fDNA(h.fDNA) 358 { 359 } 360 361 } __attribute__((__packed__)); 362 363 struct DimSetup 364 { 365 uint32_t fTimeStamp; 366 367 uint32_t fFreqRefClock; 368 uint16_t fStatus; 369 uint16_t fAdcClockPhaseShift; 370 uint16_t fNumTriggersToGenerate; 371 uint16_t fTriggerGeneratorPrescaler; 372 uint16_t fDac[kNumDac]; 373 374 DimSetup(const EventHeader &h) : 375 fTimeStamp(h.fTimeStamp), 376 fFreqRefClock(h.fFreqRefClock), 377 fStatus(h.fStatus), 378 fAdcClockPhaseShift(h.fAdcClockPhaseShift), 379 fNumTriggersToGenerate(h.fNumTriggersToGenerate), 380 fTriggerGeneratorPrescaler(h.fTriggerGeneratorPrescaler) 381 { 382 memcpy(fDac, h.fDac, sizeof(fDac)); 383 } 384 385 uint8_t PLLLCK() const { return fStatus>>12; } 386 387 bool HasDenable() const { return fStatus&EventHeader::kDenable; } 388 bool HasDwrite() const { return fStatus&EventHeader::kDwrite; } 389 bool IsRefClockTooHigh() const { return fStatus&EventHeader::kRefClkTooHigh; } 390 bool IsRefClockTooLow() const { return fStatus&EventHeader::kRefClkTooLow; } 391 bool IsDcmLocked() const { return fStatus&EventHeader::kDcmLocked; } 392 bool IsDcmReady() const { return fStatus&EventHeader::kDcmReady; } 393 bool HasSpiSclk() const { return fStatus&EventHeader::kSpiSclk; } 394 395 } __attribute__((__packed__)); 396 397 struct DimTemperatures 398 { 399 uint32_t fTimeStamp; 400 401 float fTempDrs[kNumTemp]; 402 403 DimTemperatures(const EventHeader &h) : 404 fTimeStamp(h.fTimeStamp) 405 { 406 for (int i=0; i<kNumTemp; i++) 407 fTempDrs[i] = h.GetTemp(i); 408 } 409 410 } __attribute__((__packed__));; 411 412 struct DimEventHeader 413 { 414 uint32_t fTimeStamp; 415 416 uint32_t fRunNumber; 417 uint32_t fEventCounter; 418 uint16_t fTriggerCrc; 419 uint16_t fTriggerType; 420 uint32_t fTriggerId; 421 422 DimEventHeader(const EventHeader &h) : 423 fTimeStamp(h.fTimeStamp), 424 fRunNumber(h.fRunNumber), 425 fEventCounter(h.fEventCounter), 426 fTriggerCrc(h.fTriggerCrc), 427 fTriggerType(h.fTriggerType), 428 fTriggerId(h.fTriggerId) 429 { 430 } 431 432 } __attribute__((__packed__)); 433 */ 357 358 struct Configuration 359 { 360 bool fDwrite; 361 bool fDenable; 362 bool fContinousTrigger; 363 uint16_t fTriggerRate; 364 uint16_t fRoi[FAD::kNumChannelsPerChip]; 365 uint16_t fDac[FAD::kNumDac]; 366 367 #ifdef __cplusplus 368 Configuration() { init(*this); } 369 #endif 370 }; 371 434 372 // -------------------------------------------------------------------- 435 373 #ifdef __cplusplus
Note:
See TracChangeset
for help on using the changeset viewer.