Company X Accessories C1030-5510 Using devices, Void ceDeviceOpen, Void ceDeviceClose

Models: C1030-5510

1 71
Download 71 pages 45.45 Kb
Page 45
Image 45

Using devices

After getting a device pointer or handle, devices can be used. Before transferring data to or from devices, or catching interrupts (PCI), devices must be accessed, which is done by calling Open(). All calls in this section require an open device, which must be freed by calling Close() after usage.

Either way, after calling Open(), the device is ready for communication. As of the fact, that Cesys devices usually have an FPGA on the device side of the bus, the FPGA must be made ready for usage. If this isn't done by loading contents from the on-board flash (not all devices have one), a design must be loaded by calling one of the ProgramFPGA*() calls. These call internally reset the FPGA after design download. From now on, data can be transferred.

Important: All data transfer is based on a 32 bit bus system which must be implemented inside the FPGA design. PCI devices support this natively, while USB devices use a protocol which is implemented by Cesys and sits on top of a stable bulk transfer implementation.

Methods/Functions

Open

API

Code

C++

void ceDevice::Open()

CCE_RESULT Open(CE_DEVICE_HANDLE Handle)

.NET void ceDevice.Open()

Gain access to the specific device. Calling one of the other functions in this section require a successful call to Open().

Notice: If two or more applications try to open one device, PCI and USB devices behave a bit different. For USB devices, Open() causes an error if the device is already in use. PCI allows opening one device from multiple processes. As PCI drivers are not developed by Cesys, it's not possible to us to prevent this (as we see this as strange behavior). The best way to share communication of more than one application with devices would be a client / server approach.

Close

API

Code

C++

void ceDevice::Close()

CCE_RESULT Close(CE_DEVICE_HANDLE Handle)

.NET void ceDevice.Close()

USBS6 / C1030-5510

 

http://www.cesys.com/

User Doc V0.3

-45-

preliminary

Page 45
Image 45
Company X Accessories C1030-5510 manual Using devices, Void ceDeviceOpen, Void ceDeviceClose