#ifndef VME_DIGI_COMM_H #define VME_DIGI_COMM_H /*$Id$*/ #ifdef __cplusplus extern "C" { #endif #include #include #include #include #include /* Configure digitizer at CSR base address 'csrbase' and attach to 'vmeComm' channel 'channel'. * * 'channel': channel number used to identify this digitizer (raw data transmitted via udpComm * protocol are tagged with this channel number). * * 'csrbase': base address in CSR space of this digitizer. * 'a32base': address in A32 where this digitizer should be mapped. * 'irq_vec': interrupt vector to use (NOTE: due to firmware restriction of some versions * this must be identical with the VME slot number) * 'irq_lvl': VME interrupt level to be used for this digitizer. * 'attach' : Afe attach function. May be NULL if no AFE is present. * * RETURNS : zero on success, nonzero on error. */ int vmeCommDigiConfig(unsigned channel, VME64_Addr csrbase, VME64_Addr a32base, uint8_t irq_vec, uint8_t irq_lvl, AfeAttachFunc afe_attach); /* Obtain handle for the digitizer associated with 'channel'. * * RETURNS: handle or NULL if no digitizer is configured for * the given channel. */ VmeDigi vmeCommDigiGet(unsigned channel); /* Write sample data into digitizer memory for simulation * purposes. Multiple data sets may be written which * are returned by the digitizer consecutively after * multiple triggers. * The 'nbytes' argument must be a multiple of * 2 (sizeof samples) * 4 (channels) * (nsamples). * * To leave simulation mode, call with 'nbytes' == 0. * * NOTES: No endian conversion is done on the data. They * MUST be big-endian (matching the digitizer endian-ness). * * The two lsb cannot be written; this means that * an overflow/-range situation cannot be simulated! */ int vmeDigiCommSetSimMode(int channel, void *data, int nbytes); /* IO operations table (emulated udpComm operations) */ extern DrvPadUdpCommIO drvPadVmeCommIO; #ifdef __cplusplus } #endif #endif