MCA Data Server Reference |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
wxMCA PackageSupported Devices |
USB interface / device driverUSB interfaceThe USB interface implemented in the ARM M0+ MCU is a peripheral device and has the required control endpoint plus command IN and OUT endpoints (0x81, 0x1) plus data IN and OUT endpoints (0x82, 0x2). Here, IN and OUT are as seen by the host; hence, IN refers to the host reading data from the device. Device driverThe device driver uses libusb0.1 as the user space usb-driver. Note that only one application can claim a device. In the discussion below, MCA generically refers to Counters, MCA-1000, MCA-3000 and Neutron-3000 devices. More device may be added in the future. mca_device.py defines the 'mca' class. An object of that class holds all information necessary to operate an MCA. Note that with the exception of its usb_handle, all information is considered transient and the class object is stateless. For each attached MCA one mca object is created, and the bpi_usb.findall() function returns a dictionary of all attached MCA mca objects. The keys in this dictionary are the unique 32-character long serial numbers of the SAM L21 ARM M0+ processor. These serial numbers are built-in by the manufacturer and cannot be changed or erased. The device driver reads the ARM Version registers to retrieve the unique serial number of the device. The device driver supports any number of attached MCA units. For a device to be recognized as an MCA it must have a USB vendor id of 0x1FA4 and a recognized product ID. The table below shows currently supported devices. Unless they require a customized driver, all MCA of the same type have the same serial number (eg "armMorpho001", or "sipmMorpho001") as seen by the operating system as it enumerates the devices on the USB bus. This prevents Windows from having to install a new driver copy for every new MCA.
Data I/OThe MCA USB communication uses the concept of a data port. The host first writes instructions to the command endpoint and then issues a usb bulk read to retrieve the data. The software inside the ARM MCU will populate the data_in buffer with the requested data. If the host requires more than 256 byte, the bpi_usb.read_data function will use multiple bulk-reads to satisfy the request. The read and write functions are both completely agnostic of the data. Data are byte arrays and the two functions look do not look inside or try to interpret the data. Both take an mca object as their only argument.
|