将 Windows 演示应用程序移植到 WinCE/XP Embedded

发布于 2024-07-20 10:22:51 字数 437 浏览 11 评论 0原文

我们为我们的微控制器产品提供一系列 PC 演示程序。 这些程序通常连接到微控制器板上的 USB HID 芯片。 USB 芯片充当通信桥梁,允许程序通过 SPI/I2C/UART 与微控制器进行通信。 这些程序可以配置微处理器,并获取状态信息以显示给用户。

我们现在希望使用单板 PC 构建一些独立演示。 我们希望尽可能多地重用现有的演示应用程序源代码。 理想情况下,我们可以按原样运行它们。

有人对前进的最佳方式有什么建议吗? 基本选项似乎是 WinCE 或 XP Embedded 板。 WinCE 板的功耗似乎较低,从电池寿命的角度来看,这将是一个优势。

我们现有的演示是在 Borland Builder 下用 C++ 构建的,或者是在 Delphi 中构建的。

提前致谢。

编辑:请参阅下面我的答案以及来自主板供应商的信息。

We have a range of PC demonstration programs for our microcontroller products. The programs typically connect to a USB HID chip on the microcontroller board. The USB chip acts as a communications bridge, allowing the programs to communicate with the micros over SPI/I2C/UART. The programs can configure the micros, and get back status information to display to the user.

We are now looking to build some standalone demonstrations using single board PCs. We would like to reuse as much as possible of our existing demo app source code. Ideally, we could just run them as-is.

Does anybody have any advice on the best way forward? The basic options seem to be WinCE or XP Embedded boards. WinCE boards seem to pull less power, which would be an advantage from a battery life point of view.

Our existing demos are built either in C++ under Borland Builder, or in Delphi.

Thanks in advance.

EDIT: see my answer below with info from a board vendor.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

红玫瑰 2024-07-27 10:22:51

Free Pascal/Lazarus 可以将某些形式的 Delphi 应用程序编译到 WiNCE/arm。 即使是视觉的。

Free Pascal/Lazarus can compile some forms of Delphi apps to WiNCE/arm. Even visual ones.

演多会厌 2024-07-27 10:22:51

WinCE 没有 Delphi 版本,因此您需要重写应用程序。 这同样适用于 Borland Builder 的控件库。 只有当您使用普通的 Win32 API 时,您才能轻松地将您的应用程序移植到 WinCE。 您还可能会遇到硬件访问部分的问题。 串行端口驱动程序可能无法按原样工作。 另外,您需要找到一个可以充当 USB 主机并提供​​ HID 驱动程序的 WinCE 板(这并不常见)。

总之,我相信您更适合使用 Windows XP Embedded 主板。 这些应该按原样运行您的应用程序。

There isn't a Delphi version for WinCE, so you would need to rewrite the applications. The same applies for the Borland Builder's control libraries. Only if you have used plain Win32 API, you would be able to port your application to WinCE easily. You may also encounter problems with the hardware access part. The Serial Port driver may not work as is. Also, you need to find a WinCE board that can act as USB host and provides HID drivers (this isn't very common).

In conclusion, I believe that you would be better of with Windows XP Embedded boards. These should run your applications as they are.

离不开的别离 2024-07-27 10:22:51

作为更新并供​​将来参考,我想我应该在这里发布我们与 WinCE 板供应商讨论的结果。 警告:我实际上还没有尝试过这些。

最重要的是,没有一种简单的方法可以实现我们所希望的(即重新编译现有的演示应用程序以在 WinCE 下运行)。 原因是 Windows 桌面版本中存在的通用 HID 驱动程序和标准 API 在 WinCE 中不存在。

要在 WinCE 中与 HID 设备通信,您需要实现自定义 HID 驱动程序。 这需要支持一个接口,允许用户模式应用程序与驱动程序进行通信,并构建要发送到物理设备的 HID 报告。 由于该接口本身是自定义的,因此应用程序代码需要相应更新。

WinCE 应用程序开发通常使用 Visual Studio 和 Microsoft 编译器完成。 向我们推荐的方法是:

  1. 创建自定义 HID 类驱动程序。 例如,这可能基于 Microsoft 键盘 HID 驱动程序。
  2. 创建一个用于与驾驶员对话的 API。
  3. 使用 .net 创建 GUI 应用程序,并使用 PInvoke 与 API 进行实际对话。

所有这些令人头疼的问题的最终结果是,为了避免与此方法相关的时间和学习曲线,我们将选择运行 XP 的主板。 然后我们可以直接使用现有的演示应用程序。 代价是我们将不得不忍受电池寿命大幅缩短的情况。

As an update, and for future reference, I thought I'd post the results of our discussions with a WinCE board vendor here. Caveat: I haven't actually tried any of this.

The bottom line is that there isn't a straightforward way to do what we were hoping for (i.e., re-compile our existing demo applications to run under WinCE). The reason is that the generic HID drivers and standard APIs that exist in desktop flavours of Windows just aren't there in WinCE.

To talk to HID devices in WinCE you need to implement a custom HID driver. This needs to support an interface allowing user mode applications to communicate with the driver, and to construct HID reports to be sent to the physical device. As this interface would itself be custom, application code needs to be updated accordingly.

WinCE application development is generally done using Visual Studio and the Microsoft compilers. The approach recommended to us was:

  1. Create a custom HID class driver. This could be based on, for instance, the Microsoft keyboard HID driver.
  2. Create an API for talking to the driver.
  3. Use .net to create our GUI applications, and use PInvoke to actually talk to the API.

The end result of all this head-scratching is that to avoid the time and learning curve associated with this approach, we're going to go for a board running XP. We can then use our existing demo applications straight out of box. The trade-off is that we'll have to live with substantially reduced battery life.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文