vpc6.h

Go to the documentation of this file.
00001 /*********************************************************************
00002 
00003   Name:         VPC6.h
00004   Created by:   Pierre-Andre Amaudruz
00005 
00006   Contents:      Routines for accessing the vpc6 Triumf board
00007 
00008   $Id: vpc6.h 3747 2007-07-10 08:30:09Z amaudruz $
00009 *********************************************************************/
00010 #ifndef __VPC6_INCLUDE_H__
00011 #define __VPC6_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 VPC6_SUCCESS                    1 //
00022 #define VPC6_PARAM_ERROR              100 // parameters error
00023 #define VPC6_SR_RO         (WORD) (0x0000)
00024 #define VPC6_CR_RW         (WORD) (0x0004)
00025 #define VPC6_CMD_WO        (WORD) (0x000C)
00026 #define VPC6_CFG_RW        (WORD) (0x0010)
00027 #define VPC6_RBCK_RO       (WORD) (0x0110)
00028 
00029 #define VPC6_ASD01         0
00030 #define VPC6_ALL_BUCKEYE   0x555
00031 #define VPC6_ALL_ASD       0x000
00032 #define VPC6_3ASD_3BUCK    0x444
00033 #define VPC6_3BUCK_3ASD    0x111
00034 #define ALL_CHANNELS       -1
00035 
00036 
00037 /*-------------------------------------------*/
00038   enum vpc6_ASDDataType {
00039     vpc6_asd_ch1_8 =0,
00040     vpc6_asd_ch9_16 =1,
00041   };
00042 
00043   typedef union {
00044     DWORD asdcfg;
00045     struct Entry1 {
00046       unsigned chipmode:1; // bit0 here
00047       unsigned channelmode:16;
00048       unsigned deadtime:3;
00049       unsigned wilkinsonRCurrent:3;
00050       unsigned wilkinsonIGate:4;
00051       unsigned hysteresisDAC:4;
00052       unsigned wilkinsonADC:1; // bit0 here
00053     } asdx1;
00054     struct Entry2 {
00055       unsigned wilkinsonADC:2; // bit2..1 here
00056       unsigned mainThresholdDAC:8;
00057       unsigned capInjCapSel:3;
00058       unsigned calMaskReg:8;
00059       unsigned notused:10;
00060     } asdx2;
00061   } vpc6_Reg;
00062 
00063 /*-------------------------------------------*/
00064 #define VPC6_BUCKEYE       1
00065 #define VPC6_NORMAL        0x0
00066 #define VPC6_SMALLCAP      0x1
00067 #define VPC6_MEDIUMCAP     0x2
00068 #define VPC6_LARGECAP      0x3
00069 #define VPC6_EXTERNALCAP   0x4
00070 #define VPC6_KILL          0x7
00071 
00072 
00073   int  vpc6_isPortBusy(MVME_INTERFACE *mvme, DWORD base, WORD port);
00074   void vpc6_PATypeWrite(MVME_INTERFACE *mvme, DWORD base, WORD data);
00075   int  vpc6_PortTypeRead(MVME_INTERFACE *mvme, DWORD base, WORD port);
00076   int  vpc6_PATypeRead(MVME_INTERFACE *mvme, DWORD base);
00077   int  vpc6_CfgLoad(MVME_INTERFACE *mvme, DWORD base, WORD port);
00078   int  vpc6_CfgRetrieve(MVME_INTERFACE *mvme, DWORD base, WORD port);
00079   int  vpc6_PortRegRBRead(MVME_INTERFACE *mvme, DWORD base, WORD port);
00080   int  vpc6_PortRegRead(MVME_INTERFACE *mvme, DWORD base, WORD port);
00081   void vpc6_PortDisplay(WORD type, WORD port, DWORD * reg);
00082   void vpc6_EntryPrint(WORD type, WORD chip, const vpc6_Reg * v);
00083   void vpc6_ASDRegSet(MVME_INTERFACE *mvme, DWORD base, WORD port, WORD reg, vpc6_Reg * Reg);
00084   void vpc6_ASDDefaultLoad(MVME_INTERFACE *mvme, DWORD base, WORD port);
00085   int  vpc6_ASDModeSet(MVME_INTERFACE *mvme, DWORD base, WORD port, int channel, int mode);
00086   int  vpc6_ASDThresholdSet(MVME_INTERFACE *mvme, DWORD base, WORD port, int threshold);
00087   int  vpc6_ASDHysteresisSet(MVME_INTERFACE *mvme, DWORD base, WORD port, float hysteresis);
00088   int  vpc6_BuckeyeModeSet(MVME_INTERFACE *mvme, DWORD base, WORD port, int channel,  int mode);
00089 
00090 #ifdef __cplusplus
00091 }
00092 #endif
00093 
00094 #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