Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

strapdv.h

Go to the documentation of this file.
00001 #ifndef STRAPDV_H
00002 #define STRAPDV_H
00003 /******************************************************************************
00004 * E.S.O. - VLT project
00005 *
00006 * "@(#) $Id: strapdv.h,v 3.4 2002/05/07 09:17:41 vltsccm Exp $"
00007 *
00008 * strap.h  -  This is the interface file for the LCU STRAP device driver which
00009 *             forms a module of the VLT software. It contains the declarations
00010 *             user available constants, data types and variables as well as the
00011 *             function prototypes.
00012 *
00013 * who        when       what
00014 * ---------  ---------- ----------------------------------------------
00015 * microgate  29/07/98   created
00016 */
00017 
00018 #include "lcudrv.h"    /* Include common driver literals */
00019 #include "strapdvCommands.h" /* Include STRAP command definitions */
00020 
00021 /*
00022  * Define mnemonics for driver errors
00023  */
00024 
00025 #define strapdvOK                       0
00026 #define strapdvERR_INV_TIMEOUT       -400  /* Timeout out of range */
00027 #define strapdvERR_INV_IR_LEVEL      -405  /* Interrupt level out of range */
00028 #define strapdvERR_INV_IR_NUMBER     -410  /* Interrupt number out of range */
00029 #define strapdvERR_NO_EXCLUSIVE      -420  /* No channel opened in "exclusive" mode */
00030 #define strapdvERR_INV_BOARD_CONFIG  -425  /* Board configuration mismatch between  */
00031              /* SW config. parameters and dip-switch  */
00032 #define strapdvERR_IR_CONNECT        -430  /* Cannot connect to specific interrupt */
00033 #define strapdvERR_ENABLE_IR_LEVEL   -435  /* Cannot enable interrupt level        */
00034 #define strapdvERR_NO_DIAG           -440  /* Diagnostic data not yet available    */
00035 #define strapdvERR_NO_DATA           -445  /* Real Time data not yet available     */
00036 #define strapdvERR_INV_PARAMETER     -450  /* Configuration device parameter not valid */
00037 #define strapdvERR_INV_SEM_ID        -455  /* Invalid semaphore identifier           */
00038 #define strapdvERR_INV_RT_PTR        -460  /* Invalid Real Time data buffer pointer  */
00039 #define strapdvERR_OVERFLOW          -465  /* Overflow in circular buffer. Data have */
00040                                            /* been overwritten */
00041 /* 
00042  * Define indexes for status mask
00043  */
00044 #define  strapMASK_CLOSED_LOOP      0
00045 #define  strapMASK_HV_ON            1
00046 #define  strapMASK_OVER_CURR        2
00047 #define  strapMASK_OVER_COUNTS      3
00048 #define  strapMASK_TEMP_CTRL        4
00049 #define  strapMASK_OVER_TEMP        5
00050 #define  strapMASK_DISTURB_MODE     6
00051 #define  strapMASK_HV_FLAG          7
00052 #define  strapMASK_RT_MODE          8
00053 #define  strapMASK_INT_SIGNAL       9
00054 #define  strapMASK_CIRC_BUFFER     10
00055 #define  strapMASK_DATA_READY      11
00056 #define  strapMASK_PROCESS_DIST    12
00057 #define  strapMASK_E2PROM          13
00058 #define  strapMASK_CBUF_OVERFLOW   14
00059 #define  strapMASK_SIMULATION      15
00060 
00061 #define  strapMASK_DIAG_MONITOR    16
00062 #define  strapMASK_CHOPPING_MODE   17
00063 #define  strapMASK_CHOP_ON         18
00064 
00065 /*
00066  * TYPE OF STANDARD I/O BLOCKS
00067  */
00068 #define TYPE_NR_BLOCK_0 0x00      /* command block */
00069 #define TYPE_NR_BLOCK_1 0x01      /* setup block */
00070 #define TYPE_NR_BLOCK_2 0x02      /* disturb block */
00071 #define TYPE_NR_BLOCK_3 0x03      /* not used */
00072 #define TYPE_NR_BLOCK_4 0x04      /* not used */ 
00073 #define TYPE_NR_BLOCK_5 0x05      /* not used */ 
00074 #define TYPE_NR_BLOCK_6 0x06      /* not used */
00075 #define TYPE_NR_BLOCK_7 0x07      /* reply block !!! */
00076 #define TYPE_NR_BLOCK_8 0x08      /* high voltage block */
00077 #define TYPE_NR_BLOCK_9 0x09      /* static block */
00078 
00079 /*
00080  * TYPE OF DOWNLOADING BLOCKS
00081  */
00082 #define TYPE_DL_BLOCK_0 0x0000    /* command block */
00083 #define TYPE_DL_BLOCK_1 0x0001    /* program memory block */
00084 #define TYPE_DL_BLOCK_2 0x0002    /* data memory block */
00085 
00086 /*
00087  * TYPE OF NOTIFY BY REAL-TIME INTERRUPT
00088  */
00089 #define RT_NOTIFY       0x0001    /* real time notify */
00090 #define DIAG_NOTIFY     0x0002    /* diagnostic notify */
00091 
00092 /* length of setup block */
00093 #define strapLENGTH_OF_SETUP_BLOCK       0x0016   /* in words */
00094 
00095 /* length of static block */
00096 #define strapLENGTH_OF_STATIC_BLOCK      0x0029   /* in words */
00097 
00098 /* length of status block */
00099 #define strapLENGTH_OF_STATUS_BLOCK      0x0009   /* in words */
00100 
00101 /* length of diagnostic block */
00102 #define strapLENGTH_OF_DIAGNOSTIC_BLOCK  0x002B   /* in words */
00103 
00104 /* length of disturb sub-block */
00105 #define strapLENGTH_OF_TMPDIST_BLOCK     0x0008   /* in words */
00106 
00107 /* length of dspStrap software version */
00108 #define strapLENGTH_OF_SOFTVERS_BLOCK    0x0020   /* in words */
00109 
00110 /* maximum number of disturb and data records */
00111 #define strapNUMBER_OF_RAM_RECORDS        58248
00112 
00113 /* number of fields in a data records */
00114 #define strapLENGTH_OF_DATA_RECORD            6
00115 
00116 /* length of ram data block */
00117 #define strapLENGTH_OF_RAM_BLOCK         0x0078   /* in word */
00118 
00119 /* length of HV setu block */
00120 #define strapLENGTH_OF_HV_BLOCK          0x0018   /* in words */
00121 
00122 /*
00123  * Define positions in the array for the static setup fields
00124  */
00125 
00126 #define dspCTRL_COEFF      0
00127 #define dspCOUNT_LIMIT    32
00128 #define dspHIGH_VOLT      33
00129 #define dspGATE           37
00130 #define dspTEMPERATURE    38
00131 #define dspHOLDOFF        39
00132 #define dspTIMEOUT        40
00133 
00134 /*
00135  * Define positions in the array for the Dynamic setup fields
00136  */
00137 
00138 #define dspINT_MATRIX      0
00139 #define dspINT_TIME        4
00140 #define dspDIAG_RATE       5
00141 #define dspDATA_RECS       6
00142 #define dspSPOT_OFFX       7
00143 #define dspSPOT_OFFY       8
00144 #define dspSKYBACKGND      9
00145 #define dspFLUX_THRESHOLD 10
00146 #define dspNUM_CHOP_POS   11
00147 #define dspCHOP_X         12
00148 #define dspCHOP_Y         17
00149 
00150 /*
00151  * STRAP driver provided functions
00152  */
00153 int strapdvDrv       (int devices, int channels, int timeout);
00154 int strapdvDevCreate (char *devName, void *baseAddrA16, int intrNumber,
00155           int intrLevel, int boardId);
00156 
00157 /*
00158  * STRAP driver tool functions
00159  */
00160 int strapdvVersion      (void);
00161 int strapdvDevShow      (void);
00162 int strapdvPrintRegs    (int unit);
00163 int strapdvSetRegs      (int unit, UINT16 value);
00164 int strapdvPrintDevice  (int unit);
00165 int strapdvPrintError   (int errorCode);
00166 int strapdvPrintCmd     (int cmdCode);
00167 int strapdvPrintChannel (int fd);
00168 
00169 #endif /* !STRAPDV_H */

Generated on Wed Dec 3 14:52:19 2003 for ATCS API by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001