Changeset 10817
- Timestamp:
- 05/25/11 13:44:47 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/HeadersFAD.h
r10783 r10817 13 13 namespace FAD 14 14 { 15 enum Enable 16 { 17 kCmdDrsEnable = 0x0600, // CMD_DENABLE/CMD_DISABLE 18 kCmdDwrite = 0x0800, // CMD_DWRITE_RUN/CMD_DWRITE_STOP 19 kCmdSclk = 0x1000, // CMD_SCLK_ON/OFF 20 kCmdSrclk = 0x1500, // CMD_SRCLK_ON/OFF 21 kCmdTriggerLine = 0x1800, // CMD_TRIGGERS_ON/CMD_TRIGGERS_OFF 22 //kCmdContTrigger = 0x1f00, 23 kCmdContTriggerOff = 0x2000, 24 kCmdRun = 0x2200, // CMD_Start/Stop 25 kCmdResetTriggerId = 0x2A00, // 26 kCmdSocket = 0x3000, // CMD_mode_command/CMD_mode_all_sockets 27 kCmdSingleTrigger = 0xA000, // CMD_Trigger 28 kCmdContTriggerOn = 0xB000, 29 }; 30 31 enum Commands 32 { 33 kCmdWrite = 0x0500, // write to Config-RAM 34 kCmdWriteRoi = kCmdWrite|0x00, // Baseaddress ROI-Values 35 kCmdWriteDac = kCmdWrite|0x24, // Baseaddress DAC-Values 36 37 kCmdWriteRate = kCmdWrite|0x2c, // Continous trigger rate 38 kCmdWriteRunNumber = kCmdWrite|0x2d, // 39 40 /* 41 kCmdRead = 0x0a00, // read from Config-RAM 42 kCmdReadRoi = kCmdRead|0x00, // Baseaddress ROI-Values 43 kCmdReadDac = kCmdRead|0x24, // Baseaddress DAC-Values 44 */ 45 46 kCmdPhaseIncrease = 0x1200, // CMD_PS_DIRINC 47 kCmdPhaseDecrease = 0x1300, // CMD_PS_DIRDEC 48 kCmdPhaseApply = 0x1400, // CMD_PS_DO 49 kCmdPhaseReset = 0x1700, // CMD_PS_RESET 50 }; 51 15 52 enum States 16 53 { … … 162 199 Reverse(&fRunNumber); 163 200 Reverse(&fDNA); 164 165 /* 166 // Extract temperatures (MSB indicates if temperature 167 // is positive or negative) 168 for (int i=0; i<kNumTemp; i++) 169 { 170 if (fTempDrs[i]&0x8000) 171 fTempDrs[i] |= 0xE000; 172 fTempDrs[i]>>=3; 173 } 174 */ 201 } 202 203 std::vector<uint16_t> HtoN() const 204 { 205 EventHeader h(*this); 206 207 Reverse(((uint16_t*)h.fEventCounter)); 208 Reverse(((uint16_t*)h.fEventCounter)+1); 209 210 Reverse(&h.fEventCounter); 211 212 Reverse(((uint16_t*)h.fFreqRefClock)); 213 Reverse(((uint16_t*)h.fFreqRefClock)+1); 214 215 Reverse(&h.fFreqRefClock); 216 217 Reverse(((uint16_t*)&h.fTimeStamp)); 218 Reverse(((uint16_t*)&h.fTimeStamp)+1); 219 220 Reverse(&h.fTimeStamp); 221 222 Reverse(((uint16_t*)&h.fRunNumber)); 223 Reverse(((uint16_t*)&h.fRunNumber)+1); 224 225 Reverse(&h.fRunNumber); 226 Reverse(&h.fDNA); 227 228 return htoncpy(h); 175 229 } 176 230 … … 195 249 uint16_t Board() const { return fBoardId&0xff; } 196 250 251 void Enable(Bits pos, bool enable=true) 252 { 253 if (enable) 254 fStatus |= pos; 255 else 256 fStatus &= ~pos; 257 } 258 197 259 void clear() { reset(*this); } 198 260 void print(std::ostream &out) const; … … 213 275 { 214 276 ntohcpy(vec, *this); 277 } 278 279 std::vector<uint16_t> HtoN() const 280 { 281 ChannelHeader h(*this); 282 return htoncpy(h); 215 283 } 216 284
Note:
See TracChangeset
for help on using the changeset viewer.