Support new I/O event scanning

This commit is contained in:
Marty Kraimer
1992-08-26 12:39:44 +00:00
parent bd284f6d1c
commit bb1a6c3878
6 changed files with 149 additions and 6 deletions
+4 -2
View File
@@ -465,6 +465,9 @@ unsigned short ab_btq_cnt[AB_MAX_LINKS][AB_MAX_ADAPTERS][AB_MAX_CARDS];
#ifndef EPICS_V2
#include <dbScan.h>
static IOSCANPVT ioscanpvt[AB_MAX_LINKS][AB_MAX_ADAPTERS][AB_MAX_CARDS];
#else
extern short wakeup_init; /* flags that the database scan initialization is complete */
#define interruptAccept wakeup_init
#endif
/*
@@ -1122,7 +1125,6 @@ abDoneTask(){
*
* simulate a change of state interrupt from the Allen-Bradley
*/
extern short wakeup_init; /* flags that the database scan initialization is complete */
unsigned char ab_old_binary_ins[AB_MAX_LINKS*AB_MAX_ADAPTERS*AB_MAX_CARDS];
ab_bi_cos_simulator()
{
@@ -1136,7 +1138,7 @@ ab_bi_cos_simulator()
first_scan_complete = first_scan = 0;
for(;;){
/* flag first scan */
if (wakeup_init && !first_scan_complete) first_scan = 1;
if (interruptAccept && !first_scan_complete) first_scan = 1;
/* check each link */
link = 0;
+27 -1
View File
@@ -1,4 +1,4 @@
/* at5vxi_driver.c */
/* drvVxiAt5.c */
/* share/src/drv @(#) $Id$ */
/*
@@ -54,6 +54,7 @@
* .15 joh 072992 print more raw values in io report
* .16 joh 081092 merged at5vxi_models.h into this source
* .17 joh 081992 function name change
* .17 mrk 082692 Added support for new I/O event scanning
*
* Notes:
* ------
@@ -111,6 +112,9 @@
#include <task_params.h>
#include <fast_lock.h>
#include <epvxiLib.h>
#ifndef EPICS_V2
#include <dbScan.h>
#endif
static char SccsId[] = "$Id$\t$Date$";
@@ -341,6 +345,9 @@ struct at5vxi_config{
char mdt; /* modified data tag */
struct vxi_csr *pcsr; /* vxi device hdr ptr */
struct at5vxi_dd *pdd; /* at5 device dep ptr */
#ifndef EPICS_V2
IOSCANPVT ioscanpvt;
#endif
};
LOCAL unsigned long at5vxiDriverID;
@@ -515,6 +522,9 @@ unsigned addr;
pc->pdd = (struct at5vxi_dd *) &pc->pcsr->dir.r.dd;
FASTLOCKINIT(&pc->lock);
#ifndef EPICS_V2
scanIoInit(&pc->ioscanpvt);
#endif
/*
* revert to power up control
@@ -679,8 +689,12 @@ int addr;
* wake up the I/O event scanner
*/
{
#ifdef EPICS_V2
io_scanner_wakeup(IO_AI, VXI_AT5_AI, addr);
io_scanner_wakeup(IO_BI, VXI_AT5_BI, addr);
#else
scanIoRequest(pconfig->ioscanpvt);
#endif
}
/*
@@ -1282,7 +1296,19 @@ register unsigned long *prval;
return OK;
}
#ifndef EPICS_V2
at5vxi_getioscanpvt(card,scanpvt)
unsigned short card;
IOSCANPVT *scanpvt;
{
register struct at5vxi_config *pconfig;
pconfig = AT5VXI_PCONFIG(card);
if(pconfig) *scanpvt = pconfig->ioscanpvt;
return(0);
}
#endif
/*
*
+28 -1
View File
@@ -83,6 +83,7 @@
* JH 08/03/92 moved interrupt vector base to module_types.h
* JH 08/05/92 dvx driver init is called from drvDvx now
* JH 08/10/92 merged dvx private include file into this source
* MRK 08/26/92 Added support for new I/O event scanning
*/
static char *SccsId = "$Id$\t$Date$";
@@ -93,6 +94,9 @@ static char *SccsId = "$Id$\t$Date$";
#include <dbDefs.h>
#include <drvSup.h>
#include <module_types.h>
#ifndef EPICS_V2
#include <dbScan.h>
#endif
/* general constants */
#define DVX_ID 0xCFF5 /* analogic ID code */
@@ -167,6 +171,9 @@ struct dvx_rec
int int_vector; /* interrupt vector */
int intcnt; /* interrupt count # */
int cnum; /* card number */
#ifndef EPICS_V2
IOSCANPVT ioscanpvt;
#endif
};
/* dma chain table size */
@@ -294,7 +301,11 @@ dvx_int(dvxptr)
cptr->dma_point = DMA_CSR;
cptr->dma_data = CMR_SC | M_CIE | M_CH2; /* enable int channel #2 */
cptr->dma_data = CMR_START | M_CH2; /* start channel #2 */
#ifdef EPICS_V2
io_scanner_wakeup(IO_AI,DVX2502,dvxptr->cnum); /*update database records */
#else
scanIoRequest(dvxptr->ioscanpvt);
#endif
break;
}
cptr->csr = dvxptr->csr_shadow;
@@ -405,6 +416,9 @@ long dvx_driver_init()
dvx[i].csr_shadow |= CSR_M_ESTART; /* enable ext start (shadow csr) */
ptr->csr = dvx[i].csr_shadow; /* enable external start */
dvx[i].mode = RUN_MODE; /* ready to aquire data */
#ifndef EPICS_V2
scanIoInit(&dvx[i].ioscanpvt);
#endif
}
else
dvx[i].pdvx2502 = 0;
@@ -571,7 +585,20 @@ dvx_dump(card,firstchan,lastchan)
}
printf("end of list\n");
}
#ifndef EPICS_V2
dvx_getioscanpvt(card,scanpvt)
short card;
IOSCANPVT *scanpvt;
{
if ((card >= ai_num_cards[DVX2502]) || (card < 0)) /* make sure hardware exists */
return(0);
else if (dvx[card].pdvx2502 == 0)
return(0);
*scanpvt = dvx[card].ioscanpvt;
return(0);
}
#endif
/*
*
+29
View File
@@ -31,6 +31,7 @@
* -----------------
* .01 071792 joh Added model name registration
* .02 081992 joh vxiUniqueDriverID -> epvxiUniqueDriverID
* .03 082692 mrk Added support for new I/O event scanning
*
*/
@@ -46,6 +47,9 @@
#include <task_params.h>
#include <fast_lock.h>
#include <epvxiLib.h>
#ifndef EPICS_V2
#include <dbScan.h>
#endif
#define VXI_MODEL_HPE1368A (0xf28)
@@ -63,6 +67,9 @@ struct hpe1368a_config{
unsigned short pending; /* switch position pending int */
unsigned short shadow; /* shadow of actual switch pos */
int busy; /* relays active */
#ifndef EPICS_V2
IOSCANPVT ioscanpvt;
#endif
};
#define HPE1368A_INT_LEVEL 1
@@ -152,6 +159,9 @@ unsigned la;
ChannelEnable(pcsr) = ALL_SWITCHES_OPEN;
FASTLOCKINIT(&pc->lock);
#ifndef EPICS_V2
scanIoInit(&pc->ioscanpvt);
#endif
r0 = intConnect(
(unsigned char) INUM_TO_IVEC(la),
@@ -209,7 +219,11 @@ unsigned la;
/*
* tell them that the switches have settled
*/
#ifdef EPICS_V2
io_scanner_wakeup(IO_BI, HPE1368A_BI, la);
#else
scanIoRequest(pc->ioscanpvt);
#endif
}
@@ -243,6 +257,21 @@ int level;
}
#ifndef EPICS_V2
hpe1368a_getioscanpvt(la,scanpvt)
unsigned short la;
IOSCANPVT *scanpvt;
{
struct hpe1368a_config *pc;
pc = HPE1368A_PCONFIG(la);
if(pc != NULL) *scanpvt = pc->ioscanpvt;
return(0);
}
#endif
/*
*
+29
View File
@@ -1,3 +1,5 @@
/* drvKscV215.c*/
/* share/src/drv @(#) $Id$ */
/*
* KscV215_driver.c
*
@@ -31,6 +33,7 @@
* -----------------
* .01 071792 joh Added model name registration
* .02 081992 joh vxiUniqueDriverID -> epvxiUniqueDriverID
* .03 082692 mrk Added support for new I/O event scanning
*
*/
@@ -46,6 +49,9 @@
#include <task_params.h>
#include <fast_lock.h>
#include <epvxiLib.h>
#ifndef EPICS_V2
#include <dbScan.h>
#endif
#define VXI_MODEL_KSCV215 (0x215)
@@ -61,6 +67,9 @@ epvxiPConfig((LA), KscV215DriverId, struct KscV215_config *)
struct KscV215_config{
FAST_LOCK lock; /* mutual exclusion */
#ifndef EPICS_V2
IOSCANPVT ioscanpvt;
#endif
};
#define KSCV215_INT_LEVEL 1
@@ -216,6 +225,9 @@ unsigned la;
}
FASTLOCKINIT(&pc->lock);
#ifndef EPICS_V2
scanIoInit(&pc->ioscanpvt);
#endif
#ifdef INTERRUPTS
status = intConnect(
@@ -304,7 +316,11 @@ unsigned la;
/*
* tell them that the switches have settled
*/
#ifdef EPICS_V2
io_scanner_wakeup(IO_AI, KSCV215_BI, la);
#else
scanIoRequest(pc->ioscanpvt);
#endif
}
#endif
@@ -419,3 +435,16 @@ register unsigned short *prval;
return ERROR;
}
#ifndef EPICS_V2
KscV215_at5vxi_getioscanpvt(la,scanpvt)
unsigned short la;
IOSCANPVT *scanpvt;
{
struct KscV215_config *pc;
pc = KSCV215_PCONFIG(la);
if(pc != NULL) *scanpvt = pc->ioscanpvt;
return(0);
}
#endif
+32 -2
View File
@@ -37,6 +37,7 @@
* .04 08-11-92 joh now allows for runtime reconfiguration of
* the addr map
* .05 08-25-92 mrk added DSET; made masks a macro
* .06 08-26-92 mrk support epics I/O event scan
*/
#include "vxWorks.h"
@@ -44,6 +45,15 @@
#include "vme.h"
#include "module_types.h"
#include <drvSup.h>
#ifndef EPICS_V2
#include <dbDefs.h>
#include <dbScan.h>
#else
extern short wakeup_init; /* flags that the database scan initialization i
s complete */
#define interruptAccept wakeup_init
#endif
static long report();
static long init();
@@ -98,6 +108,9 @@ struct dio_rec
short mode; /*operating mode*/
unsigned short sport0_1; /*saved inputs*/
unsigned short sport2_3; /*saved inputs*/
#ifndef EPICS_V2
IOSCANPVT ioscanpvt;
#endif
/*short dio_vec;*/ /*interrupt vector*/
/*unsigned int intr_num;*/ /*interrupt count*/
};
@@ -129,7 +142,6 @@ dio_int(ptr)
*task to check for change of state
*
*/
extern int wakeup_init;
dio_scan()
{
@@ -139,7 +151,7 @@ dio_scan()
first_scan = first_scan_complete = 0;
for (;;)
{
if (wakeup_init & !first_scan_complete) first_scan = 1;
if (interruptAccept & !first_scan_complete) first_scan = 1;
for (i = 0; i < XY240_MAX_CARDS; i++)
{
@@ -149,7 +161,11 @@ dio_scan()
|| first_scan)
{
/* printf("io_scanner_wakeup for card no %d\n",i); */
#ifdef EPICS_V2
io_scanner_wakeup(IO_BI,XY240_BI,i);
#else
scanIoRequest(dio[i].ioscanpvt);
#endif
dio[i].sport0_1 = dio[i].dptr->port0_1;
dio[i].sport2_3 = dio[i].dptr->port2_3;
}
@@ -203,6 +219,9 @@ register initialization
pdio_xy240->flg_dir = 0xf0; /*ports 0-3,input;ports 4-7,output*/
dio[i].sport2_3 = pdio_xy240->port2_3; /*read and save high values*/
dio[i].dptr = pdio_xy240;
#ifndef EPICS_V2
scanIoInit(&dio[i].ioscanpvt);
#endif
}
else{
@@ -220,6 +239,17 @@ register initialization
return(0);
}
#ifndef EPICS_V2
xy240_bi_getioscanpvt(card,scanpvt)
unsigned short card;
IOSCANPVT *scanpvt;
{
if ((card >= XY240_MAX_CARDS) || (!dio[card].dptr)) return(0);
*scanpvt = dio[card].ioscanpvt;
return(0);
}
#endif
/*
* XY240_BI_DRIVER
*