20 #include <python2.7/Python.h> 27 #define CALIBRATION_FILE_VER "0.99" 28 #define SPI_N_RETRIES 2 32 #define SC_SOFT_RST 0x40 33 #define SC_MOSI_MISO_BYPASS 0xFF 36 #define ICECAL_VERSION_ADDR 0xB0 37 #define BXID_RESYNCH_ADDR 0xB1 53 typedef unsigned long U32;
54 typedef unsigned short U16;
55 typedef unsigned char U8;
74 PyObject* getDelayLineCh(
int ch);
78 PyObject* getAnalogCh(
int ch);
82 PyObject* getMainReg();
86 PyObject* spiFERTest(
long nTest);
89 StatusCode dumpConfig(
string configFile, PyObject* chipId);
92 PyObject* loadConfig(
string configFile);
95 bool bxidResynchStatus();
96 void spiAddressScan();
104 void help() { info(
"ICECALv3 "+name()+
". No help.",
"ICECALv3::help"); };
142 U16 spiRead (
U8 confRegAddr,
U8 offsetAddr=128);
149 bool writeAsicParams(
string fileName, PyObject* params);
152 int parseParameterList(
string configFile,
string paramName[64],
int paramValue[64]);
153 PyObject* fillParams(
string paramListRet[],
int paramListLen,
string paramName[64],
int paramValue[64],
int fileParamLen);
157 if(ch < 0 || ch > 3) {
158 error(
itos(ch)+
" is not a valid ICECAL channel number. Valid numbers [0-3].",
"ICECALv3::checkChNumber");
167 if (value < 256) sprintf(buff,
"%02X",value);
168 else if (value < 65536) sprintf(buff,
"%04X",value);
169 else sprintf(buff,
"%08X",value);
170 return std::string(buff);
bool checkChNumber(int ch)
const int icecalMSBAddrCh[4]
void setAddress(U8 address)
const int icecalMainAddr[4]
void setNRetries(int nRet)
void bypassMisoMosi(U16 writeData)
const int icecalLSBAddrCh[4]
std::string itohs(int value)
const int delayLineAddrCh[4]
#define SC_MOSI_MISO_BYPASS