Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Globals | Related Pages

BocCard.h

00001 // File: BocCard.h
00002 
00003 #ifndef SCTPIXELROD_BOCCARD_H
00004 #define SCTPIXELROD_BOCCARD_H
00005 
00006 #include <iostream>
00007 #include <cmath>
00008 
00009 #include "BocAddresses.h"
00010 #include "RodModule.h"
00011 
00012 
00013 namespace SctPixelRod {
00014 
00021     const unsigned int PRE_PRODUCTION_BOC  = 0x0;
00022     const unsigned int PRODUCTION_REVA_BOC = 0x1;
00023         const unsigned int PRODUCTION_REVB_BOC = 0x2;
00024         const unsigned int PRODUCTION_REVC_BOC = 0x3;
00025 
00032 
00033     const unsigned int MONITOR_CURRENT  = 1;
00034     const unsigned int MONITOR_VOLTAGE  = 2;
00035     const unsigned int MONITOR_TEMP     = 3;
00036     const unsigned int MONITOR_CHANNEL_TYPE[BOC_MONITOR_CHANNELS] = {
00037         MONITOR_CURRENT,
00038         MONITOR_CURRENT,
00039         MONITOR_CURRENT,
00040         MONITOR_CURRENT,
00041         MONITOR_CURRENT,
00042         MONITOR_CURRENT,
00043         MONITOR_CURRENT,
00044         MONITOR_CURRENT,
00045         MONITOR_VOLTAGE,
00046         MONITOR_VOLTAGE,
00047         MONITOR_TEMP,
00048         MONITOR_TEMP};
00049 
00053         const double iArevA = -0.04051;
00054         const double iBrevA = 41.52;
00056         const double vArevA = 0.011106;
00057         const double vBrevA = 0.0;
00059         const double tArevA = 10000.0;
00060         const double tBrevA = 1023.0;
00061         const double tC0revA = 7.4717e-4;
00062         const double tC1revA = 2.7726e-4;
00063         const double tC2revA = 6.8388e-8;
00064 
00067         const double iArevB = 0.02383;
00068         const double iBrevB = 0.0;
00070         const double vArevB = 0.014492;
00071         const double vBrevB = 0.0;
00073         const double tArevB = 10000.0;
00074         const double tBrevB = 1023.0;
00075         const double tC0revB = 7.4717e-4;
00076         const double tC1revB = 2.7726e-4;
00077         const double tC2revB = 6.8388e-8;
00078 
00081         const double iArevC = 0.02383;
00082         const double iBrevC = 0.0;
00084         const double vArevC = 0.014492;
00085         const double vBrevC = 0.0;
00087         const double tArevC = 10000.0;
00088         const double tBrevC = 1023.0;
00089         const double tC0revC = 7.4717e-4;
00090         const double tC1revC = 2.7726e-4;
00091         const double tC2revC = 6.8388e-8;
00092 
00093 
00094 //------------------------------------------------------------------------
00095 
00097 
00110 class BocException : public BaseException {
00111 
00112 public:
00113 
00114   BocException( std::string descriptor);
00115   BocException( std::string descriptor, INT32 value1, INT32 value2);
00116   INT32 getNumData() {return m_numValue; };
00117   INT32 getData1() {return m_value1; };
00118   INT32 getData2() {return m_value2; };
00119   virtual void what(std::ostream&);
00120 
00121 private:
00122 
00123 // Number of data items
00124   INT32 m_numValue;
00125 // 1st data value returned by exception
00126   INT32 m_value1;
00127 
00128 // 2nd data value returned by exception
00129   INT32 m_value2;
00130 
00131 // End of BocException declarations
00132 
00133 };
00134 
00135 
00136 //------------------------------------------------------------------------
00137 
00139 
00151 class BocCard
00152 {
00153 public:
00154 
00155 // Constructor and destructor
00156     BocCard(RodModule & rod );                     // Constructor
00157     ~BocCard();                                    // Destructor
00158 
00159 
00160 // Accessor methods
00161 
00162     UINT32 getSerialNumber() {return m_serialNumber;};
00163     UINT32 getManufacturer() {return m_manufacturer;};
00164     UINT32 getModuleType() {return m_moduleType;};
00165     UINT32 getHardwareRevision() {return m_hardwareRevision;};
00166     UINT32 getFirmwareRevision() {return m_firmwareRevision;};
00167     RodModule* getRod() {return m_myrod;};
00168 
00184         void initialize();
00185 
00186 
00189         void reset();
00190 
00191 
00192 /* status() reports the status of the BOC.
00193  * This initial version just prints the information to standard output.
00194  */
00195     void status();
00196         void status(std::ostream&);
00197 
00198 
00204         void getLaserCurrent(const UINT32 channel, UINT32 buffer[],
00205                 const UINT32 numChannels) throw (BocException&);
00206     UINT32 getLaserCurrent(const UINT32 channel) throw (BocException&);
00207 
00208 
00213         void setLaserCurrent(const UINT32 channel, const UINT32 buffer[],
00214                 const UINT32 numChannels) throw (BocException&);
00215     void setLaserCurrent(const UINT32 channel, const UINT32 value)
00216                 throw (BocException&);
00217 
00218 
00224     void getRxThreshold(const UINT32 channel, UINT32 buffer[], 
00225                 const UINT32 numChannels) throw (BocException&);
00226     UINT32 getRxThreshold(const UINT32 channel) throw (BocException&);
00227 
00228 
00233     void setRxThreshold(const UINT32 channel, const UINT32 buffer[], 
00234                 const UINT32 numChannels) throw (BocException&);
00235         void setRxThreshold(const UINT32 channel, const UINT32 value)
00236                 throw (BocException&);
00237 
00238 
00244         void getRxDataDelay(const UINT32 channel, UINT32 buffer[],
00245                 const UINT32 numChannels) throw (BocException&);
00246     UINT32 getRxDataDelay(const UINT32 channel) throw (BocException&);
00247 
00248 
00253         void setRxDataDelay(const UINT32 channel, const UINT32 buffer[],
00254                 const UINT32 numChannels) throw (BocException&);
00255         void setRxDataDelay(const UINT32 channel, const UINT32 value)
00256                 throw (BocException&);
00257 
00258 
00267         void getStrobeDelay(const UINT32 channel, UINT32 buffer[],
00268                 const UINT32 numChannels) throw (BocException&);
00269     UINT32 getStrobeDelay(const UINT32 channel) throw (BocException&);
00270 
00271 
00279         void setStrobeDelay(const UINT32 channel, const UINT32 buffer[],
00280                 const UINT32 numChannels) throw (BocException&);
00281         void setStrobeDelay(const UINT32 channel, const UINT32 value)
00282                 throw (BocException&);
00283 
00284 
00291         void getBpmStreamInhibit(const UINT32 channel, UINT32 buffer[],
00292                 const UINT32 numChannels) throw (BocException&);
00293     UINT32 getBpmStreamInhibit(const UINT32 channel) throw (BocException&);
00294 
00295 
00302         void setBpmStreamInhibit(const UINT32 channel, const UINT32 buffer[],
00303                 const UINT32 numChannels) throw (BocException&); 
00304         void setBpmStreamInhibit(const UINT32 channel, const UINT32 value)
00305                 throw (BocException&);
00306 
00307 
00314         void getBpmMarkSpace(const UINT32 channel, UINT32 buffer[],
00315                 const UINT32 numChannels) throw (BocException&);
00316     UINT32 getBpmMarkSpace(const UINT32 channel) throw (BocException&);
00317 
00318 
00325         void setBpmMarkSpace(const UINT32 channel, const UINT32 buffer[],
00326                 const UINT32 numChannels) throw (BocException&);
00327         void setBpmMarkSpace(const UINT32 channel, const UINT32 value)
00328                 throw (BocException&);
00329 
00330 
00337         void getBpmCoarseDelay(const UINT32 channel, UINT32 buffer[],
00338                 const UINT32 numChannels) throw (BocException&);
00339     UINT32 getBpmCoarseDelay(const UINT32 channel) throw (BocException&);
00340 
00341 
00348         void setBpmCoarseDelay(const UINT32 channel, const UINT32 buffer[],
00349                 const UINT32 numChannels) throw (BocException&);
00350         void setBpmCoarseDelay(const UINT32 channel, const UINT32 value)
00351                 throw (BocException&);
00352 
00353 
00360         void getBpmFineDelay(const UINT32 channel, UINT32 buffer[],
00361                 const UINT32 numChannels) throw (BocException&);
00362     UINT32 getBpmFineDelay(const UINT32 channel) throw (BocException&);
00363 
00364 
00371         void setBpmFineDelay(const UINT32 channel, const UINT32 buffer[],
00372                 const UINT32 numChannels) throw (BocException&);
00373         void setBpmFineDelay(const UINT32 channel, const UINT32 value) 
00374                 throw (BocException&);
00375 
00376 
00379         UINT32 getClockControl();
00380 
00381 
00384         void setClockControl(const UINT32 value) throw (BocException&);
00385 
00386 
00389         UINT32 getRxDataMode();
00390 
00391 
00394         void setRxDataMode(const UINT32 value) throw (BocException&);
00395 
00396 
00399         UINT32 getRxDacClear();
00400 
00401 
00406         void clearRxDac();
00407 
00408 
00411         UINT32 getTxDacClear();
00412 
00413 
00418         void clearTxDac();
00419 
00420 
00424     UINT32 getVernierFinePhase();
00425 
00426 
00430     void setVernierFinePhase(const UINT32 value) throw (BocException&);
00431 
00432 
00437         UINT32 getVernierClockPhase0();
00438 
00439 
00444         void setVernierClockPhase0(const UINT32 value) throw (BocException&);
00445 
00446 
00451         UINT32 getVernierClockPhase1();
00452 
00453 
00458         void setVernierClockPhase1(const UINT32 value) throw (BocException&);
00459 
00460 
00465         UINT32 getVernierClockPhases(UINT32 *value0, UINT32 *value1);
00466 
00467 
00472         void setVernierClockPhases(const UINT32 value) throw (BocException&);
00473 
00474 
00477     UINT32 getBpmClockPhase();
00478 
00479 
00482     void setBpmClockPhase(const UINT32 value) throw (BocException&);
00483 
00484 
00487         UINT32 getBregClockPhase();
00488 
00489 
00492         void setBregClockPhase(const UINT32 value) throw (BocException&);
00493 
00494 
00497     UINT32 getBocReset();
00498 
00499 
00504     void resetBoc();
00505 
00506 
00509         UINT32 getBpmReset();
00510 
00511 
00516         void resetBpm();
00517 
00518 
00521         UINT32 getVpinReset();
00522 
00523 
00528         void resetVpin();
00529 
00530 
00533         UINT32 getBocOkReset();
00534 
00535 
00540         void resetBocOk();
00541 
00542 
00547     UINT32 getBocStatusRegister();      //Read-only register
00548 
00549 
00557     double getMonitorAdc(const UINT32 channel, std::string &units, 
00558                              std::string &type) throw (BocException&);
00559     double getMonitorAdc(const UINT32 channel) throw (BocException&);
00560 
00561 
00566     std::string getMonitorAdcUnits(const UINT32 channel) 
00567                                        throw (BocException&);
00568 
00569 
00574         std::string getMonitorAdcType(const UINT32 channel) 
00575                                       throw (BocException&);
00576 
00577 
00582         UINT32 getMonitorAdcCurrents(double currents[], UINT32 count,
00583                  std::string &units) throw (BocException&);
00584 
00585 
00590         UINT32 getMonitorAdcVoltages(double voltages[], UINT32 count,
00591                  std::string &units) throw (BocException&);
00592 
00593 
00598         UINT32 getMonitorAdcTemps(double temps[], UINT32 count,
00599                  std::string &units) throw (BocException&);
00600 
00601 
00607         UINT32 getMonitorAdcCurrentsCount();
00608 
00609 
00615         UINT32 getMonitorAdcVoltagesCount();
00616 
00617 
00623         UINT32 getMonitorAdcTempsCount();
00624 
00625 
00630     void resetMonitorAdc();
00631 
00640     UINT32 getInterlockStatus(UINT32 *localEnable, UINT32 *remoteEnable);
00641     UINT32 getInterlockStatus();
00642 
00643 private: 
00644 
00645 
00647         UINT32 singleRead(const UINT32 bocAddress) throw (BocException&);
00648         void singleWrite(const UINT32 bocAddress, const UINT32 value) throw (BocException&);
00649 
00650 
00652         void blockRead(const UINT32 bocAddress,  UINT32 buffer[],
00653                 const INT32 length);
00654         void blockWrite(const UINT32 bocAddress,  const UINT32 buffer[],
00655                 const INT32 length);
00656 
00657 
00659     UINT32 bpmRead(const UINT32 bpm, const UINT32 stream, 
00660                 const UINT32 offset);
00661     void bpmWrite(const UINT32 bpm, const UINT32 stream, 
00662                 const UINT32 offset, const UINT32 value);
00663 
00664 
00666     RodModule* m_myrod;
00667 
00668 
00670     UINT32 m_serialNumber;
00671 
00672 
00674     UINT32 m_manufacturer;
00675 
00676 
00678     UINT32 m_moduleType;
00679 
00680 
00683     UINT32 m_hardwareRevision;
00684 
00685 
00687     UINT32 m_firmwareRevision;
00688 
00692     UINT32 m_bocType;
00693 
00696     UINT32 m_bocMask;
00697 
00698   }; // End of class BocCard declaration
00699 
00700 
00701 }; // End namespace SctPixelRod
00702 
00703 #endif  // SCTPIXELROD_BOCCARD_H

Generated on Thu Dec 15 21:14:23 2005 for SCT DAQ/DCS Software - C++ by doxygen 1.3.5