Main Page   Modules   Namespace List   Class Hierarchy   Data Structures   File List   Namespace Members   Data Fields   Globals   Related Pages  

ABCDchip.h

Go to the documentation of this file.
00001 /******************************************************************************
00002  * 
00003  *  Title  : ABCDcommands.h  ==> ABCDchip.h, ABCDfxn.h
00004  *  Version: 15 June 2002
00005  *   
00006  *  Description:  
00007  *  Related files: ABCDcommands.c
00008  *  Documentation: http://s.home.cern.ch/s/sct/public/sctdaq/sctdaq.html
00009  *
00010  *  Author: Lukas Tomasek, tomasekl@fzu.cz
00011  *
00012  *  modifications/bugs:
00013  *
00014  *  Merged in the definitions from ABCDconfig.h                  14.01.03 dpsf
00015  ******************************************************************************/
00016 
00017 #ifndef ABCD_CHIP_H  /* multiple inclusion protection */
00018 #define ABCD_CHIP_H
00019  
00020  /* chip address (bits 5:4) */
00021 #define PRIMARY_FIBRE     0x2
00022 #define ADJACENT_FIBRE    0x3
00023 /* chip address (bits 3:0) */ 
00024 #define ALL_CHIPS           0x3F   
00025 #define CHIP_ADDR_LOOP      0xFF    
00026 
00027 #define M0_CHIP     0x0
00028 #define S1_CHIP     0x1  
00029 #define S2_CHIP     0x2  
00030 #define S3_CHIP     0x3  
00031 #define S4_CHIP     0x4  
00032 #define E5_CHIP     0x5  
00033 #define M8_CHIP     0x8  
00034 #define S9_CHIP     0x9 
00035 #define S10_CHIP    0xA  
00036 #define S11_CHIP    0xB  
00037 #define S12_CHIP    0xC  
00038 #define E13_CHIP    0xD  
00039 
00040 /* full chip address (bits 5:0) */
00041 #define CHIP_ADDRESS(fibre, addressBits3to0) (((fibre)<<4)|(addressBits3to0))
00042 
00043 #define CHIP_ALLCHIPS_ADDR_CONSTRUCT  0xf
00044 
00045 /* readout mode */
00046 #define RM_HIT     0x0   /* detector alignment */
00047 #define RM_LEVEL   0x1   /* normal data taking */ 
00048 #define RM_EDGE    0x2   /* normal data taking */
00049 #define RM_TEST    0x3   /* test mode */
00050 
00051 /* calibration mode */
00052 #define CAL_IN3      0x0  
00053 #define CAL_IN2      0x1  
00054 #define CAL_IN1      0x2
00055 #define CAL_IN0      0x3
00056 
00057 /* trim DAC range */
00058 #define TRIM_DAC_RANGE_60mV    0x0
00059 #define TRIM_DAC_RANGE_120mV   0x1  
00060 #define TRIM_DAC_RANGE_180mV   0x2  
00061 #define TRIM_DAC_RANGE_240mV   0x3
00062 
00063 /* command length in bits */
00064 #define L1_TRIGGER_LENGTH  3
00065 #define FAST_CMD_LENGTH    7
00066 #define SLOW_CMD_LENGTH   27
00067 #define DATA_CMD_LENGTH   64
00068 #define MASK_CMD_LENGTH  192
00069 
00070 #define NO_CMD           100
00071 
00072 typedef enum { 
00073     L1_TRIGGER          =101,
00074     SOFT_RESET          =102,
00075     BC_RESET            =103
00076 } FAST_CMD_ID;
00077 
00078 typedef enum { 
00079     PULSE_INPUT_REG     =104,
00080     ENABLE_DATA_TAKING  =105, 
00081     CALIBRATION_PULSE   =106
00082 } SLOW_CMD_ID;
00083 
00084 typedef enum {
00085     CONFIG_REG         =107,
00086     STROBE_DELAY_REG   =108, 
00087     THRESHOLD_REG      =109, 
00088     BIAS_DAC_REG       =110,  
00089     TRIM_DAC_REG       =111 
00090 } DATA_CMD_ID;
00091 
00092 typedef enum {
00093     DELAY              =112,
00094     MASK               =113
00095 } EXTRA_CMD_ID;
00096 
00097 
00098 /* merged from ABCDconfig.h */
00099 typedef enum {
00100   MISSING = 0,
00101   DEAD = 1,
00102   END = 2,
00103   MASTER = 3,
00104   SLAVE = 4,
00105   LONELY = 5,
00106   PARANOID = 6
00107 } ABCD_ROLES;
00108 
00109 #endif /* ABCD_CHIP_H */

Generated on Mon Dec 15 19:35:55 2003 for SCT DAQ/DCS Software by doxygen1.3-rc3