Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:58:12

0001 #ifndef PIXELFECCONFIGINTERFACE_H
0002 #define PIXELFECCONFIGINTERFACE_H
0003 /**
0004 *   \file CalibFormats/SiPixelObjects/interface/PixelFECConfigInterface.h
0005 *   \brief This class intends to define an abstract interface for the commands to talk to the PixelFEC.
0006 *
0007 *   ******THIS SHOULD REALLY BE IN A SEPARATE PACKAGE*****
0008 *
0009 *   A longer explanation will be placed here later
0010 */
0011 
0012 #include <vector>
0013 #include <string>
0014 #include "CalibFormats/SiPixelObjects/interface/PixelHdwAddress.h"
0015 
0016 namespace pos {
0017   /*! \class PixelFECConfigInterface PixelFECConfigInterface.h "interface/PixelFECConfigInterface.h"
0018 *   \brief This class implements..
0019 *
0020 *   A longer explanation will be placed here later
0021 
0022 */
0023   class PixelFECConfigInterface {
0024   public:
0025     PixelFECConfigInterface(){};
0026 
0027     virtual ~PixelFECConfigInterface(){};
0028 
0029     //Generate the commands needed to set the trim and mask bits that
0030     //are specified by the vector allPixels.
0031 
0032     virtual void setMaskAndTrimAll(const PixelHdwAddress& theROC,
0033                                    const std::vector<unsigned char>& allPixels,
0034                                    const bool buffermode = false) = 0;
0035 
0036     virtual void setDcolEnableAll(const PixelHdwAddress& theROC,
0037                                   unsigned char maskAndTrim,
0038                                   const bool buffermode = false) = 0;
0039 
0040     //Generate the commands needed to set the trim and mask bits for all
0041     //pixels to the common value specified by maskAndTrim.
0042     // DO WE REALY NEED THIS?? Danek 15/4/08
0043     //virtual void setMaskAndTrimCommon(const PixelHdwAddress& theROC,
0044     //                unsigned char maskAndTrim,)=0;
0045 
0046     //Generate the commands needed to set the DAC values for a ROC.
0047     virtual void setAllDAC(const PixelHdwAddress& theROC,
0048                            const std::vector<unsigned int>& dacs,
0049                            const bool buffermode = false) = 0;
0050 
0051     virtual int roctrimload(int mfec,
0052                             int fecchannel,
0053                             int hubaddress,
0054                             int portaddress,
0055                             int rocid,
0056                             const std::vector<unsigned char>& allPixels) = 0;
0057 
0058     virtual int rocinit(int mfec, int fecchannel, int hubaddress, int portaddress, int rocid, int mask, int trim) = 0;
0059 
0060     virtual int injectrstroc(const int mfec, const int bitstate) = 0;
0061     virtual int injecttrigger(const int mfec, const int bitstate) = 0;
0062     virtual int injectrsttbm(const int mfec, const int bitstate) = 0;
0063     virtual int injectrstcsr(const int mfec, const int bitstate) = 0;
0064     virtual int enablecallatency(const int mfec, const int bitstate) = 0;
0065     virtual int disableexttrigger(const int mfec, const int bitstate) = 0;
0066     virtual int loopnormtrigger(const int mfec, const int bitstate) = 0;
0067     virtual int loopcaltrigger(const int mfec, const int bitstate) = 0;
0068     virtual int callatencycount(const int mfec, const int latency) = 0;
0069     virtual int getversion(const int mfec, unsigned long* data) = 0;
0070     virtual int getversion(unsigned long* data) = 0;
0071 
0072     virtual int progdac(int mfec,
0073                         int fecchannel,
0074                         int hubaddress,
0075                         int portaddress,
0076                         int rocid,
0077                         int dacaddress,
0078                         int dacvalue,
0079                         bool buffermode = false) = 0;
0080 
0081     virtual int clrcal(
0082         int mfec, int fecchannel, int hubaddress, int portaddress, int rocid, bool buffermode = false) = 0;
0083 
0084     virtual int calpix(int mfec,
0085                        int mfecchannel,
0086                        int hubaddress,
0087                        int portaddress,
0088                        int rocid,
0089                        int coladdr,
0090                        int rowaddress,
0091                        int caldata,
0092                        bool buffermode = false) = 0;
0093 
0094     virtual int tbmcmd(int mfec,
0095                        int fecchannel,
0096                        int tbmchannel,
0097                        int hubaddress,
0098                        int portaddress,
0099                        int offset,
0100                        int databyte,
0101                        int direction) = 0;
0102 
0103     virtual int dcolenable(int mfec,
0104                            int mfecchannel,
0105                            int hubaddress,
0106                            int portaddress,
0107                            int rocid,
0108                            int dcol,
0109                            int dcolstate,
0110                            bool buffermode = false) = 0;
0111 
0112     //Need to give this a different name as otherwise ambiguous
0113     virtual int progpix1(int mfec,
0114                          int mfecchannel,
0115                          int hubaddress,
0116                          int portaddress,
0117                          int rocid,
0118                          int coladdr,
0119                          int rowaddress,
0120                          int mask,
0121                          int trim,
0122                          bool buffermode = false) = 0;
0123 
0124     virtual int progpix(int mfec,
0125                         int mfecchannel,
0126                         int hubaddress,
0127                         int portaddress,
0128                         int rocid,
0129                         int coladdr,
0130                         int rowaddress,
0131                         unsigned char databyte,
0132                         bool buffermode = false) = 0;
0133 
0134     virtual int qbufsend(void) = 0;
0135 
0136     virtual void fecDebug(int newstate) = 0;
0137 
0138     virtual int delay25Test(int mymfec,
0139                             int myfecchannel,
0140                             int myhubaddress,
0141                             int mytbmchannel,
0142                             int myportaddress,
0143                             int myrocid,
0144                             int mymask,
0145                             int mytrim,
0146                             int nTry,
0147                             int commands,
0148                             int& success0,
0149                             int& success1,
0150                             int& success2,
0151                             int& success3,
0152                             int& success4) = 0;
0153 
0154     virtual int rocreset(int mfec, int fecchannel, int tbmchannel, int hubaddress) = 0;
0155 
0156     //virtual void setVCalDAC(std::string ROC, unsigned char dac)=0;
0157 
0158     //... maybe some more
0159   };
0160 }  // namespace pos
0161 #endif