#include #include #include #include #include static long initRecord(struct boRecord *prec){ char *pbyte, dummy; /* printf("%d\n",prec->out.value.vmeio.signal); */ if ((prec->out.type != VME_IO) || (prec->out.value.vmeio.signal < 0) || (prec->out.value.vmeio.signal > 7)) { recGblRecordError(S_dev_badOutType, (void *)prec, "devBoLed: Bad OUT"); return -1; } if (devReadProbe(1, pbyte, &dummy) < 0) { recGblRecordError(S_dev_badCard, (void *)prec, "devBoLed: Nothing there!"); return -1; } prec->dpvt = (void *) 0x9FFF0003; prec->mask = 1 << prec->out.value.vmeio.signal; /* printf("%x %p\n",prec->out.value.vmeio.card, prec->dpvt); */ return 0; } static long writebo(struct boRecord *prec) { volatile char *pbyte = (volatile char *)prec->dpvt; if (prec->rval) { *pbyte |= prec->mask; } else { *pbyte &= ~(prec->mask); } return 0; } static struct { long number; DEVSUPFUN dev_report; DEVSUPFUN init; DEVSUPFUN init_record; /*returns:(0,2)=>(success,success no convert*/ DEVSUPFUN get_ioint_info; DEVSUPFUN write_bo;/*returns: (-1,0)=>(failure,success)*/ } devBoLed = { 5, NULL, NULL, initRecord, NULL, writebo }; epicsExportAddress(dset,devBoLed);