This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C123GH6PM的USB模式的设置



 USBStackModeSet()这个函数的第二个参数

eUSBModeDevice 

eUSBModeHost,

eUSBModeOTG

eUSBModeNone

eUSBModeForceHost

eUSBModeForceDevice

中的eUSBModeForceDevice和eUSBModeDevice 以及eUSBModeForceHost和eUSBModeHost有什么不同?

谢谢。

  • 好像新的库函数里面没这个函数了,USB的模式吧,主机,从机,OTG,你看看数据手册重视怎么说的

  • 请参考C:\ti\TivaWare_C_Series-2.1.0.12573\docs\SW-TM4C-USBL-UG-2.1.0.12573.pdf文档中的内容。摘抄如下:

    eUSBModeDevice

    Operate in USB device mode with active monitoring of VBUS and the ID
    pin must be pulled to a logic high value.

    eUSBModeHost

    Operate in USB host mode with active monitoring of VBUS and the ID pin
    must be pulled to a logic low value.

    eUSBModeOTG

    Operate as an On-The-Go device which requires both VBUS and ID to be
    connected directly to the USB controller from the USB connector.

    eUSBModeNone

    A marker indicating that no USB mode has yet been set by the application.

    eUSBModeForceHost

    Force host mode so that the VBUS and ID pins are not used or monitored
    by the USB controller.

    eUSBModeForceDevice

    Forcing device mode so that the VBUS and ID pins are not used or
    monitored by the USB controller.