moved include files from base/include
This commit is contained in:
@@ -4,6 +4,11 @@ include $(EPICS)/config/CONFIG_BASE
|
||||
|
||||
USR_INCLUDES = -I../../drv/ansi -I../../drv/old
|
||||
|
||||
INC += devApsEr.h
|
||||
INC += devCamac.h
|
||||
INC += devCommonGpib.h
|
||||
|
||||
|
||||
# SRCS.c += ../devAaiCamac.c
|
||||
# SRCS.c += ../devAiCamac.c
|
||||
SRCS.c += ../devAiDvx2502.c
|
||||
|
||||
@@ -78,7 +78,6 @@ DEVELOPMENT CENTER AT ARGONNE NATIONAL LABORATORY (708-252-2000).
|
||||
#include <devSup.h>
|
||||
#include <dbDefs.h>
|
||||
#include <link.h>
|
||||
#include <choiceEg.h>
|
||||
#include <ellLib.h>
|
||||
|
||||
#include <egRecord.h>
|
||||
@@ -270,7 +269,7 @@ STATIC long EgLoadRamList(EgLinkStruct *pParm, long Ram)
|
||||
RamSpeed = pParm->Ram2Speed;
|
||||
|
||||
/* When in ALT mode, all event records have to be downloaded */
|
||||
if (EgGetMode(pParm, 1) == EG_SEQ_MODE_ALTERNATE)
|
||||
if (EgGetMode(pParm, 1) == egMOD1_Alternate)
|
||||
{
|
||||
pNode = ellFirst(&pParm->EgEvent1);
|
||||
RamSpeed = pParm->Ram1Speed; /* RAM1 clock used when in ALT mode */
|
||||
@@ -431,12 +430,12 @@ STATIC void EgRamTask(void)
|
||||
/* Lock the EG link */
|
||||
semTake (EgLink[j].EgLock, WAIT_FOREVER); /******** LOCK ***************/
|
||||
|
||||
if (EgGetMode(&EgLink[j], 1) != EG_SEQ_MODE_ALTERNATE)
|
||||
if (EgGetMode(&EgLink[j], 1) != egMOD1_Alternate)
|
||||
{ /* Not in ALT mode, each ram is autonomous */
|
||||
if(EgLink[j].Ram1Dirty != 0)
|
||||
{
|
||||
/* Make sure it is disabled and not running */
|
||||
if ((EgGetMode(&EgLink[j], 1) == EG_SEQ_MODE_OFF) && (EgGetBusyStatus(&EgLink[j], 1) == 0))
|
||||
if ((EgGetMode(&EgLink[j], 1) == egMOD1_Off) && (EgGetBusyStatus(&EgLink[j], 1) == 0))
|
||||
{ /* download the RAM */
|
||||
EgClearSeq(&EgLink[j], 1);
|
||||
EgLoadRamList(&EgLink[j], 1);
|
||||
@@ -448,7 +447,7 @@ STATIC void EgRamTask(void)
|
||||
if(EgLink[j].Ram2Dirty != 0)
|
||||
{
|
||||
/* Make sure it is disabled and not running */
|
||||
if ((EgGetMode(&EgLink[j], 2) == EG_SEQ_MODE_OFF) && (EgGetBusyStatus(&EgLink[j], 2) == 0))
|
||||
if ((EgGetMode(&EgLink[j], 2) == egMOD1_Off) && (EgGetBusyStatus(&EgLink[j], 2) == 0))
|
||||
{ /* download the RAM */
|
||||
EgClearSeq(&EgLink[j], 2);
|
||||
EgLoadRamList(&EgLink[j], 2);
|
||||
@@ -797,21 +796,21 @@ STATIC long EgProcEgRec(struct egRecord *pRec)
|
||||
{
|
||||
if (pRec->tpro > 10)
|
||||
printf(", Mode1=%d", pRec->mod1);
|
||||
if (pRec->mod1 == EG_SEQ_MODE_ALTERNATE)
|
||||
if (pRec->mod1 == egMOD1_Alternate)
|
||||
{
|
||||
pRec->mod1 = EG_SEQ_MODE_ALTERNATE;
|
||||
pRec->lmd1 = EG_SEQ_MODE_ALTERNATE;
|
||||
pRec->mod2 = EG_SEQ_MODE_ALTERNATE;
|
||||
pRec->lmd2 = EG_SEQ_MODE_ALTERNATE;
|
||||
pRec->mod1 = egMOD1_Alternate;
|
||||
pRec->lmd1 = egMOD1_Alternate;
|
||||
pRec->mod2 = egMOD1_Alternate;
|
||||
pRec->lmd2 = egMOD1_Alternate;
|
||||
|
||||
pLink->Ram1Dirty = 1;
|
||||
pLink->Ram2Dirty = 1;
|
||||
}
|
||||
else if (pRec->lmd1 == EG_SEQ_MODE_ALTERNATE)
|
||||
else if (pRec->lmd1 == egMOD1_Alternate)
|
||||
{
|
||||
pRec->mod2 = EG_SEQ_MODE_OFF;
|
||||
pRec->lmd2 = EG_SEQ_MODE_OFF;
|
||||
EgSetSeqMode(pLink, 2, EG_SEQ_MODE_OFF);
|
||||
pRec->mod2 = egMOD1_Off;
|
||||
pRec->lmd2 = egMOD1_Off;
|
||||
EgSetSeqMode(pLink, 2, egMOD1_Off);
|
||||
pLink->Ram1Dirty = 1;
|
||||
pLink->Ram2Dirty = 1;
|
||||
}
|
||||
@@ -822,21 +821,21 @@ STATIC long EgProcEgRec(struct egRecord *pRec)
|
||||
{
|
||||
if (pRec->tpro > 10)
|
||||
printf(", Mode2=%d", pRec->mod2);
|
||||
if (pRec->mod2 == EG_SEQ_MODE_ALTERNATE)
|
||||
if (pRec->mod2 == egMOD1_Alternate)
|
||||
{
|
||||
pRec->mod1 = EG_SEQ_MODE_ALTERNATE;
|
||||
pRec->lmd1 = EG_SEQ_MODE_ALTERNATE;
|
||||
pRec->mod2 = EG_SEQ_MODE_ALTERNATE;
|
||||
pRec->lmd2 = EG_SEQ_MODE_ALTERNATE;
|
||||
pRec->mod1 = egMOD1_Alternate;
|
||||
pRec->lmd1 = egMOD1_Alternate;
|
||||
pRec->mod2 = egMOD1_Alternate;
|
||||
pRec->lmd2 = egMOD1_Alternate;
|
||||
|
||||
pLink->Ram1Dirty = 1;
|
||||
pLink->Ram2Dirty = 1;
|
||||
}
|
||||
else if (pRec->lmd2 == EG_SEQ_MODE_ALTERNATE)
|
||||
else if (pRec->lmd2 == egMOD1_Alternate)
|
||||
{
|
||||
pRec->mod1 = EG_SEQ_MODE_OFF;
|
||||
pRec->lmd2 = EG_SEQ_MODE_OFF;
|
||||
EgSetSeqMode(pLink, 1, EG_SEQ_MODE_OFF);
|
||||
pRec->mod1 = egMOD1_Off;
|
||||
pRec->lmd2 = egMOD1_Off;
|
||||
EgSetSeqMode(pLink, 1, egMOD1_Off);
|
||||
pLink->Ram1Dirty = 1;
|
||||
pLink->Ram2Dirty = 1;
|
||||
}
|
||||
@@ -1055,7 +1054,7 @@ STATIC long EgInitEgEventRec(struct egeventRecord *pRec)
|
||||
|
||||
/* Put the event record in the proper list */
|
||||
semTake (EgLink[pRec->out.value.vmeio.card].EgLock, WAIT_FOREVER);
|
||||
if (pRec->ram == REC_EGEVENT_RAM_2)
|
||||
if (pRec->ram == egeventRAM_RAM_2)
|
||||
{
|
||||
ellAdd(&(EgLink[pRec->out.value.vmeio.card].EgEvent2), &(pRec->eln));
|
||||
EgLink[pRec->out.value.vmeio.card].Ram2Dirty = 1;
|
||||
@@ -1097,7 +1096,7 @@ STATIC long EgProcEgEventRec(struct egeventRecord *pRec)
|
||||
|
||||
semTake (EgLink[pRec->out.value.vmeio.card].EgLock, WAIT_FOREVER);
|
||||
/* Move to proper linked list */
|
||||
if (pRec->ram == REC_EGEVENT_RAM_2)
|
||||
if (pRec->ram == egeventRAM_RAM_2)
|
||||
{
|
||||
ellDelete(&(EgLink[pRec->out.value.vmeio.card].EgEvent1), &(pRec->eln));
|
||||
ellAdd(&(EgLink[pRec->out.value.vmeio.card].EgEvent2), &(pRec->eln));
|
||||
@@ -1111,14 +1110,14 @@ STATIC long EgProcEgEventRec(struct egeventRecord *pRec)
|
||||
pRec->lram = pRec->ram;
|
||||
}
|
||||
|
||||
if (pRec->ram == REC_EGEVENT_RAM_2)
|
||||
if (pRec->ram == egeventRAM_RAM_2)
|
||||
RamSpeed = EgLink[pRec->out.value.vmeio.card].Ram2Speed;
|
||||
else
|
||||
RamSpeed = EgLink[pRec->out.value.vmeio.card].Ram1Speed;
|
||||
|
||||
if (pRec->enm != pRec->levt)
|
||||
{
|
||||
if (pRec->ram == REC_EGEVENT_RAM_2)
|
||||
if (pRec->ram == egeventRAM_RAM_2)
|
||||
EgLink[pRec->out.value.vmeio.card].Ram2Dirty = 1;
|
||||
else
|
||||
EgLink[pRec->out.value.vmeio.card].Ram1Dirty = 1;
|
||||
@@ -1165,7 +1164,7 @@ STATIC long EgProcEgEventRec(struct egeventRecord *pRec)
|
||||
printf("EgProcEgEventRec(%s) dpos=%d\n", pRec->name, pRec->dpos);
|
||||
|
||||
pRec->ldly = pRec->dely;
|
||||
if (pRec->ram == REC_EGEVENT_RAM_2)
|
||||
if (pRec->ram == egeventRAM_RAM_2)
|
||||
EgLink[pRec->out.value.vmeio.card].Ram2Dirty = 1;
|
||||
else
|
||||
EgLink[pRec->out.value.vmeio.card].Ram1Dirty = 1;
|
||||
@@ -1517,7 +1516,7 @@ STATIC long EgSetSeqMode(EgLinkStruct *pParm, unsigned int Seq, int Mode)
|
||||
volatile ApsEgStruct *pEg = pParm->pEg;
|
||||
|
||||
/* Stop and disable the sequence RAMs */
|
||||
if (Mode == EG_SEQ_MODE_ALTERNATE)
|
||||
if (Mode == egMOD1_Alternate)
|
||||
{
|
||||
pEg->EventMask &= ~0x3006; /* Disable *BOTH* RAMs */
|
||||
pEg->Control = (pEg->Control&CTL_OR_MASK)&~0x0066;
|
||||
@@ -1545,17 +1544,17 @@ STATIC long EgSetSeqMode(EgLinkStruct *pParm, unsigned int Seq, int Mode)
|
||||
|
||||
switch (Mode)
|
||||
{
|
||||
case EG_SEQ_MODE_OFF:
|
||||
case egMOD1_Off:
|
||||
break;
|
||||
|
||||
case EG_SEQ_MODE_NORMAL:
|
||||
case egMOD1_Normal:
|
||||
if (Seq == 1)
|
||||
pEg->EventMask |= 0x0004; /* Enable Seq RAM 1 */
|
||||
else
|
||||
pEg->EventMask |= 0x0002; /* Enable Seq RAM 2 */
|
||||
break;
|
||||
|
||||
case EG_SEQ_MODE_NORMAL_RECYCLE:
|
||||
case egMOD1_Normal_Recycle:
|
||||
if (Seq == 1)
|
||||
{
|
||||
pEg->EventMask |= 0x0004; /* Enable Seq RAM 1 */
|
||||
@@ -1568,14 +1567,14 @@ STATIC long EgSetSeqMode(EgLinkStruct *pParm, unsigned int Seq, int Mode)
|
||||
}
|
||||
break;
|
||||
|
||||
case EG_SEQ_MODE_SINGLE:
|
||||
case egMOD1_Single:
|
||||
if (Seq == 1)
|
||||
pEg->EventMask |= 0x2004; /* Enable Seq RAM 1 in single mode */
|
||||
else
|
||||
pEg->EventMask |= 0x1002;
|
||||
break;
|
||||
|
||||
case EG_SEQ_MODE_ALTERNATE: /* The ram downloader does all the work */
|
||||
case egMOD1_Alternate: /* The ram downloader does all the work */
|
||||
pEg->EventMask |= 0x0800; /* turn on the ALT mode bit */
|
||||
break;
|
||||
|
||||
@@ -1646,7 +1645,7 @@ STATIC long EgGetMode(EgLinkStruct *pParm, int Ram)
|
||||
Control = pEg->Control & 0x0060;
|
||||
|
||||
if (Mask & 0x0800)
|
||||
return(EG_SEQ_MODE_ALTERNATE);
|
||||
return(egMOD1_Alternate);
|
||||
|
||||
if (Ram == 1)
|
||||
{
|
||||
@@ -1654,13 +1653,13 @@ STATIC long EgGetMode(EgLinkStruct *pParm, int Ram)
|
||||
Control &= 0x0040;
|
||||
|
||||
if ((Mask == 0) && (Control == 0))
|
||||
return(EG_SEQ_MODE_OFF);
|
||||
return(egMOD1_Off);
|
||||
if ((Mask == 0x0004) && (Control == 0))
|
||||
return(EG_SEQ_MODE_NORMAL);
|
||||
return(egMOD1_Normal);
|
||||
if ((Mask == 0x0004) && (Control == 0x0040))
|
||||
return(EG_SEQ_MODE_NORMAL_RECYCLE);
|
||||
return(egMOD1_Normal_Recycle);
|
||||
if (Mask & 0x2000)
|
||||
return(EG_SEQ_MODE_SINGLE);
|
||||
return(egMOD1_Single);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1668,13 +1667,13 @@ STATIC long EgGetMode(EgLinkStruct *pParm, int Ram)
|
||||
Control &= 0x0020;
|
||||
|
||||
if ((Mask == 0) && (Control == 0))
|
||||
return(EG_SEQ_MODE_OFF);
|
||||
return(egMOD1_Off);
|
||||
if ((Mask == 0x0002) && (Control == 0))
|
||||
return(EG_SEQ_MODE_NORMAL);
|
||||
return(egMOD1_Normal);
|
||||
if ((Mask == 0x0002) && (Control == 0x0020))
|
||||
return(EG_SEQ_MODE_NORMAL_RECYCLE);
|
||||
return(egMOD1_Normal_Recycle);
|
||||
if (Mask & 0x1000)
|
||||
return(EG_SEQ_MODE_SINGLE);
|
||||
return(egMOD1_Single);
|
||||
}
|
||||
printf("EgGetMode() seqence RAM in invalid state %04.4X %04.4X\n", pEg->Control, pEg->EventMask);
|
||||
return(-1);
|
||||
@@ -1963,7 +1962,7 @@ STATIC int ConfigSeq(EgLinkStruct *pParm, int channel)
|
||||
switch (buf[1])
|
||||
{
|
||||
case '0':
|
||||
EgSetSeqMode(pParm, channel, EG_SEQ_MODE_OFF);
|
||||
EgSetSeqMode(pParm, channel, egMOD1_Off);
|
||||
break;
|
||||
case '1':
|
||||
if (EgSeqEnableCheck(pParm, channel))
|
||||
|
||||
74
src/dev/devApsEr.h
Normal file
74
src/dev/devApsEr.h
Normal file
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* *****************************************************************
|
||||
* COPYRIGHT NOTIFICATION
|
||||
* *****************************************************************
|
||||
*
|
||||
* THE FOLLOWING IS A NOTICE OF COPYRIGHT, AVAILABILITY OF THE CODE,
|
||||
* AND DISCLAIMER WHICH MUST BE INCLUDED IN THE PROLOGUE OF THE CODE
|
||||
* AND IN ALL SOURCE LISTINGS OF THE CODE.
|
||||
*
|
||||
* (C) COPYRIGHT 1993 UNIVERSITY OF CHICAGO
|
||||
*
|
||||
* Argonne National Laboratory (ANL), with facilities in the States of
|
||||
* Illinois and Idaho, is owned by the United States Government, and
|
||||
* operated by the University of Chicago under provision of a contract
|
||||
* with the Department of Energy.
|
||||
*
|
||||
* Portions of this material resulted from work developed under a U.S.
|
||||
* Government contract and are subject to the following license: For
|
||||
* a period of five years from March 30, 1993, the Government is
|
||||
* granted for itself and others acting on its behalf a paid-up,
|
||||
* nonexclusive, irrevocable worldwide license in this computer
|
||||
* software to reproduce, prepare derivative works, and perform
|
||||
* publicly and display publicly. With the approval of DOE, this
|
||||
* period may be renewed for two additional five year periods.
|
||||
* Following the expiration of this period or periods, the Government
|
||||
* is granted for itself and others acting on its behalf, a paid-up,
|
||||
* nonexclusive, irrevocable worldwide license in this computer
|
||||
* software to reproduce, prepare derivative works, distribute copies
|
||||
* to the public, perform publicly and display publicly, and to permit
|
||||
* others to do so.
|
||||
*
|
||||
* *****************************************************************
|
||||
* DISCLAIMER
|
||||
* *****************************************************************
|
||||
*
|
||||
* NEITHER THE UNITED STATES GOVERNMENT NOR ANY AGENCY THEREOF, NOR
|
||||
* THE UNIVERSITY OF CHICAGO, NOR ANY OF THEIR EMPLOYEES OR OFFICERS,
|
||||
* MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY LEGAL
|
||||
* LIABILITY OR RESPONSIBILITY FOR THE ACCURACY, COMPLETENESS, OR
|
||||
* USEFULNESS OF ANY INFORMATION, APPARATUS, PRODUCT, OR PROCESS
|
||||
* DISCLOSED, OR REPRESENTS THAT ITS USE WOULD NOT INFRINGE PRIVATELY
|
||||
* OWNED RIGHTS.
|
||||
*
|
||||
* *****************************************************************
|
||||
* LICENSING INQUIRIES MAY BE DIRECTED TO THE INDUSTRIAL TECHNOLOGY
|
||||
* DEVELOPMENT CENTER AT ARGONNE NATIONAL LABORATORY (708-252-2000).
|
||||
*/
|
||||
|
||||
#ifndef EPICS_DEVAPSER_H
|
||||
#define EPICS_DEVAPSER_H
|
||||
|
||||
/* Error numbers passed to ERROR_FUNC routines */
|
||||
#define ERROR_TAXI 1 /* Taxi violation */
|
||||
#define ERROR_HEART 2 /* Lost the system heart beat */
|
||||
#define ERROR_LOST 3 /* Events were lost */
|
||||
|
||||
/* Globally reserved event numbers */
|
||||
#define ER_EVENT_NULL 0x00 /* NULL event */
|
||||
#define ER_EVENT_END 0x7f /* Event sequence end */
|
||||
#define ER_EVENT_FREEZE 0x7e /* Freeze the event sequence */
|
||||
#define ER_EVENT_RESET_TICK 0x7d /* Reset the tick counter */
|
||||
#define ER_EVENT_TICK 0x7c /* Add 1 to the tick counter */
|
||||
#define ER_EVENT_RESET_PRESCALERS 0x7b
|
||||
#define ER_EVENT_HEARTBEAT 0x7a
|
||||
|
||||
typedef void (*EVENT_FUNC)(int Card, int EventNum, unsigned long Ticks);
|
||||
typedef void (*ERROR_FUNC)(int Card, int ErrorNum);
|
||||
|
||||
long ErRegisterEventHandler(int Card, EVENT_FUNC func);
|
||||
long ErRegisterErrorHandler(int Card, ERROR_FUNC func);
|
||||
long ErGetTicks(int Card, unsigned long *Ticks);
|
||||
long ErHaveReceiver(int Card);
|
||||
|
||||
#endif
|
||||
48
src/dev/devCamac.h
Normal file
48
src/dev/devCamac.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/* devCamac.h Camac Device Support */
|
||||
/*
|
||||
* Author: Johnny Tang
|
||||
* Date: 4-14-94
|
||||
*
|
||||
* Experimental Physics and Industrial Control System (EPICS)
|
||||
*
|
||||
* Copyright 1991, the Regents of the University of California,
|
||||
* and the University of Chicago Board of Governors.
|
||||
*
|
||||
* This software was produced under U.S. Government contracts:
|
||||
* (W-7405-ENG-36) at the Los Alamos National Laboratory,
|
||||
* and (W-31-109-ENG-38) at Argonne National Laboratory.
|
||||
*
|
||||
* Initial development by:
|
||||
* The Controls and Automation Group (AT-8)
|
||||
* Ground Test Accelerator
|
||||
* Accelerator Technology Division
|
||||
* Los Alamos National Laboratory
|
||||
*
|
||||
* Co-developed with
|
||||
* The Controls and Computing Group
|
||||
* Accelerator Systems Division
|
||||
* Advanced Photon Source
|
||||
* Argonne National Laboratory
|
||||
*
|
||||
*/
|
||||
|
||||
#define ADDRESS_SCAN -1
|
||||
#define BLOCK_TRANSFER 1
|
||||
|
||||
#define CDEBUG CAMAC_DEBUG
|
||||
int CAMAC_DEBUG;
|
||||
#define CONVERT 0
|
||||
#define DO_NOT_CONVERT 2
|
||||
|
||||
/*sizes of field types*/
|
||||
static int sizeofTypes[] = {0,1,1,2,2,4,4,4,8,2};
|
||||
/* DBF_STRING DBF_CHAR DBF_UCHAR DBF_SHORT DBF_USHORT DBF_LONG
|
||||
DBF_ULONG DBF_FLOAT DBF_DOUBLE DBF_ENUM
|
||||
*/
|
||||
|
||||
|
||||
struct dinfo{
|
||||
short f;
|
||||
long ext;
|
||||
long mask;
|
||||
};
|
||||
348
src/dev/devCommonGpib.h
Normal file
348
src/dev/devCommonGpib.h
Normal file
@@ -0,0 +1,348 @@
|
||||
/* devCommonGpib.h */
|
||||
/* share/epicsH/devCommonGpib.h $Id$ */
|
||||
/*
|
||||
* Author: John Winans
|
||||
* Date: 11-19-91
|
||||
*
|
||||
* Experimental Physics and Industrial Control System (EPICS)
|
||||
*
|
||||
* Copyright 1988, 1989, the Regents of the University of California,
|
||||
* and the University of Chicago Board of Governors.
|
||||
*
|
||||
* This software was produced under U.S. Government contracts:
|
||||
* (W-7405-ENG-36) at the Los Alamos National Laboratory,
|
||||
* and (W-31-109-ENG-38) at Argonne National Laboratory.
|
||||
*
|
||||
* Initial development by:
|
||||
* The Controls and Automation Group (AT-8)
|
||||
* Ground Test Accelerator
|
||||
* Accelerator Technology Division
|
||||
* Los Alamos National Laboratory
|
||||
*
|
||||
* Co-developed with
|
||||
* The Controls and Computing Group
|
||||
* Accelerator Systems Division
|
||||
* Advanced Photon Source
|
||||
* Argonne National Laboratory
|
||||
*
|
||||
* All rights reserved. No part of this publication may be reproduced,
|
||||
* stored in a retrieval system, transmitted, in any form or by any
|
||||
* means, electronic, mechanical, photocopying, recording, or otherwise
|
||||
* without prior written permission of Los Alamos National Laboratory
|
||||
* and Argonne National Laboratory.
|
||||
*
|
||||
* Modification Log:
|
||||
* -----------------
|
||||
* .01 11-19-91 jrw Initial release
|
||||
* .02 02-26-92 jrw removed declaration of callbackRequest()
|
||||
* .03 05-11-92 jrw Added waveform record support
|
||||
*/
|
||||
|
||||
#ifndef DEVCOMMONGPIB_H
|
||||
#define DEVCOMMONGPIB_H
|
||||
|
||||
long devGpibLib_report();
|
||||
long devGpibLib_initDevSup();
|
||||
long devGpibLib_initAi();
|
||||
long devGpibLib_initAo();
|
||||
long devGpibLib_initLi();
|
||||
long devGpibLib_initLo();
|
||||
long devGpibLib_initBi();
|
||||
long devGpibLib_initBo();
|
||||
long devGpibLib_initMbbo();
|
||||
long devGpibLib_initMbbi();
|
||||
long devGpibLib_initSi();
|
||||
long devGpibLib_initSo();
|
||||
long devGpibLib_initXx();
|
||||
long devGpibLib_readAi();
|
||||
long devGpibLib_writeAo();
|
||||
long devGpibLib_readLi();
|
||||
long devGpibLib_writeLo();
|
||||
long devGpibLib_readBi();
|
||||
long devGpibLib_writeBo();
|
||||
long devGpibLib_readMbbi();
|
||||
long devGpibLib_writeMbbo();
|
||||
long devGpibLib_readSi();
|
||||
long devGpibLib_writeSo();
|
||||
|
||||
int devGpibLib_aiGpibWork();
|
||||
int devGpibLib_aiGpibSrq();
|
||||
int devGpibLib_aiGpibFinish();
|
||||
int devGpibLib_aoGpibWork();
|
||||
int devGpibLib_liGpibWork();
|
||||
int devGpibLib_liGpibSrq();
|
||||
int devGpibLib_liGpibFinish();
|
||||
int devGpibLib_loGpibWork();
|
||||
int devGpibLib_biGpibWork();
|
||||
int devGpibLib_biGpibSrq();
|
||||
int devGpibLib_biGpibFinish();
|
||||
int devGpibLib_boGpibWork();
|
||||
int devGpibLib_mbbiGpibWork();
|
||||
int devGpibLib_mbbiGpibSrq();
|
||||
int devGpibLib_mbbiGpibFinish();
|
||||
int devGpibLib_mbboGpibWork();
|
||||
int devGpibLib_stringinGpibWork();
|
||||
int devGpibLib_stringinGpibSrq();
|
||||
int devGpibLib_stringinGpibFinish();
|
||||
int devGpibLib_stringoutGpibWork();
|
||||
int devGpibLib_xxGpibWork();
|
||||
|
||||
int devGpibLib_wfGpibFinish();
|
||||
int devGpibLib_wfGpibSrq();
|
||||
int devGpibLib_wfGpibWork();
|
||||
long devGpibLib_readWf();
|
||||
long devGpibLib_initWf();
|
||||
|
||||
void devGpibLib_processCallback();
|
||||
long devGpibLib_setPvSevr();
|
||||
|
||||
typedef struct {
|
||||
long number;
|
||||
DEVSUPFUN funPtr[20];
|
||||
} gDset;
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* This structure holds device-related data on a per-device basis and is
|
||||
* referenced by the gpibDpvt structures. They are built using a linked
|
||||
* list entered from hwpvtHead. This linked list is only for this specific
|
||||
* device type (other gpib devices may have their own lists.)
|
||||
*
|
||||
* The srqCallback() and parm fields are used for GPIBREADW type calls. They
|
||||
* should place the address of the appropriate function (aiGpibSrq if an AI
|
||||
* record is being processed) into the srqCallback() field and the pdpvt
|
||||
* field for the device into the parm field. This allows the SrqHandler()
|
||||
* function to locate the proper function and work areas to complete the
|
||||
* GPIBREADW operation.
|
||||
*
|
||||
* The unsolicitedDpvt field is used if the user specifies a record with
|
||||
* the parm number associated with handleing unsolicited SRQ interrupts.
|
||||
* What is done, is that the record will be processed when an SRQ is
|
||||
* detected for reasons other than GPIBREADW-related reasons. There may
|
||||
* be at most, 1 single record in hte database that can specify the 'magic'
|
||||
* parm number. If you need more, forward link it to a fanout record.
|
||||
*
|
||||
******************************************************************************/
|
||||
struct hwpvt {
|
||||
struct hwpvt *next; /* to next structure for same type device */
|
||||
|
||||
int linkType; /* is a GPIB_IO, BBGPIB_IO... from link.h */
|
||||
int link; /* link number */
|
||||
int bug; /* used only on BBGPIB_IO links */
|
||||
int device; /* gpib device number */
|
||||
|
||||
unsigned long tmoVal; /* time last timeout occurred */
|
||||
unsigned long tmoCount; /* total number of timeouts since boot time */
|
||||
|
||||
/* No semaphore guards here because can inly be mod'd by the linkTask */
|
||||
int (*srqCallback)(); /* filled by cmds expecting SRQ callbacks */
|
||||
caddr_t parm; /* filled in by cmds expecting SRQ callbacks */
|
||||
|
||||
struct gpibDpvt *unsolicitedDpvt; /* filled in if database calls for it */
|
||||
caddr_t pupvt; /* user defined pointer */
|
||||
};
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* This structure will be attached to each pv (via psub->dpvt) to store the
|
||||
* appropriate head.workStart pointer, callback address to record support,
|
||||
* gpib link #, device address, and command information.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
struct gpibDpvt {
|
||||
struct dpvtGpibHead head; /* fields used by the GPIB driver */
|
||||
|
||||
short parm; /* parameter index into gpib commands */
|
||||
char *rsp; /* for read/write message error Responses*/
|
||||
char *msg; /* for read/write messages */
|
||||
struct dbCommon *precord; /* record this dpvt is part of */
|
||||
void (*process)(); /* callback to perform forward db processing */
|
||||
int processPri; /* process callback's priority */
|
||||
long linkType; /* GPIB_IO, BBGPIB_IO... */
|
||||
struct hwpvt *phwpvt; /* pointer to per-device private area */
|
||||
caddr_t pupvt; /* user defined pointer */
|
||||
};
|
||||
|
||||
#define GET_GPIB_HW_PVT(pGpibDpvt) (((struct gpibDpvt*)(pGpibDpvt))->phwpvt->pupvt)
|
||||
#define SET_GPIB_HW_PVT(pGpibDpvt, value) (((struct gpibDpvt*)(pGpibDpvt))->phwpvt->pupvt = value)
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* This is used to define the strings that are used for button labels.
|
||||
* These strings are put into the record's znam & onam foelds if the
|
||||
* record is a BI or BO type and into the zrst, onst... fields of an
|
||||
* MBBI or MBBO record.
|
||||
*
|
||||
* Before these strings are placed into the record, the record is
|
||||
* check to see if there is already a string defined (could be user-entered
|
||||
* with DCT.) If there is already a string present, it will be preserved.
|
||||
*
|
||||
* There MUST ALWAYS be 2 and only 2 entries in the names.item list
|
||||
* for BI and BO records if a name list is being specified for them here.
|
||||
* The names.count field is ignored for BI and BO record types, but
|
||||
* should be properly specified as 2 for future compatibility.
|
||||
*
|
||||
* NOTE:
|
||||
* If a name string is filled in an an MBBI/MBBO record, it's corresponding
|
||||
* value will be filled in as well. For this reason, there MUST be
|
||||
* a value array and a valid nobt value for every MBBI/MBBO record that
|
||||
* contains an item array!
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
struct devGpibNames {
|
||||
int count; /* CURRENTLY only used for MBBI and MBBO */
|
||||
char **item;
|
||||
unsigned long *value; /* CURRENTLY only used for MBBI and MBBO */
|
||||
short nobt; /* CURRENTLY only used for MBBI and MBBO */
|
||||
};
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Enumeration of gpib command types supported.
|
||||
*
|
||||
* Each transaction type is described below :
|
||||
*
|
||||
* GPIBREAD : (1) The cmd string is sent to the instrument
|
||||
* (2) Data is read from the inst into a buffer (gpibDpvt.msg)
|
||||
* (3) The important data is extracted from the buffer using the
|
||||
* format string.
|
||||
*
|
||||
* GPIBWRITE: (1) An ascii string is generated using the format string and
|
||||
* contents of the gpibDpvt->dbAddr->precord->val
|
||||
* (2) The ascii string is sent to the instrument
|
||||
*
|
||||
* GPIBCMD : (1) The cmd string is sent to the instrument
|
||||
*
|
||||
* GPIBCNTL : (1) The control string is sent to the instrument (ATN active)
|
||||
*
|
||||
* GPIBSOFT : (1) No GPIB activity involved - normally retrieves internal data
|
||||
*
|
||||
* GPIBREADW : (1) The cmd string is sent to the instrument
|
||||
* (2) Wait for SRQ
|
||||
* (3) Data is read from the inst into a buffer (gpibDpvt.msg)
|
||||
* (4) The important data is extracted from the buffer using the
|
||||
* format string.
|
||||
*
|
||||
* GPIBRAWREAD: Used internally with GPIBREADW. Not useful from cmd table.
|
||||
*
|
||||
*
|
||||
* The following is only supported on mbbo and bo record types.
|
||||
*
|
||||
* GPIBEFASTO: (1) Sends out the string pointed to by p3[VAL] w/o formating
|
||||
*
|
||||
* The following are only supported on mbbi and bi record types.
|
||||
*
|
||||
* GPIBEFASTI: (1) Send out the cmd string
|
||||
* (2) Data is read from the inst into a buffer (gpibDpvt.msg)
|
||||
* (3) Check the response against P3[0..?]
|
||||
* (4) Set the value field to index when response = P3[index]
|
||||
*
|
||||
* GPIBEFASTIW: (1) Send out the cmd string
|
||||
* (2) Wait for SRQ
|
||||
* (3) Data is read from the inst into a buffer (gpibDpvt.msg)
|
||||
* (4) Check the response against P3[0..?]
|
||||
* (5) Set the value field to index when response = P3[index]
|
||||
*
|
||||
* If a particular GPIB message does not fit one of these formats, a custom
|
||||
* routine may be provided. Store a pointer to this routine in the
|
||||
* gpibCmd.convert field to use it rather than the above approaches.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#define GPIBREAD 1
|
||||
#define GPIBWRITE 2
|
||||
#define GPIBCMD 3
|
||||
#define GPIBCNTL 4
|
||||
#define GPIBSOFT 5
|
||||
#define GPIBREADW 6
|
||||
#define GPIBRAWREAD 7
|
||||
#define GPIBEFASTO 8
|
||||
#define GPIBEFASTI 9
|
||||
#define GPIBEFASTIW 10
|
||||
|
||||
|
||||
struct gpibCmd {
|
||||
gDset *rec_typ; /* used to indicate record type supported */
|
||||
int type; /* enum - GPIBREAD, GPIBWRITE, GPIBCMND */
|
||||
short pri; /* request priority--IB_Q_HIGH or IB_Q_LOW*/
|
||||
char *cmd; /* CONSTANT STRING to send to instrument */
|
||||
char *format; /* string used to generate or interpret msg*/
|
||||
long rspLen; /* room for response error message*/
|
||||
long msgLen; /* room for return data message length*/
|
||||
|
||||
int (*convert)(); /* custom routine for conversions */
|
||||
int P1; /* user defined parameter used in convert() */
|
||||
int P2; /* user defined parameter used in convert() */
|
||||
char **P3; /* user defined parameter used in convert() */
|
||||
|
||||
struct devGpibNames *namelist; /* pointer to name strings */
|
||||
|
||||
int companion; /* companion command (used at init time) */
|
||||
};
|
||||
|
||||
#define FILL {0,0,0,NULL,NULL,0,0,NULL,0,0,NULL,NULL,-1}
|
||||
#define FILL10 FILL,FILL,FILL,FILL,FILL,FILL,FILL,FILL,FILL,FILL
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* debugFlag:
|
||||
* Must point to a flag used to request debugging traces for the device
|
||||
* while executing library code.
|
||||
*
|
||||
* respond2Writes:
|
||||
* Set to TRUE if the device responds to write operations. This causes
|
||||
* a read operation to follow each write operation. (See also wrConversion)
|
||||
*
|
||||
* timeWindow:
|
||||
* Set to the number of system ticks that should be skipped after a timeout
|
||||
* is detected on a device. All commands issued within this time window
|
||||
* will be aborted and returned as errors.
|
||||
*
|
||||
* hwpvtHead:
|
||||
* This is the root pointer for the per-hardware device private structure
|
||||
* list. It should ALWAYS be initialized to NULL.
|
||||
*
|
||||
* gpibCmds:
|
||||
* Pointer to the gpibCmds array.
|
||||
*
|
||||
* numparams:
|
||||
* The number of parameters described in the gpibCmds array.
|
||||
*
|
||||
* magicSrq:
|
||||
* Set to the parameter number that should be processed if an unsolicited
|
||||
* SRQ is detected.
|
||||
*
|
||||
* name:
|
||||
* Must point to a string containing the device name (used for
|
||||
* debug messages.)
|
||||
*
|
||||
* srqHandler:
|
||||
* Must point to the SRQ handler for the device support module if SRQs are
|
||||
* supported or NULL if not.
|
||||
*
|
||||
* wrConversion:
|
||||
* If not set to NULL and respond2Writes is true and a GPIBWRITE or GPIBCMD
|
||||
* operation has completed it's read portion, this secondary conversion
|
||||
* routine is called.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
typedef struct devGpibParmBlock {
|
||||
int *debugFlag; /* pointer to debug flag */
|
||||
int respond2Writes; /* set to true if a device responds to writes */
|
||||
int timeWindow; /* clock ticks to skip after a timeout */
|
||||
struct hwpvt *hwpvtHead; /* pointer to the hwpvt list for device type */
|
||||
struct gpibCmd *gpibCmds; /* pointer to gpib command list */
|
||||
int numparams; /* number of elements in the command list */
|
||||
int magicSrq; /* magic parm to handle unsolicited SRQs */
|
||||
char *name; /* pointer to a string containing device type */
|
||||
int dmaTimeout; /* clock ticks to wait for DMA to complete */
|
||||
|
||||
int (*srqHandler)(); /* user SRQ handler or NULL if not supported */
|
||||
|
||||
int (*wrConversion)(); /* secondary conversion routine */
|
||||
} devGpibParmBlockStruct;
|
||||
|
||||
#endif
|
||||
@@ -68,11 +68,8 @@
|
||||
#include <module_types.h>
|
||||
#include <eventRecord.h>
|
||||
#include <pulseCounterRecord.h>
|
||||
#include <choicePulseCounter.h>
|
||||
#include <pulseDelayRecord.h>
|
||||
#include <choicePulseDelay.h>
|
||||
#include <pulseTrainRecord.h>
|
||||
#include <choicePulseTrain.h>
|
||||
#include <epicsPrint.h>
|
||||
|
||||
/* Create the dsets for devMz8310 */
|
||||
@@ -131,14 +128,14 @@ static unsigned short *shortaddr;
|
||||
#define HTS_FIELD 0x0010
|
||||
|
||||
/* defs for counter commands */
|
||||
#define CTR_READ REC_PULSECOUNTER_CMD_READ
|
||||
#define CTR_CLEAR REC_PULSECOUNTER_CMD_CLEAR
|
||||
#define CTR_START REC_PULSECOUNTER_CMD_START
|
||||
#define CTR_STOP REC_PULSECOUNTER_CMD_STOP
|
||||
#define CTR_SETUP REC_PULSECOUNTER_CMD_SETUP
|
||||
#define CTR_READ pulseCounterCMD_Read
|
||||
#define CTR_CLEAR pulseCounterCMD_Clear
|
||||
#define CTR_START pulseCounterCMD_Start
|
||||
#define CTR_STOP pulseCounterCMD_Stop
|
||||
#define CTR_SETUP pulseCounterCMD_Setup
|
||||
|
||||
#define SIZE_16 REC_PULSECOUNTER_CSIZ_16
|
||||
#define SIZE_32 REC_PULSECOUNTER_CSIZ_32
|
||||
#define SIZE_16 pulseCounterCSIZ_16_bit
|
||||
#define SIZE_32 pulseCounterCSIZ_32_bit
|
||||
|
||||
/* defines specific to mz8310*/
|
||||
|
||||
|
||||
@@ -50,11 +50,8 @@
|
||||
#include <module_types.h>
|
||||
#include <eventRecord.h>
|
||||
#include <pulseCounterRecord.h>
|
||||
#include <choicePulseCounter.h>
|
||||
#include <pulseDelayRecord.h>
|
||||
#include <choicePulseDelay.h>
|
||||
#include <pulseTrainRecord.h>
|
||||
#include <choicePulseTrain.h>
|
||||
#include <timerRecord.h>
|
||||
|
||||
#include <drvMz8310.h>
|
||||
|
||||
Reference in New Issue
Block a user