打印

USB OTG引脚初始化时需要设置成哪种模式

[复制链接]
5300|5
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
wendi_fwy|  楼主 | 2010-10-18 19:44 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 wendi_fwy 于 2010-10-19 08:32 编辑

想用STM32F105VC的USB OTG,准备用主模式,USBDMUSBDP初始化时GPIO_InitStructure.GPIO_Mode的模式需要选择为哪种模式
typedef enum
{ GPIO_Mode_AIN = 0x0,
  GPIO_Mode_IN_FLOATING = 0x04,
  GPIO_Mode_IPD = 0x28,
  GPIO_Mode_IPU = 0x48,
  GPIO_Mode_Out_OD = 0x14,
  GPIO_Mode_Out_PP = 0x10,
  GPIO_Mode_AF_OD = 0x1C,
  GPIO_Mode_AF_PP = 0x18
}GPIOMode_TypeDef;

谢谢
沙发
weibn| | 2010-10-19 14:38 | 只看该作者
哪种模式都不用设置,

使用特权

评论回复
板凳
weibn| | 2010-10-19 14:54 | 只看该作者
哪种模式都不用设置,

使用特权

评论回复
地板
weibn| | 2010-10-19 14:55 | 只看该作者
Table 28. OTG_FS pin configuration(1)
1. This table applies to connectivity line devices only.
OTG_FS pinout Configuration GPIO configuration
OTG_FS_SOF
Host AF push-pull, if used
Device AF push-pull, if used
OTG AF push-pull, if used
OTG_FS_VBUS
(2)
2. For the OTG_FS_VBUS pin (PA9) to be used by another shared peripheral or as a general-purpose IO,
the PHY Power-down mode has to be active (clear bit 16 in the OTG_FS_GCCFG register).
Host Input floating
Device Input floating
OTG Input floating
OTG_FS_ID
Host
No need if the Force host mode is selected by software
(FHMOD set in the OTG_FS_GUSBCFG register)
Device
No need if the Force device mode is selected by software
(FDMOD set in the OTG_FS_GUSBCFG register)
OTG Input pull-up
OTG_FS_DM
Host Controlled automatically by the USB power-down
Device Controlled automatically by the USB power-down
OTG Controlled automatically by the USB power-down
OTG_FS_DP
Host Controlled automatically by the USB power-down
Device Controlled automatically by the USB power-down
OTG Controlled automatically by the USB power-down

使用特权

评论回复
5
vigia| | 2010-10-19 15:07 | 只看该作者
不用设置USB的管脚

LZ你可以参考OTG模块的库来做你的项目

使用特权

评论回复
6
wendi_fwy|  楼主 | 2010-10-19 18:59 | 只看该作者
好的,谢谢

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

11

主题

22

帖子

1

粉丝