USB OTG host and device role detection via software

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

USB OTG host and device role detection via software

652 次查看
yangao
Contributor III

Hi

We use iMX6 and expose the USB OTG port. We use OTG-ID pin to set host/device role. When we pull down OTG-ID, it works as a host; we leave it float to make it work as a device. 

We have two kind of special cables to connect to the OTG port:

1) one side of the cable connects to USB OTG port, the other side is UAB-A male. OTG port is in device role when using this cable.

2) one side of the cable connects to USB OTG port, the other side is USB-A female. OTG port is in host role when using this cable.

Everything works fine after we set the OTG-ID. The problem is we have to set OTG-ID manually.

My question is: is there a way to find out what USB cable/device is connected via software and thus we can set OTG-ID properly automatically?

Thanks,

Winston

标签 (1)
标记 (1)
0 项奖励
回复
1 回复

641 次查看
igorpadykov
NXP Employee
NXP Employee

Hi Yan

 

in general one can make necessary connections (ground OTG-ID of float) on cable side

and in software read ID signal as GPIO_1 (ALT3)  on i.MX6DL.

 

Best regards
igor

0 项奖励
回复