/* Copyright (c) 20011 Hovanes Egiyan Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef _DevBaseIU_HH_ #define _DevBaseIU_HH_ extern "C" { #include #include #include #include #include #include #include }; #include "dbDefs.h" #include "dbAccess.h" #include "recGbl.h" #include "recSup.h" #include "link.h" #include #include #include #include //#include //#include //#include "epicsExport.h" #include #include #include #include #include #include #include #include #include #include #include //}; #include "boost/function.hpp" #include "boost/bind.hpp" #include #include #include "epicsExport.h" #include "BaseIUInput.hh" #include "BaseIUMgr.hh" #include "BaseIUVirtBus.hh" //! Class to handle record related error conditions class RecordError { protected: struct dbCommon* recPtr; public: RecordError( struct dbCommon* recPtr, const long epicsError, const long epicsAlarm, const long epicsSevr, const string errString ); void Disable(); }; const int statOK = 0; const int statError = -1; //! Main device support functions extern "C" { static long basesAiInit( struct aiRecord *pai ); static long basesAiRead( struct aiRecord *pai ); static long basesBiInit( struct biRecord *pbi ); static long basesBiRead( struct biRecord *pbi ); static long basesMbbiDirectInit( struct mbbiDirectRecord *pmdi ); static long basesMbbiDirectRead( struct mbbiDirectRecord *pmdi ); static long basesLiInit(struct longinRecord *pli); static long basesLiRead(struct longinRecord *pli); static long basesSiInit(struct stringinRecord *psi); static long basesSiRead(struct stringinRecord *psi); static long basesAoInit( struct aoRecord *pao ); static long basesAoWrite( struct aoRecord *pao ); static long basesBoInit( struct boRecord *pbo ); static long basesBoWrite( struct boRecord *pbo ); // static long basesLoInit(struct longoutRecord *plo); // static long basesLoWrite(struct longoutRecord *plo); } //-------------------------------------------------------------------- // device support definition structures //-------------------------------------------------------------------- // ai static struct { long number; DEVSUPFUN report; DEVSUPFUN init; DEVSUPFUN init_record; DEVSUPFUN ioIntInfoGet; DEVSUPFUN read_ai; DEVSUPFUN special_linconv; } devAiBaseIU = { 6, NULL, NULL, (DEVSUPFUN) basesAiInit, NULL, (DEVSUPFUN) basesAiRead, NULL }; epicsExportAddress( dset,devAiBaseIU ); // bi static struct { long number; DEVSUPFUN report; DEVSUPFUN init; DEVSUPFUN init_record; DEVSUPFUN ioIntInfoGet; DEVSUPFUN read_bi; } devBiBaseIU = { 5, NULL, NULL, (DEVSUPFUN) basesBiInit, NULL, (DEVSUPFUN) basesBiRead }; epicsExportAddress( dset,devBiBaseIU ); // mbbiDirect static struct { long number; DEVSUPFUN dev_report; DEVSUPFUN init; DEVSUPFUN init_record; DEVSUPFUN get_ioint_info; DEVSUPFUN read_mbbi; } devMbbiDirectBaseIU = { 5, NULL, NULL, (DEVSUPFUN) basesMbbiDirectInit, NULL, (DEVSUPFUN) basesMbbiDirectRead }; epicsExportAddress( dset,devMbbiDirectBaseIU ); // longin static struct { long number; DEVSUPFUN report; DEVSUPFUN init; DEVSUPFUN init_record; DEVSUPFUN ioIntInfoGet; DEVSUPFUN read_li; DEVSUPFUN special_linconv; } devLiBaseIU = { 6, NULL, NULL, (DEVSUPFUN) basesLiInit, NULL, (DEVSUPFUN) basesLiRead, NULL }; epicsExportAddress(dset,devLiBaseIU); // stringin static struct { long number; DEVSUPFUN report; DEVSUPFUN init; DEVSUPFUN init_record; DEVSUPFUN ioIntInfoGet; DEVSUPFUN read_si; DEVSUPFUN special_linconv; } devSiBaseIU = { 6, NULL, NULL, (DEVSUPFUN) basesSiInit, NULL, (DEVSUPFUN) basesSiRead, NULL }; epicsExportAddress(dset,devSiBaseIU); // ao static struct { long number; DEVSUPFUN report; DEVSUPFUN init; DEVSUPFUN init_record; DEVSUPFUN ioIntInfoGet; DEVSUPFUN write_ao; DEVSUPFUN special_linconv; } devAoBaseIU = { 6, NULL, NULL, (DEVSUPFUN) basesAoInit, NULL, (DEVSUPFUN) basesAoWrite, NULL }; epicsExportAddress( dset,devAoBaseIU ); // bo static struct { long number; DEVSUPFUN report; DEVSUPFUN init; DEVSUPFUN init_record; DEVSUPFUN ioIntInfoGet; DEVSUPFUN write_bo; } devBoBaseIU = { 5, NULL, NULL, (DEVSUPFUN) basesBoInit, NULL, (DEVSUPFUN) basesBoWrite }; epicsExportAddress( dset,devBoBaseIU ); // // // longout // static struct { // long number; // DEVSUPFUN report; // DEVSUPFUN init; // DEVSUPFUN init_record; // DEVSUPFUN ioIntInfoGet; // DEVSUPFUN write_lo; // DEVSUPFUN special_linconv; // } devLoBaseIU = { // 6, // NULL, // NULL, // (DEVSUPFUN) basesLoInit, // NULL, // (DEVSUPFUN) basesLoWrite, // NULL // }; // epicsExportAddress(dset,devLoBaseIU); #endif // _DevBaseIU_HH_