通过USB接口传输数据 [英] transfer data via USB port

查看:248
本文介绍了通过USB接口传输数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以通过USB接口从Android设备传输数据(而非文件)的序列到FPGA板?是否支持Android这种转移顺序使用一些API?

Can I transfer a sequence of data(not file) from an Android device to a FPGA board via USB port? Does android support such transfers sequentially using some APIs?

推荐答案

根据您的Andr​​oid硬件最多有这样三种不同的方式。从最广泛的支持,以至少,他们是亚洲开发银行的协议,USB配件模式和USB主机模式。亚洲开发银行的协议实际上是专为调试Android设备,而Android支持超过它的各种项目,如微桥隧道的TCP连接和< /一>已经使用这个流Android应用程序和外部硬件之间的数据。别人已经链接的文档中的另外两个。

Depending on your Android hardware there are up to three different ways of doing this. From most widely supported to least, they are the ADB protocol, USB Accessory mode, and USB Host mode. The ADB protocol was actually designed for debugging Android devices, but Android supports tunneling TCP connections over it and various projects such as microbridge have used this to stream data between Android applications and external hardware. Someone else has already linked the documentation for the other two.

其中那些你可以实际使用的一种FPGA开发板您使用的是什么样的USB硬件,它有依赖。 (我假设为您使用的是现成的,货架板的时刻。)有些主板只有一个USB至JTAG接口,一般的东西专有和无证,在这种情况下,USB主机是唯一的出路它的接口,您需要在Android到底一些相当难看code。其他的,像OsciPrime和中纺的电路板,使用赛扬preSS FX2微控制器,它同样需要USB主机支持,但可以让你定义这两者之间你自己的USB协议。一些有飞利浦的ISP1362芯片并支持USB主机模式,在这种情况下,你可以使用ADB或者打开附件协议 - 你甚至能的就可以启动ucLinux的,并连接到您的手机的libusb

Which of those you can actually use depends kind of FPGA board are you using and what kind of USB hardware it has. (I'm assuming for the moment that you're using an off-the-shelf board.) Some boards only have a USB-to-JTAG interface, generally something proprietary and undocumented, in which case USB Host is the only way of interfacing with it and you'll need some fairly ugly code on the Android end. Others, like the OsciPrime and Ztex's boards, use a Cypress FX2 microcontroller which again requires USB Host support but lets you define your own USB protocol between the two. A few have a Philips ISP1362 chip and support USB host mode, in which case you can use ADB or the Open Accessory Protocol - you might even be able to boot ucLinux on it and connect to your phone with libusb.

如果您正在开发自己的硬件,这显然取决于个人品味,性能的要求,BOM成本和开发时间之间的权衡,以及如何宽,你需要一系列的Andr​​oid设备是能够支持。例如,USB收发器的TUSB110x范围是非常便宜的,可以支持USB主机模式,因此在理论上,你可以通过接口与它们的存在基本上所有的Andr​​oid硬件,但他们需要大量的FPGA端的工作。

If you're developing your own hardware, it obviously depends on personal taste, performance requirements, the tradeoff between BOM costs and development time, and how wide a range of Android devices you need to be able to support. For example, the TUSB110x range of USB transceivers are dirt-cheap and can support USB Host mode, so in theory you can interface to basically all Android hardware in existence with them, but they require a lot of work on the FPGA side.

(这个答案已扑杀由于两个超级链接限制新用户一些超链接。抱歉。)

(This answer has had some hyperlinks culled due to the two-hyperlink limit for new users. Apologies.)

这篇关于通过USB接口传输数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆