微波EDA网,见证研发工程师的成长!
首页 > 研发问答 > 嵌入式设计讨论 > MCU和单片机设计讨论 > 有人用过笙泉的MA101桥接器吗?

有人用过笙泉的MA101桥接器吗?

时间:10-02 整理:3721RD 点击:

  1. HINSTANCE HWND_DLL;
  2. typedef struct  _MW_BridgeMini
  3. {
  4.     DWORD VID;           // Need to match user device's "Vendor ID".
  5.     DWORD PID;           // Need to match user device's "Product ID".
  6.     DWORD ReadTimeOut;          // Specifies the read data time-out interval, in milliseconds.
  7.     DWORD WriteTimeOut;          // Specifies the write data time-out interval, in milliseconds.   
  8.     HANDLE Handle;                      // Do not modify this value, reserved for DLL

  9. } MW_BridgeMini;
  10. MW_BridgeMini BridgeObj;

  11. CString m_strVid;
  12. CString m_strPid;

  13. DWORD dwResult = 0;

  14. DWORD index = 1;

  15. typedef DWORD (*MyFun)(MW_BridgeMini ,DWORD);
  16. MyFun MyFun_1;


  17. m_strVid = "0E6A";
  18. m_strPid = "0103";

  19. HWND_DLL = LoadLibrary("BridgeMini.dll");

  20. BridgeObj.VID = HexStrToDW(m_strVid); //字符串转换为整型
  21. BridgeObj.PID = HexStrToDW(m_strPid); //字符串转换为整型
  22. BridgeObj.ReadTimeOut = 0xfffffff; // for demo purpose 默认
  23. BridgeObj.WriteTimeOut = 0xfffffff;// for demo purpose 默认
  24. BridgeObj.Handle = HWND_DLL;

  25. MyFun_1 = (MyFun)GetProcAddress(HWND_DLL,"MA101_ConnectBridge");

  26. dwResult = MyFun_1(BridgeObj,index);

  27. TRACE("connect return : %d \n", dwResult);

  28. FreeLibrary(HWND_DLL);

复制代码

上述源码哪里出问题了,请大家指正。

LZ这里下载MA101_DK_v1.03.zip 开发包 http://www.megawin.com.tw/zh-tw/support/index

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top