/*============================================================================= Name: drvBunchLengthCF.h Abs: Function prototypes used by device support for Bunch Length CF driver. Auth: 16-nov-2005, Dayle Kotturi (dayle): Initial version for LLRF PAD -----------------------------------------------------------------------------*/ #include "copyright_SLAC.h" /* SLAC copyright comments */ /*----------------------------------------------------------------------------- Mod: (newest to oldest) 23-jan-2007, Dayle Kotturi: Adapted for BunchLengthCFApp 11-aus-2008, Dayle Kotturi: Adapt to use eth2 interface =============================================================================*/ #ifndef DRV_BLM_H #define DRV_BLM_H #include "BunchLengthCFMacros.h" #include /* Public Interface to PAD's LAN9118 chip driver */ #ifdef __cplusplus extern "C" { #endif /* Direct access to the LAN9118 FIFO -- an ugly hack * but it's much faster... */ #define LAN9118_FIFO_HACK ((volatile void*)0x31000800) /* read PAD FIFO into column or row-major array of 'n' * elements (n MUST be a multiple of 4 to account for the 4 channels * of a PAD). * * 'le' - if nonzero causes bytes to be swapped so that the data * are converted to little-endian byteorder. This feature * and the 'volatile' declaration of the destination address * are added so that we can directly write to the LAN9118 chip's * TX fifo. This violates nice encapsulation but gains ~30% / 80us * in speed. */ void drvPadReadFifosColMajor(volatile void *dst_p, int n, int le); void drvPadReadFifosRowMajor(volatile void *dst_p, int n, int le); /*4/16/8 was static. moved from drvPadBpm. 5/12/8 put static back */ /*void static padThread(void *arg); moved to .c to avoid warning */ int blmInitialise(void); int blmInitialiseIntr(void); int blmInitialiseScalarFromFile(int channel, char* filename); int blmReport(int interest); int blmGetIntrCount(void); int blmGetScanIOCount(void); int blmGetPadCommStatus(void); int blmGetNumShortsRead(int channel); int blmGetNumShortsToRead(int channel); long long blmGetSum(int channel); short blmGetX(int channel); short *blmGetSignal(int channel, int type); int blmGetSampleOffset(int channel); int blmSetSampleOffset(int channel, int offset); int blmGetSampleSize(int channel); int blmSetSampleSize(int channel, int size); int blmEnableIntr(void); int blmDisableIntr(void); int blmSoftTrigger(void); int blmCalibration(void); int blmDumpCalDataToFile(void); /* used by devWaveform */ int blmGetIntrCount(); int blmInitialiseScalar(); int blmGetOverflowCount(); #ifdef SCANIO int blmGetScanIOCount(); IOSCANPVT blmGetIoScanPvt(void); /* needed by dev*BunchLengthCF.c */ #endif /* debug routines used by debug device support. not used in ops */ int blmToggleIRQ5(void); #ifdef __cplusplus } #endif #endif