vt48.h

Go to the documentation of this file.
00001 /*********************************************************************
00002 
00003   Name:         VT48.h
00004   Created by:   Pierre-Andre Amaudruz, Chris Ohlmann
00005 
00006   Contents:      Routines for accessing the vt48 Triumf board
00007 
00008   $Id: vt48.h 3754 2007-07-16 22:20:45Z amaudruz $
00009 *********************************************************************/
00010 #ifndef __VT48_INCLUDE_H__
00011 #define __VT48_INCLUDE_H__
00012 
00013 #include "mvmestd.h"
00014 #include <stdio.h>
00015 #include <string.h>
00016 
00017 #ifdef __cplusplus
00018 extern "C" {
00019 #endif
00020 
00021 #define VT48_SUCCESS                    1 // 
00022 #define VT48_ERR_NODATA                10 // no data error... timeout 
00023 #define VT48_PARAM_ERROR              100 // parameters error
00024 #define VT48_CSR_RO            (DWORD) (0x0000) 
00025 #define VT48_OCCUPANCY_RO      (DWORD) (0x0000) 
00026 #define VT48_CMD_REG           (DWORD) (0x0004)
00027 #define VT48_DATA_FIFO         (DWORD) (0x1000)
00028 #define VT48_AMT_CFG_RW        (WORD)  (0x1)
00029 #define VT48_AMT_STATUS_R      (WORD)  (0x2)
00030 #define VT48_AMT_ID_R          (WORD)  (0x3)
00031 
00032 #define VT48_HEADER            (DWORD) (0x10000000)
00033 #define VT48_TRAILER           (DWORD) (0x80000000)
00034 
00035 #define VT48_ID1_REG_RO        (DWORD) (0x0008)
00036 #define VT48_ID2_REG_RO        (DWORD) (0x000C)
00037 
00038 // Status Registers
00039 #define VT48_CSR16_REG         (DWORD) (0x0020)
00040 #define VT48_CSR17_REG         (DWORD) (0x0024)
00041 #define VT48_CSR18_REG         (DWORD) (0x0028)
00042 #define VT48_CSR19_REG         (DWORD) (0x002c)
00043 #define VT48_CSR20_REG         (DWORD) (0x0030)
00044 #define VT48_CSR21_REG         (DWORD) (0x0034)
00045 
00046 #define VT48_CSR0_REG          (DWORD) (0x0040)
00047 #define VT48_CSR1_REG          (DWORD) (0x0044)
00048 #define VT48_CSR2_REG          (DWORD) (0x0048)
00049 #define VT48_CSR3_REG          (DWORD) (0x004C)
00050 #define VT48_CSR4_REG          (DWORD) (0x0050)
00051 #define VT48_CSR5_REG          (DWORD) (0x0054)
00052 #define VT48_CSR6_REG          (DWORD) (0x0058)
00053 #define VT48_CSR7_REG          (DWORD) (0x005C)
00054 #define VT48_CSR8_REG          (DWORD) (0x0060)
00055 #define VT48_CSR9_REG          (DWORD) (0x0064)
00056 #define VT48_CSR10_REG         (DWORD) (0x0068)
00057 #define VT48_CSR11_REG         (DWORD) (0x006C)
00058 #define VT48_CSR12_REG         (DWORD) (0x0070)
00059 #define VT48_CSR13_REG         (DWORD) (0x0074)
00060 #define VT48_CSR14_REG         (DWORD) (0x0078)
00061 
00062 #define VT48_CSR0_RB_REG       (DWORD) (0x0080)
00063 #define VT48_CSR1_RB_REG       (DWORD) (0x0084)
00064 #define VT48_CSR2_RB_REG       (DWORD) (0x0088)
00065 #define VT48_CSR3_RB_REG       (DWORD) (0x008C)
00066 #define VT48_CSR4_RB_REG       (DWORD) (0x0090)
00067 #define VT48_CSR5_RB_REG       (DWORD) (0x0094)
00068 #define VT48_CSR6_RB_REG       (DWORD) (0x0098)
00069 #define VT48_CSR7_RB_REG       (DWORD) (0x009C)
00070 #define VT48_CSR8_RB_REG       (DWORD) (0x00A0)
00071 #define VT48_CSR9_RB_REG       (DWORD) (0x00A4)
00072 #define VT48_CSR10_RB_REG      (DWORD) (0x00A8)
00073 #define VT48_CSR11_RB_REG      (DWORD) (0x00AC)
00074 #define VT48_CSR12_RB_REG      (DWORD) (0x00B0)
00075 #define VT48_CSR13_RB_REG      (DWORD) (0x00B4)
00076 #define VT48_CSR14_RB_REG      (DWORD) (0x00B8)
00077 
00078 /*-------------------------------------------*/  
00079 /*
00080   enum vt48_DataType {
00081     vt48_typeasdx1 =0,
00082     vt48_typeasdx2 =1,
00083   };
00084 */
00085   
00086 typedef union {
00087   DWORD id;
00088   struct Entry1 {
00089     unsigned id1:16;
00090     unsigned id2:16;
00091   } vtr0;
00092   struct csr0 {
00093     unsigned csr0:12;
00094     unsigned na1:4;
00095     unsigned csr1:12;
00096     unsigned na2:4;
00097   } vtr1;
00098 } vt48_Reg;
00099 
00100   
00101 int   vt48_EventRead(MVME_INTERFACE *myvme, DWORD base, DWORD *pdest, int *nentry);
00102 void  vt48_RegWrite(MVME_INTERFACE *mvme, DWORD base, DWORD reg, DWORD data);
00103 DWORD vt48_RegRead(MVME_INTERFACE *mvme, DWORD base, WORD reg);
00104 void  vt48_StatusPrint(MVME_INTERFACE *mvme, DWORD base);
00105 void  vt48_Status(MVME_INTERFACE *mvme, DWORD base);
00106 int   vt48_Setup(MVME_INTERFACE *mvme, DWORD base, int mode); 
00107 void  vt48_RegPrint(MVME_INTERFACE *mvme, DWORD base);
00108 void  vt48_WindowSet(MVME_INTERFACE *mvme, DWORD base, float window);
00109 void  vt48_WindowOffsetSet(MVME_INTERFACE *mvme, DWORD base, float offset);
00110       
00111 #ifdef __cplusplus
00112 }
00113 #endif
00114 
00115 #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