//----------------------------------------------------------------------------- // Basic USB communication class (Managed Code) -- // (C) Piero Giubilato 2007, Berkeley Lab -- //----------------------------------------------------------------------------- //_____________________________________________________________________________ // {Trace} // [File name] "cypr_USB.h" // [Author] "Piero Giubilato" // [Modified by] "Piero Giubilato" // [Version] "1.0" // [Last revision] "15 Dec 2008" // [Language] "C++ Managed" // [Compiler] "Visual C++ 9" // [Member of] "Cool SEAL" // [Project] "SEAL" // [Description] "This class is a managed C++ construct used to wrap" // "the original Cypress CyUSB.dll (which is managed C++). It provides" // "all the basic communication functionalities, but NOT multi-threading." // "For multi threading an external, non managed layer to ensure C++" // "compatibility has been provided." // [Key documentation] // "Visual C++ Reference Help" // "Cypress CyUSB.NET DLL Programmer's Reference (CyUsb.NET.chm)" // {Trace} //_____________________________________________________________________________ // To make this class working, remember to add to the project references the // CyUSB.DLL managed library and then use the /clr option when compiling. // Overloading check #ifndef cypr_USB_H #define cypr_USB_H //______________________________________________________________________________ ref class cypr_USB { private: // USB devices static CyUSB::USBDeviceList^ USBDevice; // Available device list static array^CMPDevice; // Compliant device(s) public: // Standard interface cypr_USB (); // General static int Open(int VendorID, int ProductID); // Open compliant devices static int Close(); // Close opened devices static int Reset(int devID); // Reset single device static int buffer_Len(int devID); // Get buffer Len static int buffer_Len(int devID, int* buffSize);// Set buffer lenght static int timeout_Len(int devID); // Get timeout len static int timeout_Len(int devID, int* timeout);// Set timeout len static int Count(); // Returns device count // Read/Write static int Write(int devID, unsigned short* buffer, int* len); // Write static int Read(int devID, unsigned short* buffer, int* len); // Read }; // End of overloading check #endif