阅读:2271回复:4
EZUSB_68013_上位机问题
大家好,我在使用cypress的68013的开发板。上位机使用官网提供的基于C#的类库,正在学习相关的例子程序。可是一开始就碰到了棘手的问题,请看下面的代码
public partial class Form1 : Form { App_PnP_Callback evHandler; CyUSBDevice loopDevice = null; USBDeviceList usbDevices = null; CyBulkEndPoint inEndpoint = null; CyBulkEndPoint outEndpoint = null; Thread tXfers; bool bRunning = false; int value; long outCount, inCount; const int XFERSIZE = 256; byte[] outData = new byte[XFERSIZE]; byte[] inData = new byte[XFERSIZE]; // These 2 needed for TransfersThread to update the UI delegate void UpdateUICallback(); UpdateUICallback updateUI; public Form1() { InitializeComponent(); // Setup the callback routine for updating the UI updateUI = new UpdateUICallback(StatusUpdate); // Setup PnP event handling evHandler = new App_PnP_Callback(PnP_Event_Handler); // Create a list of CYUSB devices usbDevices = new USBDeviceList(CyConst.DEVICES_CYUSB, evHandler); setDevice(); } public void setDevice() { if (usbDevices.Count > 0) loopDevice = usbDevices[0x0547, 0x0080] as CyUSBDevice; StartBtn.Enabled = (loopDevice != null); if (loopDevice != null) Text = loopDevice.FriendlyName; else Text = "Bulkloop - no device"; // Set the in and out endpoints per the selected radio buttons. EptPair1Btn_Click(this, null); } ………… 执行 usbDevices = new USBDeviceList(CyConst.DEVICES_CYUSB, evHandler); 始终不成功,无法获得usb设备列表,usbDevices.Count一直为零,不知是什么原因?请大家帮忙,谢谢~~~ 附件有工程文件和cyusb.dll的说明文件 |
|
|
沙发#
发布于:2009-02-26 14:35
补充:
我换到我的台式机上去,基于.net的c#例子程序就能够认到开发板了。。我的笔记本和台式机都装的一样的framework2.0~~太奇怪了 |
|
板凳#
发布于:2009-05-11 23:07
本想帮下你,但我不懂.
|
|
地板#
发布于:2009-10-14 16:15
下载不了
|
|
地下室#
发布于:2009-10-14 16:16
附件: CyUsb.NET.rar (195 K)
附件: BulkLoop.rar (82 K) 下载不了,我需要啊 |
|