/cvi/instr/CAENV262/CAENV262.fp |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
## -1 +0,0 ## |
-application/octet-stream |
\ No newline at end of property |
Index: instr/CAENV262/CAENV262_DEF.h |
=================================================================== |
--- instr/CAENV262/CAENV262_DEF.h (revision 99) |
+++ instr/CAENV262/CAENV262_DEF.h (nonexistent) |
@@ -1,21 +0,0 @@ |
-#define CAENV262_NIMIN 0x0A |
-#define CAENV262_SHPOUT 0x08 |
-#define CAENV262_NIMOUT 0x06 |
-#define CAENV262_ECLOUT 0x04 |
- |
-#define CAENV262_FIX 0xFA |
-#define CAENV262_MMT 0xFC |
-#define CAENV262_VSR 0xFE |
- |
-#define CAEN_FIX_CODE 0xFAF5 |
-#define CAENV262_MMT_VALUE 0x092D |
- |
-#define VERSION(x) (((x)>>12) & 0xf) |
-#define SERIAL(x) ((x) & 0xfff) |
-#define MANUFACTURER(x) (((x)>>10) & 0x3f) |
-#define MODULE_TYPE(x) ((x) & 0x3ff) |
-/* |
-#define VME_D8(x) ( *((unsigned char *) (x))) |
-#define VME_D16(x) ( *((unsigned short *) (x))) |
-#define VME_D32(x) ( *((unsigned long *) (x))) |
-*/ |
Index: instr/CAENV262/CAENV262.h |
=================================================================== |
--- instr/CAENV262/CAENV262.h (revision 99) |
+++ instr/CAENV262/CAENV262.h (nonexistent) |
@@ -1,24 +0,0 @@ |
-#ifndef _CAENV262_H |
-#define _CAENV262_H |
-#include <ivi.h> |
- |
-int _VI_FUNC V262_Map (int moduleNumber, |
- unsigned long moduleOffset, int print); |
- |
-int _VI_FUNC V262_Init (int ModuleNumber); |
- |
-int _VI_FUNC V262_MaskOut(int ModuleNumber, unsigned long shft, unsigned short mask); |
- |
-unsigned short _VI_FUNC V262_MaskIn(int ModuleNumber); |
- |
-int _VI_FUNC V262_LevelInput (int ModuleNumber, int input); |
- |
-int _VI_FUNC V262_PulseOutput(int ModuleNumber, int output); |
- |
-int _VI_FUNC V262_LevelOutput(int ModuleNumber, int output, int level); |
- |
-int _VI_FUNC V262_EclOutput (int ModuleNumber, int output, int level); |
- |
-#define V262_status(x) (V262_MaskIn(x)&0xF) |
- |
-#endif |
Index: instr/CAENV262/CAENV262.c |
=================================================================== |
--- instr/CAENV262/CAENV262.c (revision 99) |
+++ instr/CAENV262/CAENV262.c (nonexistent) |
@@ -1,96 +0,0 @@ |
-#include <stdlib.h> |
-#include <stdio.h> |
-#include "CAENV262.h" |
-#include "CAENV262_DEF.h" |
-#include "vme.h" |
- |
- |
-static unsigned int ModuleAddress[10]; |
-static unsigned short m_OutputMaskEcl; |
-static unsigned short m_OutputMaskLevel; |
-static unsigned short m_InputMaskLevel; |
-int _VI_FUNC V262_Map (int ModuleNumber, |
- unsigned long ModuleOffset, int dprint) |
-{ |
- unsigned short vsr, mmt, fix; |
- printf("CAEN V262 offset = 0x%08x print=%d\n", ModuleOffset, dprint); |
- ModuleAddress[ModuleNumber] = ModuleOffset; |
- VME_A24D16_R(ModuleAddress[ModuleNumber] + CAENV262_FIX, &fix); |
- VME_A24D16_R(ModuleAddress[ModuleNumber] + CAENV262_MMT, &mmt); |
- VME_A24D16_R(ModuleAddress[ModuleNumber] + CAENV262_VSR, &vsr); |
- //if (dprint !=0) { |
- printf("CAEN V262 offset = 0x%08x\n", ModuleOffset); |
- printf("CAEN V262 fixed code = 0x%04x\n", fix); |
- printf("CAEN V262 manufacturer number = %i\n", MANUFACTURER(mmt)); |
- printf("CAEN V262 module type = %i\n", MODULE_TYPE(mmt)); |
- printf("CAEN V262 version = %i\n", VERSION(vsr)); |
- printf("CAEN V262 serial no. = %i\n", SERIAL(vsr)); |
- //} |
- if ((fix != CAEN_FIX_CODE) || (mmt != CAENV262_MMT_VALUE)) return -1; |
- return 0; |
-} |
- |
-int _VI_FUNC V262_Init (int ModuleNumber) |
-{ |
- m_OutputMaskEcl=0; |
- m_OutputMaskLevel=0; |
- |
- V262_MaskOut(ModuleNumber,CAENV262_NIMOUT,m_OutputMaskLevel); |
- V262_MaskOut(ModuleNumber,CAENV262_ECLOUT,m_OutputMaskEcl); |
- |
- |
- m_InputMaskLevel = V262_MaskIn(ModuleNumber); |
- |
- printf("V262_init : value of NIM inputs=%02x\n",m_InputMaskLevel); |
- |
- return 0; |
-} |
- |
- |
-int _VI_FUNC V262_MaskOut(int ModuleNumber, unsigned long shft, unsigned short mask) |
-{ |
-VME_A24D16_W(ModuleAddress[ModuleNumber] + shft,mask); |
-return 0; |
-} |
- |
- |
- |
-unsigned short _VI_FUNC V262_MaskIn(int ModuleNumber) |
-{ |
-unsigned long mask=0; |
-VME_A24D16_R(ModuleAddress[ModuleNumber] + CAENV262_NIMIN,&mask); |
-//printf("V262_MaskIn %04x\n", mask); |
-return mask; |
-} |
- |
- |
-int _VI_FUNC V262_LevelInput(int ModuleNumber, int input) |
-{ |
- if((input < 0) || (input > 3)) return 0; |
- return (V262_MaskIn(ModuleNumber) & (1<<input)); |
-} |
- |
-int _VI_FUNC V262_PulseOutput(int ModuleNumber, int output) |
-{ |
- if((output < 0) || (output > 3)) return -1; |
- return V262_MaskOut(ModuleNumber,CAENV262_SHPOUT, 1 << output); |
-} |
- |
- |
-int _VI_FUNC V262_LevelOutput(int ModuleNumber, int output, int level) |
-{ |
- if((output < 0) || (output > 3)) return -1; |
- if (level) m_OutputMaskLevel |= (1 << output); |
- else m_OutputMaskLevel &= ~(1 << output); |
- return V262_MaskOut(ModuleNumber,CAENV262_NIMOUT, m_OutputMaskLevel ); |
-} |
- |
-int _VI_FUNC V262_EclOutput(int ModuleNumber, int output, int level) |
-{ |
- if((output < 0) || (output > 16)) return -1; |
- if (level) m_OutputMaskEcl |= (1 << output); |
- else m_OutputMaskEcl &= ~(1 << output); |
- return V262_MaskOut(ModuleNumber,CAENV262_ECLOUT, m_OutputMaskEcl ); |
-} |
- |
- |