QFEChannel.hh

00001 /*
00002 * APOLLO: A complete DAQ and Online Data Analysis Framework for Cuore
00003 * 
00004 * A.G. created 28/6/6
00005 *
00006 * $Id: QFEChannel.hh 404 2006-11-10 23:40:40Z giacher $
00007 * $Revision: 404 $
00008 *
00009 * Class QFEChannel: Front-End Channel class
00010 *
00011 */
00012 
00013 #ifndef _QFE_CHANNEL_HH_
00014 #define _QFE_CHANNEL_HH_
00015 
00016 
00017 //C/C++ Includes
00018 #include <sstream>
00019 
00020 
00021 // Apollo Includes
00022 #include "QCuore.hh"
00023 #include "QNamed.hh"
00024 #include "QId.hh"
00025 
00026 // Hardware Includes
00027 #include "QEleChannel.hh"
00028 #include "QEleBaseInterface.hh"
00029 
00030 
00031 class QFEChannel : public QId, public QNamed, public QEleChannel
00032 {
00033 
00034 public:
00035   
00036    // ctors 
00037    QFEChannel(QEleBaseInterface* IFace, size_t Id, const std::string& Label, 
00038               size_t Ctrl, size_t Slot, size_t Board, size_t Ch);
00039  
00040    // dtor
00041    virtual ~QFEChannel() {}
00042   
00043    // FIXME: All Get/Set Methods return "false" if no error occurred,
00044    //        "true" otherwise.
00045 
00046    // Mem_A Setters/Getters
00047    bool StartOffsetAdj();
00048    bool SetGain(size_t  Gain);
00049    bool GetGain(size_t& Gain);
00050    bool SetAuxOutputEnable(bool  Status);
00051    bool GetAuxOutputEnable(bool& Status);
00052    bool SetThermOutputEnable(bool  Status);
00053    bool GetThermOutputEnable(bool& Status);
00054 
00055   
00056    // Mem_B Setters/Getters
00057    bool SetBiasPolarity(bool  Polarity);
00058    bool GetBiasPolarity(bool& Polarity);
00059    bool IsBiasPositive();
00060    bool SetBias(size_t  Bias);
00061    bool GetBias(size_t& Bias);
00062    bool SetFrontEndInput(bool  Input);
00063    bool GetFrontEndInput(bool& Input);
00064    bool SetLoadResistor(bool  Resitor);
00065    bool GetLoadResistor(bool& Resitor);
00066 
00067   
00068    // Mem_C Setters/Getters
00069    bool SetTestSigPosLevel(size_t  PolLevel);
00070    bool GetTestSigPosLevel(size_t& PolLevel);
00071    bool SetTestSigNegLevel(size_t  NegLevel);
00072    bool GetTestSigNegLevel(size_t& NegLevel);
00073    
00074 
00075    // Mem_D Setters/Getters
00076    bool SetAdjTime(size_t  Time);
00077    bool GetAdjTime(size_t& Time);
00078 
00079   
00080    // Dac_H Setters/Getters
00081    bool SetOffsetHighDAC(size_t  HighDAC);
00082    bool GetOffsetHighDAC(size_t& HighDAC);
00083    bool SetOffsetSBit(bool  SBit);
00084    bool GetOffsetSBit(bool& SBit);
00085    bool SetOffsetPolarity(bool  Polarity);
00086    bool GetOffsetPolarity(bool& Polarity);
00087    bool SetOffsetMSBs(size_t  Msb);
00088    bool GetOffsetMSBs(size_t& Msb);
00089   
00090    // Dac_L Setter/Getter
00091    bool SetOffsetLowDAC(size_t  LowDAC);
00092    bool GetOffsetLowDAC(size_t& LowDAC);
00093   
00094    // General Setters/Getters
00095    bool SetOffsetDAC(size_t  DAC);
00096    bool GetOffsetDAC(size_t& DAC);
00097 
00098   
00099    // Set/Get entire register
00100    bool SetRegister(size_t Reg, char  Value);
00101    bool GetRegister(size_t Reg, char& Value);
00102 
00103   
00104    // Get Used Interface
00105    inline QEleBaseInterface* GetInterface() {return fFace;}
00106 
00107 protected:
00108 
00109    // Write Register
00110    virtual bool WriteRegister(size_t Reg, char  Value);
00111 
00112    // ReWrite Register
00113    virtual bool ReWriteRegister(size_t Reg);
00114 
00115    // Read Register
00116    virtual bool ReadRegister (size_t Reg, char& Value);
00117      
00118 private:
00119 
00120 
00121    // Pointer to Interface
00122    QEleBaseInterface* fFace;
00123 
00124    // String Stream for perfome message
00125    std::ostringstream fMsgString;
00126 
00127 };
00128 
00129 #endif // _QFE_CHANNEL_HH_
00130 

Generated on Tue Nov 16 10:49:54 2010 for CUORE Software by  doxygen 1.5.6