00001 #ifndef PIT_DEF_H 00002 #define PIT_DEF_H 00003 00004 #include <vector> 00005 #include <string> 00006 00007 00008 #define FILE_IN "file_in.txt" 00009 #define FILE_OUT "file_out.txt" 00010 #define DB_FILE_IN "db_in.dat" //file->DB 00011 #define DB_FILE_OUT "db_out.dat" //DB->file 00012 00013 #define SUCCESS 0 00014 #define FAILURE 1 00015 #define ERROR_PHYSMEM_OPEN -2 00016 #define ERROR_PHYSMEM_TOOHIGH -8 00017 #define ERROR_PROTOCOL_DTSW -16 00018 #define ERROR_PROTOCOL_DATALENGTH -32 00019 #define ERROR_BAD_LENGTH_COMPARISON -128 00020 #define ERROR_BAD_REGISTER_WRITE -256 00021 #define ERROR_GENERIC_BUS_STATUS -512 00022 #define ERROR_PARITY_CHECK -513 00023 #define ERROR_BAD_DATABASE_ACCESS -1024 00024 00025 #define NUMBER_HALF_STAVES 120 00026 #define NUMBER_OPTIN 10 00027 #define NUMBER_OPTICAL_LINKS 12 00028 #define NUMBER_FO_CHANNELS 10 00029 00030 #define NUMBER_SIDES 2 00031 #define NUMBER_SECTORS 10 00032 #define NUMBER_HALF_STAVES_SECTOR 6 00033 00034 00035 00036 #define RORC_REVISION -1 00037 #define RORC_SERIAL 0 00038 #define RORC_CHANNEL 1 00039 00040 #define PIT_GET_RDA_LSB 0x7fe00 00041 #define PIT_GET_RDA_MSB 0x7fe01 00042 #define PIT_GET_WRA_LSB 0x7fc00 00043 #define PIT_GET_WRA_MSB 0x7fc01 00044 #define PIT_GET_LEN 0x7f000 00045 #define PIT_GET_RD_LEN 0x7e000 00046 #define PIT_GET_WR_LEN 0x7e800 00047 #define PIT_GET_CONTROL0 0xa 00048 #define PIT_GET_CONTROL1 0x10b 00049 #define PIT_GET_VERSION 0x0 00050 #define PIT_GET_BUS_STATUS 0x4 00051 00052 00053 00054 00055 typedef unsigned long int UInt32; 00056 typedef unsigned int UInt12; 00057 typedef unsigned int UInt28; 00058 typedef unsigned int UInt19; 00059 typedef unsigned int UInt8; 00060 00061 typedef enum {A,C} t_sideCoord; 00062 00063 00064 00065 using namespace std; 00066 00067 00068 00071 UInt32 extractFromUInt32(int offset, int bits, UInt32 input); 00072 00076 UInt32 insertIntoUInt32(int offset, int bits, UInt32 data, UInt32 input); 00077 00079 void sleepMilli(long ms); 00081 void sleepNano(long ns); 00082 00083 vector<string> strsplit(const string &inputStr, char separator =' '); 00084 00085 #endif