/*============================================================================= Name: drvPad.h Abs: Function prototypes used by device support for PAD driver. Updated: Mod: 29-mar-2011, Shantha Condamoor (scondam): 1. Added prev_intrCount to aid in calculating the Trigger rate. 2. Added reset functions 02-mar-2010, Shantha Condamoor (scondam): Initial version for Klystron Test Station 01 Interlocking with PAD. Auth: 16-nov-2005, Dayle Kotturi (dayle): Initial version. -----------------------------------------------------------------------------*/ #include "copyright_SLAC.h" /* SLAC copyright comments */ /*----------------------------------------------------------------------------- Mod: (newest to oldest) xx-xxx-2007, Dayle Kotturi: xxxxxxxxxxxxxxxxxxxxxxxx =============================================================================*/ #ifndef DRV_PAD_H #define DRV_PAD_H #include "padMacros.h" #include LOCAL int padOperationMode = PAD_STARTING; LOCAL int padCalibrationControl = PAD_CAL_IDLE; /* NB: To be called from Cexp> prompt, it doesn't need to be here; To be called from dev*Pad.c, it does */ int padInitialise(void); int padInitialiseIntr(void); int padInitialiseScalarFromFile(int channel, int sample, char* filename); int padReport(int interest); int padGetIntrCount(void); int padResetIntrCount(); int padGetPreviousIntrCount(); int padGetScanIOCount(void); int padResetOverflowICount(); int padGetNumShortsRead(int channel, int sample); int padGetNumShortsToRead(int channel, int sample); long padGetAverageI(int channel, int sample); long padGetAverageQ(int channel, int sample); long padGetAverageS(int channel, int sample); long padGetSumS(int channel, int sample); long padGetNumS(int channel, int sample); unsigned long padGetVarianceI(int channel, int sample); unsigned long padGetVarianceQ(int channel, int sample); #ifdef NEVER long padGetInterceptI(int channel); long padGetInterceptQ(int channel); #endif short padGetX(int channel, int sample); void *padGetSignal(int channel, int sample, int type); int padGetSampleOffset(int channel, int sample); int padSetSampleOffset(int channel, int sample, int offset); int padGetSampleSize(int channel, int sample); int padSetSampleSize(int type, int channel, int sample, int size); #ifdef PAD_SIMPLE_PROCESSING int padSetThreshold(int channel, int val); int padGetThreshold(int channel); int padGetUpperThreshold(int channel); int padGetLowerThreshold(int channel); int padGetPulseAverage(int channel); int padSetPulseAverage(int channel, int plsavg); short padGetScalarS(int channel); int padSetScalarS(int channel, short scalar); int padGetAverageOut(int channel); int padGetFaultingPulses(int channel); int padGetState(); int padGetFaultChannel(); int padGetAverageOutPedestal(int channel); int padSetAverageOutPedestal(int channel, int avgOut_ped); #endif int padSetOperationMode(int mode); int padSetCalibrationControl(int calibrationControl); int padEnableIntr(void); int padDisableIntr(void); #ifdef USING_TIMER int padGetTime(void); void padUpdateWorstCase(void); #endif int padSoftTrigger(void); int padCalibration(void); int padDumpCalDataToFile(void); /* used by devWaveform */ int padGetIntrCount(); int padInitialiseScalar(); int padGetOverflowQCount(); int padGetOverflowICount(); #ifdef PAD_SIMPLE_PROCESSING /* Set up the General Purpose Timer Modules (GPTA) */ /* GPT Port Data Direction Register (GPTDDR) */ /* Setting Bits 0 to 3 at Byte address IPSBAR + 0x1A001E will cause the corresponding PTA0 to PTA3 to become outputs. */ /* Write 0x01 to IPSBAR + 0x1A001E to set PTA0 to an output pin. */ void setPTA0ToOutput(); /* *gptddr = 0x01; Chapter 20, Section 20.5.19 */ void setPTA0ToInput(); /* GPT Port Data Register (GPTPORT) */ /* Writing to bits 0 to 3 of byte address IPSBAR+0x1A001D will set corresponding output pins PTA0 to PTA3 to the value written. */ /* Set bit high write 0x01 to IPSBAR+0x1A001D */ /* Set bit low write 0x00 to IPSBAR+0x1A001D */ void setPTA0ToLow(); /* *gptport = 0x01; Chapter 20, Section 20.5.18 */ void setPTA0ToHigh(); int padGetState(); int padResetState(); int padGetFaultChannel(); int padGetThreshold(int channel); int padSetThreshold(int channel, int val); int padGetUpperThreshold(int channel); int padGetLowerThreshold(int channel); int padGetFaultingPulses(int channel); #endif #ifdef SCANIO int padGetScanIOCount(); IOSCANPVT padGetIoScanPvt(void); /* needed by dev*Pad.c */ int padResetScanIOCount(); #endif /* debug routines used by debug device support. not used in ops */ int padToggleIRQ5(void); void setDiagnosticBit(); void clearDiagnosticBit(); #define Bit(n) (1<<(n)) #endif