unit Caen_i;

interface
uses CaenTypeU, Sysutils;

function VME_SWRelease(var SwRel :PAnsichar) : integer; stdcall;
function VME_Init(Bdtype : integer; link :shortint; bdNum: shortint; var Handle : longint): integer; stdcall;
function VME_BoardFWRelease(Handle : longint; var FWRel : PAnsiChar): integer; stdcall;
function VME_End(Handle : longint) : integer; stdcall;
function VME_ReadCycle(Hadle : longint; Address: longword; var Data : longword; AM : integer; DW : integer) : integer; stdcall;
function VME_RMWCycle(Handle : longint; Address : longword; var Data : longword; AM : integer; DW : integer) :  integer; stdcall;
function VME_WriteCycle(Handle : longint; Address : longword; var Data : longword; AM : integer; DW: integer) : integer; stdcall;
function VME_BLTReadCycle(Handle: longint; Address : longword; p: pointer; Size: integer; AM: integer; DW : integer; var count : integer): integer; stdcall;
function VME_MBLTReadCycle(Handle : longint; Address : longword; p: pointer; size : integer; AM : integer; var count : integer): integer; stdcall;
function VME_BLTWriteCycle(Handle : longint; Address : longword; p: pointer; Size : integer; AM : integer; DW: integer; var count : integer) : integer; stdcall;
function VME_MBLTWriteCycle(Handle: longint; Address : longword; p: pointer; Size : integer; AM : integer; var count : integer):integer; stdcall;
function VME_ADOCycle(Handle: longint; Address : longword; AM : integer): integer; stdcall;
function VME_ADOHCycle(Handle : longint; Address :longword; AM : integer):integer; stdcall;
function VME_IACKCycle(Handle : longint; Level : integer; var vector : byte; DW: integer):integer;stdcall;
function VME_IRQCheck(Handle:longint; var Mask : byte):integer;stdcall;
function VME_SystemReset(Handle: longint):integer;stdcall;
function VME_IRQEnable(Handle:longint; mask:longword):integer;stdcall;
function VME_IRQDisable(Handle:longint;mask : longword):integer; stdcall;
function VME_IRQWait(Handle:longint;Mask:longword;Timecout : longword):integer;stdcall;

const
  CAENDLL = 'CAENVMElib.dll';


implementation
function VME_SWRelease(var SwRel :PAnsichar) : integer; stdcall;external CAENDLL name 'CAENVME_SWRelease';
function VME_Init(Bdtype : integer; link :shortint; bdNum: shortint; var Handle : longint): integer; stdcall;external CAENDLL name 'CAENVME_Init';
function VME_BoardFWRelease(Handle : longint; var FWRel : PAnsiChar): integer; stdcall; external CAENDLL name 'CAENVME_BoardFWRelease';
function VME_End(Handle : longint) : integer; stdcall;  external CAENDLL name 'CAENVME_End';
function VME_ReadCycle(Hadle : longint; Address: longword; var Data : longword; AM : integer; DW : integer) : integer; stdcall;  external CAENDLL name 'CAENVME_ReadCycle';
function VME_RMWCycle(Handle : longint; Address : longword; var Data : longword; AM : integer; DW : integer) :  integer; stdcall; external CAENDLL name 'CAENVME_RMWCycle';
function VME_WriteCycle(Handle : longint; Address : longword; var Data : longword; AM : integer; DW: integer) : integer; stdcall; external CAENDLL name 'CAENVME_WriteCycle';
function VME_BLTReadCycle(Handle: longint; Address : longword; p: pointer; Size: integer; AM: integer; DW : integer; var count : integer): integer; stdcall; external CAENDLL name 'CAENVME_BLTReadCycle';
function VME_MBLTReadCycle(Handle : longint; Address : longword; p : pointer; Size : integer; AM : integer; var count : integer): integer; stdcall; external CAENDLL name 'CAENVME_MBLTReadCycle';
function VME_BLTWriteCycle(Handle : longint; Address : longword; p: pointer ; Size : integer; AM : integer; DW: integer; var count : integer) : integer; stdcall; external CAENDLL name 'CAENVME_BLTWriteCycle';
function VME_MBLTWriteCycle(Handle: longint; Address : longword; p: pointer ; Size : integer; AM : integer; var count : integer):integer; stdcall; external CAENDLL name 'CAENVME_MBLTWriteCycle';
function VME_ADOCycle(Handle: longint; Address : longword; AM : integer): integer; stdcall; external CAENDLL name 'CAENVME_ADOCycle';
function VME_ADOHCycle(Handle : longint; Address :longword; AM : integer):integer; stdcall; external CAENDLL name 'CAENVME_ADOHCycle';
function VME_IACKCycle(Handle : longint; Level : integer; var vector : byte; DW: integer):integer;stdcall; external CAENDLL name 'CAENVME_IACKCycle';
function VME_IRQCheck(Handle:longint; var Mask : byte):integer;stdcall;  external CAENDLL name 'CAENVME_IRQCheck';
function VME_SystemReset(Handle: longint):integer;stdcall;  external CAENDLL name 'CAENVME_SystemReset';
function VME_IRQEnable(Handle:longint; mask:longword):integer;stdcall;  external CAENDLL name 'CAENVME_IRQEnable';
function VME_IRQDisable(Handle:longint;mask : longword):integer; stdcall;  external CAENDLL name 'CAENVME_IRQDisable';
function VME_IRQWait(Handle:longint;Mask:longword;Timecout : longword):integer;stdcall;  external CAENDLL name 'CAENVME_IRQWait';




end.