USB OTG的工作方式(主/从) [英] How usb OTG works(master/slave)

查看:278
本文介绍了USB OTG的工作方式(主/从)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

设备具有USB OTG支持.以下是场景:

A device has USB OTG support. Following are scenarios:

  1. 将设备连接到PC时,该设备将充当从设备. (设备如何知道它必须充当从设备?)

  1. When a device is connected to a PC, the device acts as slave. (How does the device know it has to act as slave?)

将设备连接到打印机后,该设备将充当主设备. (设备如何知道它必须充当主设备?)

When a device is connected to a printer, the device acts as master. (How does the device know it has to act as master?)

将设备连接到OTG时要执行哪些步骤? 如何实现这一机制(简而言之)?

What are the steps executed when a device is connected to OTG? How to implement this mechanism (in brief)?

推荐答案

USB OTG设备的确切行为在

The exact behavior of USB OTG devices is described in the specification you can find at usb.org. There is a PDF inside the zip called USB_OTG.

第6节中的主机协商协议"介绍了两个OTG设备如何确定哪个设备正在获取嵌入式主机.基本上,这是通过驱动D +线上的上拉和下拉电阻来存档的.

The Host Negotiation Protocol in section 6 covers how two OTG devices decide which one is getting the embedded host. Basically this is archived by driving pull-up and pull-down resistors on the D+ line.

注意:在谈论USB时,不使用主/从术语.主机称为 host 并为总线供电,而从机称为 device .在OTG的情况下(通常,请参阅规范以了解例外情况),这两部分都可以充当主机或设备.当主机通过主机协商协议确定了主机后,该部分即成为所谓的嵌入式主机.

Note: When talking about USB the terms master/slave are not used. The master is called host and powers the bus whereas the slave is called device. In the case of OTG (in general, see specification for exceptions) both parts have the capability to be host or device. When the host was figured out by the Host Negotiation Protocol, this part becomes the so called embedded host.

这篇关于USB OTG的工作方式(主/从)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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