vt2.h

Go to the documentation of this file.
00001 /*********************************************************************
00002   Name:         vt2.h
00003   Created by:   Pierre-Andre Amaudruz
00004 
00005   Contents: Simple interface to a VME TDC function
00006   vme_poke -a VME_A24UD -d VME_D32 -A 0xe00008 0x1
00007   vme_peek -a VME_A24UD -d VME_D32 -A 0xe00004
00008   vme_peek -a VME_A24UD -d VME_D32 -A 0xe0000c
00009 
00010   $Id: vt2.h 3746 2007-07-10 08:26:11Z amaudruz $
00011 *********************************************************************/
00012 #include <stdio.h>
00013 #include <string.h>
00014 #include <stdio.h>
00015 
00016 #ifndef  __VT2_INCLUDE_H__
00017 #define  __VT2_INCLUDE_H__
00018 
00019 #ifndef MIDAS_TYPE_DEFINED
00020 #define MIDAS_TYPE_DEFINED
00021 
00022 typedef unsigned char BYTE;
00023 typedef unsigned short int WORD;
00024 #ifndef OS_WINNT // Windows defines already DWORD
00025 typedef unsigned int DWORD;
00026 #endif
00027 
00028 #ifndef OS_WINNT
00029 #ifndef OS_VXWORKS
00030 typedef DWORD BOOL;
00031 #endif
00032 #endif
00033 
00034 #endif                          /* MIDAS_TYPE_DEFINED */
00035 
00036 #define  VT2_MAX_CHANNELS    (DWORD) 2
00037 #define  VT2_CSR_RO          (DWORD) (0x0)
00038 #define  VT2_FIFOSTATUS_RO   (DWORD) (0x4)
00039 #define  VT2_CYCLENUMBER_RO  (DWORD) (0x8)
00040 #define  VT2_CTL_WO          (DWORD) (0xc)
00041 #define  VT2_INTREG          (DWORD) (0x10)
00042 #define  VT2_FIFO_RO         (DWORD) (0x14)
00043 #define  VT2_MANRESET        (DWORD) (0x1)
00044 #define  VT2_CYCLERESET      (DWORD) (0x2)
00045 #define  VT2_KEEPALIVE       (DWORD) (0x4)
00046 #define  VT2_INTENABLE       (DWORD) (0x8)
00047 #define  VT2_FULL_FLAG       (DWORD) (0x10000)
00048 #define  VT2_ALMOSTFULL_FLAG (DWORD) (0x20000)
00049 #define  VT2_EMPTY_FLAG      (DWORD) (0x40000)
00050 
00051 #define  VT2_HSTART          (DWORD) (1<<31)
00052 #define  VT2_HIT1            (DWORD) (1<<30)
00053 #define  VT2_HIT2            (DWORD) (1<<29)
00054 #define  VT2_HSTOP           (DWORD) (1<<28)
00055 
00056 #define  VT2_CYCLE_MASK      (DWORD) (0x03FF0000)
00057 #define  VT2_CYCLE_SHIFT     (DWORD) (16)
00058 
00059 #ifdef  __VMICVME_H__
00060 int  vt2_CSRRead(MVME_INTERFACE *mvme, DWORD base);
00061 void vt2_ManReset(MVME_INTERFACE *mvme, DWORD base);
00062 int  vt2_FifoLevelRead(MVME_INTERFACE *mvme, DWORD base);
00063 int  vt2_FifoRead(MVME_INTERFACE *mvme, DWORD base, DWORD *pdest, int evtcnt);
00064 int  vt2_CycleNumberRead(MVME_INTERFACE *mvme, DWORD base);
00065 void vt2_CycleReset(MVME_INTERFACE *mvme, DWORD base, int fset);
00066 void vt2_KeepAlive(MVME_INTERFACE *mvme, DWORD base, int fset);
00067 #endif
00068 
00069 #endif

Midas DOC Version 2.0.2 ---- PSI Stefan Ritt ----
Contributions: Pierre-Andre Amaudruz - Sergio Ballestrero - Suzannah Daviel - Doxygen - Peter Green - Qing Gu - Greg Hackman - Gertjan Hofman - Paul Knowles - Exaos Lee - Rudi Meier - Glenn Moloney - Dave Morris - John M O'Donnell - Konstantin Olchanski - Renee Poutissou - Tamsen Schurman - Andreas Suter - Jan M.Wouters - Piotr Adam Zolnierczuk