QPPortInterface.hh
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef _FE_INTERFACE_HH_
00015 #define _FE_INTERFACE_HH_
00016
00017
00018
00019
00020 #include "QPPortUserLevel.hh"
00021 #include "QEleChannel.hh"
00022
00023
00024
00025 using namespace QUserLib;
00026
00027 namespace QEleLib {
00028
00029
00030
00031 enum QEleCommChannels_t
00032 {
00033 FenChannel = 0,
00034 RelChannel = 0,
00035 BesChannel = 1,
00036 PulsChannel = 2,
00037 MemChannel = 3
00038 };
00039
00040
00041
00042 enum QEleI2CAdress_t
00043 {
00044 FenDevicesAddress = 0x10,
00045 BesDevicesAddress = 0x20,
00046 PulsDevicesAddress = 0x60,
00047 MemDevicesAddress = 0xA0
00048 };
00049
00050
00051
00052 enum QEleErrorsCode_t
00053 {
00054 Generic_Error_1 = ((16+1)<<8),
00055 Front_End_W_Error = ((16+2)<<8),
00056 Backplane_Relay_W_Error = ((16+3)<<8),
00057 Bessel_Trigger_W_Error = ((16+4)<<8),
00058 Pulser_Att_W_Error = ((16+5)<<8),
00059 Pulser_Status_W_Error = ((16+6)<<8),
00060 Error_group_7W = ((16+7)<<8),
00061 Error_group_8W = ((16+8)<<8),
00062 Generic_Error_2 = ((32+1)<<8),
00063 Front_End_R_Error = ((32+2)<<8),
00064 Backplane_Relay_R_Error = ((32+3)<<8),
00065 Bessel_Trigger_R_Error = ((32+4)<<8),
00066 Pulser_Att_R_Error = ((32+5)<<8),
00067 Pulser_Status_R_Error = ((32+6)<<8),
00068 Error_group_7R = ((32+7)<<8),
00069 Error_group_8R = ((32+8)<<8)
00070 };
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091 int Init(unsigned long PPortAddress);
00092
00093
00094 int Close();
00095
00096
00097
00098
00099 int writeFrontEnd(const QEleAddress &Add, int nB, char by);
00100
00101
00102 int readFrontEnd(const QEleAddress &Add, int nB, char& by);
00103
00104
00105
00106
00107 int writeBessel(const QEleAddress &Add, char by);
00108
00109
00110 int readBessel(const QEleAddress &Add, char& by);
00111
00112
00113
00114
00115 int writeRele(int Controller, char by);
00116
00117
00118 int readRele(int Controller, char& by);
00119
00120
00121
00122
00123 int writePulserAtten(int Add,char Byte3);
00124
00125
00126
00127 int writePulserStatus(int Add,char Time,char Byte1, char Byte2);
00128
00129
00130 int readPulserAtten(int Add,char& by);
00131
00132
00133
00134 int readPulserStatus(int Add, char& Time,char& Byte1, char& Byte2);
00135
00136
00137 int IO_ErrorDecode(int err, char* sstr);
00138
00139 };
00140
00141 #endif //_FE_INTERFACE_HH_