// drvIris.h // // Asyn driver that inherits from the asynPortDriver class. This is an // adaptation of testAsynPortDriver.cpp written by Mark Rivers for an IOC // implementation to monitor and control model IBM65 Iris controller from OWIS. // Started on 6/29/2011, zms //----------------------------------------------------------------------------- #ifndef drvIris_h #define drvIris_h #ifndef SIZE #define SIZE(x) (sizeof(x)/sizeof(x[0])) #endif #ifndef MIN #define MIN(a,b) (((a)<(b))?(a):(b)) #endif #ifndef MAX #define MAX(a,b) (((a)>(b))?(a):(b)) #endif #define MAX_ADDR 1 #define boDefHomeStr "BO_DHOME" #define boGoHomeStr "BO_GHOME" #define boAbortStr "BO_ABORT" #define boResetStr "BO_RESET" #define biAliveStr "BI_ALIVE" #define biBlinkStr "BI_BLINK" #define boGPosStr "BO_GPOS" #define loMaxVStr "LO_MAXV" #define liMaxVStr "LI_MAXV" #define loMaxAStr "LO_MAXA" #define liMaxAStr "LI_MAXA" #define aiMonStr "AI_MON" #define aoOpenStr "AO_OPEN" #define aiOpenStr "AI_OPEN" #define aoOffstStr "AO_OFF" #define aoSlopeStr "AO_SLOPE" typedef unsigned char byte; typedef unsigned short word; typedef unsigned int uint; class drvIris : public asynPortDriver { public: drvIris(const char* port,const char* ioport); virtual asynStatus writeInt32( asynUser* paUser,epicsInt32 value); virtual asynStatus writeFloat64( asynUser* pau,epicsFloat64 v); void pollerThread(); void _afterInit( int flag); protected: int _boDHome, _boGHome, _boAbort, _boReset, _biAlive, _biBlink, _boGPos, _loMaxV, _liMaxV, _loMaxA, _liMaxA, _aiMon, _aoOpen, _aiOpen, _aoOff, _aoSlope; #define FRST_COMMAND _boDHome #define LAST_COMMAND _aoSlope enum{ ixBoDHome, ixBoGHome, ixBoAbort, ixBoReset, ixBiAlive, ixBiBlink, ixBoGPos, ixLoMaxV, ixLiMaxV, ixLoMaxA, ixLiMaxA, ixAiMon, ixAoOpen, ixAiOpen, ixAoOff, ixAoSlope}; private: asynStatus _writeRead( const char* pw,size_t nw,char* pr,size_t nr, size_t* nbo,size_t* nbi); asynStatus _write( const char* pb,size_t nb); asynStatus _move( double v); asynStatus _monitor(); asynStatus _position(); asynStatus _getInt( int ix,int* v); asynUser* _pvt; char* _port; int _first; double _rbv; double _offst; double _slope; }; #define N_PARAMS (&LAST_COMMAND - &FRST_COMMAND + 1) #endif // drvIris_h