WienerUSBVMEInterface

Name

WienerUSBVMEInterface -- "Dumb" support for the VM-USB

Synopsis


#include <WienerUSBVMEInterface.h>
#include <string>
            

static int ReadLongs(void* handle, unsigned long base, void* pBuffe, unsigned long count);

static int ReadWords(void* handle, unsigned long base, void* pBuffer, unsigned long count);

static int ReadBytes(void* handle, unsigned long base, void* pBuffer, unsigned long count);

static int WriteLongs(void* handle, unsigned long base, void* pBuffer, unsigned long count);

static int WriteWords(void* handle, unsigned long base, void* pBuffer, unsigned long count);

static int WriteBytes(void* handle, unsigned long base, void* pBuffer, unsigned long count);

static int usbImmediateStackTransaction(void* handle, void* stack, void* inputBuffer, unsigned long readSize);

static void setDebug(int level);

Description

This software provides a low level interface to the Jtec/Wiener VM-USB module. This module is an intelligent VME bus master with a USB interface. While the module supports autonomous data taking, this set of classes does not address this. Support for that will most likely emerge in the device support classes. Watch for it there.

In order to use this interface, the nscldaq software must have been configured with --with-vme-interface=wienerusb. The compiler will need to be able to locate the headers:


-I$DAQROOT/include
                
Furthermore the linker must be provided a set of library specifications:

-L$DAQROOT/lib -lVmeAPI -lusb
                

Public member functions

static int ReadLongs(void* handle, unsigned long base, void* pBuffer, unsigned long count);

Reads a block of longwords from the crate. base is the base address for the reads. pBuffer points to the buffer that will receive the data. count is the number of longwords to read.

The return value is the number of longwords actually read

static int ReadWords(void* handle, unsigned long base, void* pBuffer, unsigned long count);

static int ReadBytes(void* handle, unsigned long base, void* pBuffer, unsigned long count);

static int WriteLongs(void* handle, unsigned long base, void* pBuffer, unsigned long count);

static int WriteWords(void* handle, unsigned long base, void* pBuffer, unsigned long count);

static int WriteBytes(void* handle, unsigned long base, void* pBuffer, unsigned long count);

static int usbImmediateStackTransaction(void* handle, void* stack, void* inputBuffer, unsigned long readSize);

static void setDebug(int level);

Exceptions

All functions throw exceptions of type std::string on errors. The contents of the string are a descriptive error message that can be sent to e.g. std::cerr to report the error to the user.