/*----------------------------------------------------------------------------* * Copyright (c) 2005 Southeastern Universities Research Association, * * Thomas Jefferson National Accelerator Facility * * * * This software was developed under a United States Government license * * described in the NOTICE file included as part of this distribution. * * * * E.Wolin, 25-Feb-2005, Jefferson Lab * * * * Authors: Elliott Wolin * * wolin@jlab.org Jefferson Lab, MS-6B * * Phone: (757) 269-7365 12000 Jefferson Ave. * * Fax: (757) 269-5519 Newport News, VA 23606 * * *----------------------------------------------------------------------------*/ #ifndef _vxTIInterruptService_hxx #define _vxTIInterruptService_hxx #include #include #include #include #include #include #include namespace codaObject { // for board support packages extern "C" { extern int sysBusToLocalAdrs(int,char*,char**); extern int intDisconnect(int); extern int sysIntEnable(int); extern int sysIntDisable(int); // ??? is this needed } // default TI and VME addresses, etc. for A16/D16 access mode // settable by switches on TI module #define TI_BASE_ADDR 0x0ed0 #define INTERRUPT_LEVEL 5 // user selectable within constraints from cpu #define INTERRUPT_VECTOR 0xee #define DISPATCH_PRIORITY 100 // fixed by TI board itself #define VME_ACCESS_MODE 0x29 #define TI_RESET 0x80 #define TI_MODE 0x7 #define INTERRUPT_REENABLE 0x8000 //----------------------------------------------------------------------------- //----------------------------------------------------------------------------- /** * Implements InterruptService for stand-alone TI board in vxWorks. */ class vxTIInterruptService : public InterruptService { public: vxTIInterruptService(unsigned short *ti_addr = (unsigned short*)TI_BASE_ADDR, int dispatchPriority = DISPATCH_PRIORITY, int interruptLevel = INTERRUPT_LEVEL, short interruptVector = INTERRUPT_VECTOR); virtual ~vxTIInterruptService(void) throw(); virtual bool setupInterrupt(void); virtual bool enableInterrupt(void); virtual bool pauseInterrupt(void) {return(true);} virtual bool resumeInterrupt(void) {return(true);} virtual bool deleteInterrupt(void); virtual int dispatchInterrupt(void); private: static void ISR(int sem); protected: unsigned short *myBaseAddr; /**