CAENVMEtypes.h

00001 /*
00002         -----------------------------------------------------------------------------
00003 
00004                 --- CAEN SpA - Computing Systems Division ---
00005 
00006         -----------------------------------------------------------------------------
00007 
00008         CAENVMEtypes.h
00009 
00010         -----------------------------------------------------------------------------
00011 
00012         Author:  Stefano Coluccini (s.coluccini@caen.it)
00013 
00014         Created: March 2004
00015 
00016         -----------------------------------------------------------------------------
00017 */
00018 #ifndef __CAENVMETYPES_H
00019 #define __CAENVMETYPES_H
00020 
00021 #ifdef LINUX
00022 #define CAEN_BYTE       unsigned char
00023 #define CAEN_BOOL       int
00024 #else
00025 #define CAEN_BYTE       byte
00026 #define CAEN_BOOL       VARIANT_BOOL
00027 #endif
00028 
00029 /*
00030         CAEN VME bridges.
00031 */
00032 typedef enum CVBoardTypes {
00033         cvV1718 = 0,                    /* CAEN V1718 USB-VME bridge                    */
00034         cvV2718 = 1,                    /* V2718 PCI-VME bridge with optical link       */
00035         cvA2818 = 2,                    /* PCI board with optical link                  */
00036         cvA2719 = 3                     /* Optical link piggy-back                      */
00037 } CVBoardTypes;
00038 
00039 /*
00040         VME cycles data width.
00041         Ver. 2.2 - Added byte-swapping data widths
00042 */
00043 typedef enum CVDataWidth {
00044         cvD8  = 0x01,                   /*  8 bit                                       */
00045         cvD16 = 0x02,                   /* 16 bit                                       */
00046         cvD32 = 0x04,                   /* 32 bit                                       */
00047         cvD64 = 0x08,                   /* 64 bit                                       */
00048         cvD16_swapped = 0x12,           /* 16 bit swapped                               */
00049         cvD32_swapped = 0x14,           /* 32 bit swapped                               */
00050         cvD64_swapped = 0x18            /* 64 bit swapped                               */
00051 } CVDataWidth;
00052 
00053 /*
00054         VME cycles address modifiers
00055 */
00056 typedef enum CVAddressModifier {
00057         cvA16_S         = 0x2D,         /* A16 supervisory access                       */
00058         cvA16_U         = 0x29,         /* A16 non-privileged                           */
00059         cvA16_LCK       = 0x2C,         /* A16 lock command                             */
00060 
00061         cvA24_S_BLT     = 0x3F,         /* A24 supervisory block transfer               */
00062         cvA24_S_PGM     = 0x3E,         /* A24 supervisory program access               */
00063         cvA24_S_DATA    = 0x3D,         /* A24 supervisory data access                  */
00064         cvA24_S_MBLT    = 0x3C,         /* A24 supervisory 64-bit block trnsfer         */
00065         cvA24_U_BLT     = 0x3B,         /* A24 non-privileged block transfer            */
00066         cvA24_U_PGM     = 0x3A,         /* A24 non-privileged program access            */
00067         cvA24_U_DATA    = 0x39,         /* A24 non-privileged data access               */
00068         cvA24_U_MBLT    = 0x38,         /* A24 non-privileged 64-bit block trnsfer      */
00069         cvA24_LCK       = 0x32,         /* A24 lock command                             */
00070 
00071         cvA32_S_BLT     = 0x0F,         /* A32 supervisory block transfer               */
00072         cvA32_S_PGM     = 0x0E,         /* A32 supervisory program access               */
00073         cvA32_S_DATA    = 0x0D,         /* A32 supervisory data access                  */
00074         cvA32_S_MBLT    = 0x0C,         /* A32 supervisory 64-bit block trnsfer         */
00075         cvA32_U_BLT     = 0x0B,         /* A32 non-privileged block transfer            */
00076         cvA32_U_PGM     = 0x0A,         /* A32 non-privileged program access            */
00077         cvA32_U_DATA    = 0x09,         /* A32 non-privileged data access               */
00078         cvA32_U_MBLT    = 0x08,         /* A32 non-privileged 64-bit block trnsfer      */
00079         cvA32_LCK       = 0x05,         /* A32 lock command                             */
00080 
00081         cvCR_CSR        = 0x2F,         /* CR/CSR space                                 */
00082 
00083 /*
00084         The following address modifiers are not yet implemented.
00085 */
00086 
00087         cvA40_BLT       = 0x37,         /* A40 block transfer (MD32)                    */
00088         cvA40_LCK       = 0x35,         /* A40 lock command                             */
00089         cvA40           = 0x34,         /* A40 access                                   */
00090 
00091         cvA64           = 0x01,         /* A64 single trnsfer access                    */
00092         cvA64_BLT       = 0x03,         /* A64 block transfer                           */
00093         cvA64_MBLT      = 0x00,         /* A64 64-bit block transfer                    */
00094         cvA64_LCK       = 0x04,         /* A64 lock command                             */
00095 
00096         cvA3U_2eVME     = 0x21,         /* 2eVME for 3U modules                         */
00097         cvA6U_2eVME     = 0x20          /* 2eVME for 6U modules                         */
00098 } CVAddressModifier;
00099 
00100 /*
00101         Error codes returned by the exported functions.
00102 */
00103 typedef enum CVErrorCodes {
00104         cvSuccess       =  0,           /* Operation completed successfully             */
00105         cvBusError      = -1,           /* VME bus error during the cycle               */
00106         cvCommError     = -2,           /* Communication error                          */
00107         cvGenericError  = -3,           /* Unspecified error                            */
00108         cvInvalidParam  = -4,           /* Invalid parameter                            */
00109         cvTimeoutError  = -5,           /* Timeout error                                */
00110 } CVErrorCodes;
00111 
00112 /*
00113         Pulser selection.
00114 */
00115 typedef enum CVPulserSelect {
00116         cvPulserA = 0,                  /* Identifies the pulser 'A'                    */
00117         cvPulserB = 1                   /* Identifies the pulser 'B'                    */
00118 } CVPulserSelect;
00119 
00120 /*
00121         Output selection.
00122 */
00123 typedef enum CVOutputSelect {
00124         cvOutput0 = 0,                  /* Identifies the output line 0                 */
00125         cvOutput1 = 1,                  /* Identifies the output line 1                 */
00126         cvOutput2 = 2,                  /* Identifies the output line 2                 */
00127         cvOutput3 = 3,                  /* Identifies the output line 3                 */
00128         cvOutput4 = 4                   /* Identifies the output line 4                 */
00129 } CVOutputSelect;
00130 
00131 /*
00132         Input selection.
00133 */
00134 typedef enum CVInputSelect {
00135         cvInput0 = 0,                   /* Identifies the input line 0                  */
00136         cvInput1 = 1                    /* Identifies the input line 1                  */
00137 } CVInputSelect;
00138 
00139 /*
00140         Signal sources.
00141 */
00142 typedef enum CVIOSources {
00143         cvManualSW    = 0,              /* Manual (button) or software controlled       */
00144         cvInputSrc0   = 1,              /* Input line 0                                 */
00145         cvInputSrc1   = 2,              /* Input line 1                                 */
00146         cvCoincidence = 3,              /* Inputs coincidence                           */
00147         cvVMESignals  = 4,              /* Signals from VME bus                         */
00148         cvMiscSignals = 6               /* Various internal signals                     */
00149 } CVIOSources;
00150 
00151 /*
00152         Time base units to specify pulses period and width.
00153 */
00154 typedef enum CVTimeUnits {
00155         cvUnit25ns   = 0,               /* Time unit is 25 nanoseconds                  */
00156         cvUnit1600ns = 1,               /* Time unit is 1.6 microseconds                */
00157         cvUnit410us  = 2,               /* Time unit is 410 microseconds                */
00158         cvUnit104ms  = 3                /* Time unit is 104 milliseconds                */
00159 } CVTimeUnits;
00160 
00161 /*
00162         Polarity for LED emitting.
00163 */
00164 typedef enum CVLEDPolarity {
00165         cvActiveHigh = 0,               /* LED emits on signal high level               */
00166         cvActiveLow  = 1                /* LED emits on signal low level                */
00167 } CVLEDPolarity;
00168 
00169 /*
00170         Input and Output signal polarity.
00171 */
00172 typedef enum CVIOPolarity {
00173         cvDirect   = 0,                 /* Normal polarity                              */
00174         cvInverted = 1                  /* Inverted polarity                            */
00175 } CVIOPolarity;
00176 
00177 /*
00178         Accessible registers.
00179 */
00180 typedef enum CVRegisters {
00181         cvStatusReg      = 0x00,        /* Status register                              */
00182         cvVMEControlReg  = 0x01,        /* VME Control register                         */
00183         cvFwRelReg       = 0x02,        /* Firmware Release register                    */
00184         cvFwDldReg       = 0x03,        /* Firmware Download register                   */
00185         cvFlenaReg       = 0x04,        /* Flash Enable                                 */
00186         cvVMEIRQEnaReg   = 0x06,        /* VME IRQ Lines Enable                         */
00187         cvInputReg       = 0x08,        /* Input register                               */
00188         cvOutRegSet      = 0x0A,        /* Output register                              */
00189         cvInMuxRegSet    = 0x0B,        /* Input Multiplexer                            */
00190         cvOutMuxRegSet   = 0x0C,        /* Output Multiplexer                           */
00191         cvLedPolRegSet   = 0x0D,        /* Led Polarity                                 */
00192         cvOutRegClear    = 0x10,        /* Output register                              */
00193         cvInMuxRegClear  = 0x11,        /* Input Multiplexer                            */
00194         cvOutMuxRegClear = 0x12,        /* Output Multiplexer                           */
00195         cvLedPolRegClear = 0x13,        /* Led Polarity                                 */
00196         cvPulserA0       = 0x16,        /* Period and width of Pulser A                 */
00197         cvPulserA1       = 0x17,        /* Num pulses and range of Pulser A             */
00198         cvPulserB0       = 0x19,        /* Period and width of Pulser B                 */
00199         cvPulserB1       = 0x1A,        /* Num pulses and range of Pulser B             */
00200         cvScaler0        = 0x1C,        /* Limit and Autores of Scaler A                */
00201         cvScaler1        = 0x1D,        /* Counter value of Scaler A                    */
00202         cvDispADL        = 0x20,        /* Display AD[15:0]                             */
00203         cvDispADH        = 0x21,        /* Display AD[31:16]                            */
00204         cvDispDTL        = 0x22,        /* Display DT[15:0]                             */
00205         cvDispDTH        = 0x23,        /* Display DT[31:16]                            */
00206         cvDispC1         = 0x24,        /* Display Control left bar                     */
00207         cvDispC2         = 0x25,        /* Display Control left bar                     */
00208         cvLMADL          = 0x28,        /* Loc. Mon. AD[15:0]                           */
00209         cvLMADH          = 0x29,        /* Loc. Mon. AD[31:16]                          */
00210         cvLMC            = 0x2C         /* Loc. Mon. Controls                           */
00211 } CVRegisters;
00212 
00213 /*
00214         Bits for status register decoding.
00215 */
00216 typedef enum CVStatusRegisterBits {
00217         cvSYSRES   = 0x0001,            /* VME is in system reset state                 */
00218         cvSYSCTRL  = 0x0002,            /* The bridge is the VME system controller      */
00219         cvDTACK    = 0x0010,            /* Last access has generated a DTACK signal     */
00220         cvBERR     = 0x0020,            /* Last access has generated a bus error        */
00221         cvDIP0     = 0x0100,            /* Dip Switch position 0 state                  */
00222         cvDIP1     = 0x0200,            /* Dip Switch position 1 state                  */
00223         cvDIP2     = 0x0400,            /* Dip Switch position 2 state                  */
00224         cvDIP3     = 0x0800,            /* Dip Switch position 3 state                  */
00225         cvDIP4     = 0x1000,            /* Dip Switch position 4 state                  */
00226         cvUSBTYPE  = 0x8000             /* USB Speed: 0 = Full; 1 = High                */
00227 } CVStatusRegisterBits;
00228 
00229 /*
00230         Bits for input register decoding.
00231 */
00232 typedef enum CVInputRegisterBits {
00233         cvIn0Bit        = 0x0001,       /* Input line 0 signal level.                   */
00234         cvIn1Bit        = 0x0002,       /* Input line 1 signal level.                   */
00235         cvCoincBit      = 0x0004,       /* Coincidence of input signal level.           */
00236         cvPulsAOutBit   = 0x0008,       /* Pulser A output signal level.                */
00237         cvPulsBOutBit   = 0x0010,       /* Pulser B output signal level.                */
00238         cvScalEndCntBit = 0x0020,       /* Scaler end counter signal level.             */
00239         cvLocMonBit     = 0x0040,       /* Location monitor signal level.               */
00240 } CVInputRegisterBits;
00241 
00242 /*
00243         Bits for input register decoding.
00244 */
00245 typedef enum CVOutputRegisterBits {
00246         cvPulsAStartBit = 0x0001,       /* Pulser A start signal level.                 */
00247         cvPulsAResetBit = 0x0002,       /* Pulser A reset signal level.                 */
00248         cvPulsBStartBit = 0x0004,       /* Pulser B start signal level.                 */
00249         cvPulsBResetBit = 0x0008,       /* Pulser B reset signal level.                 */
00250         cvScalGateBit   = 0x0010,       /* Scaler gate signal level.                    */
00251         cvScalResetBit  = 0x0020,       /* Scaler reset counter signal level.           */
00252         cvOut0Bit       = 0x0040,       /* Output line 0 signal level.                  */
00253         cvOut1Bit       = 0x0080,       /* Output line 1 signal level.                  */
00254         cvOut2Bit       = 0x0100,       /* Output line 2 signal level.                  */
00255         cvOut3Bit       = 0x0200,       /* Output line 3 signal level.                  */
00256         cvOut4Bit       = 0x0400,       /* Output line 4 signal level.                  */
00257 } CVOutputRegisterBits;
00258 
00259 /*
00260         Types of VME Arbiter.
00261 */
00262 typedef enum CVArbiterTypes {
00263         cvPriorized  = 0,     /* Priority Arbiter                             */
00264         cvRoundRobin = 1      /* Round-Robin Arbiter                          */
00265 } CVArbiterTypes;
00266 
00267 /*
00268         Types of VME Bus Requester.
00269 */
00270 typedef enum CVRequesterTypes {
00271         cvFair   = 0,         /* Fair bus requester                           */
00272         cvDemand = 1          /* On demand bus requester                      */
00273 } CVRequesterTypes;
00274 
00275 /*
00276         Types of VME Bus release.
00277 */
00278 typedef enum CVReleaseTypes {
00279         cvRWD   = 0,          /* Release When Done                            */
00280         cvROR   = 1           /* Release On Request                           */
00281 } CVReleaseTypes;
00282 
00283 /*
00284         VME bus request levels.
00285 */
00286 typedef enum CVBusReqLevels {
00287         cvBR0 = 0,            /* Bus request level 0                          */
00288         cvBR1 = 1,            /* Bus request level 1                          */
00289         cvBR2 = 2,            /* Bus request level 2                          */
00290         cvBR3 = 3             /* Bus request level 3                          */
00291 } CVBusReqLevels;
00292 
00293 /*
00294         VME Interrupt levels.
00295 */
00296 typedef enum CVIRQLevels {
00297         cvIRQ1 = 0x01,        /* Interrupt level 1                            */
00298         cvIRQ2 = 0x02,        /* Interrupt level 2                            */
00299         cvIRQ3 = 0x04,        /* Interrupt level 3                            */
00300         cvIRQ4 = 0x08,        /* Interrupt level 4                            */
00301         cvIRQ5 = 0x10,        /* Interrupt level 5                            */
00302         cvIRQ6 = 0x20,        /* Interrupt level 6                            */
00303         cvIRQ7 = 0x40         /* Interrupt level 7                            */
00304 } CVIRQLevels;
00305 
00306 /*
00307         VME bus timeouts.
00308 */
00309 typedef enum CVVMETimeouts {
00310         cvTimeout50us   = 0,  /* Timeout is 50 microseconds                   */
00311         cvTimeout400us  = 1   /* Timeout is 400 microseconds                  */
00312 } CVVMETimeouts;
00313 
00314 /*
00315         Data type to store the front panel display last access data.
00316 */
00317 typedef struct CVDisplay {
00318         long      cvAddress;  /* VME Address                                  */
00319         long      cvData;     /* VME Data                                     */
00320         long      cvAM;       /* Address modifier                             */
00321         long      cvIRQ;      /* IRQ levels                                   */
00322         CAEN_BOOL cvDS0;      /* Data Strobe 0 signal                         */
00323         CAEN_BOOL cvDS1;      /* Data Strobe 1 signal                         */
00324         CAEN_BOOL cvAS;       /* Address Strobe signal                        */
00325         CAEN_BOOL cvIACK;     /* Interrupt Acknowledge signal                 */
00326         CAEN_BOOL cvWRITE;    /* Write signal                                 */
00327         CAEN_BOOL cvLWORD;    /* Long Word signal                             */
00328         CAEN_BOOL cvDTACK;    /* Data Acknowledge signal                      */
00329         CAEN_BOOL cvBERR;     /* Bus Error signal                             */
00330         CAEN_BOOL cvSYSRES;   /* System Reset signal                          */
00331         CAEN_BOOL cvBR;       /* Bus Request signal                           */
00332         CAEN_BOOL cvBG;       /* Bus Grant signal                             */
00333 } CVDisplay;
00334 
00335 #endif // __CAENVMETYPES_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated on 20 Jun 2014 for daqman by  doxygen 1.6.1